I want to tranceive data to ADXL362 through SPI and refer to this program.
https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/spi
However, I can't get data.
I only modified tx_buffer value.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void spi_test_send(void)
{
int err;
u8_t tx_buffer[1] = {0x00}; // Modified here
u8_t rx_buffer[1];
const struct spi_buf tx_buf = {
.buf = tx_buffer,
.len = sizeof(tx_buffer)
};
const struct spi_buf_set tx = {
.buffers = &tx_buf,
.count = 1
};
struct spi_buf rx_buf = {
.buf = rx_buffer,
.len = sizeof(rx_buffer),
};
const struct spi_buf_set rx = {
.buffers = &rx_buf,
Also, I added nrf9160_pca20035_v0_3_0.overlay file.
Any tip?