I want to send packets of 16 bit data over SPI at regular periods from a buffer. I'd appreciate a bit of clarification how to use the SPI xfer function (I already have the timer & PPI set up).
Code snippet below, I have a couple of questions:
1. How to set the pointer in the descriptor? I get an "incompatible pointer type" warning (this may be my inexperience with 'C' showing)
2. What to do with the RX values when the application is transmit only? Leave blank, or set up a dummy receive buffer?
// EasyDMA stuff static BYTE data_buffer[16]; nrf_drv_spi_xfer_desc_t spi_xfer_desc; typedef struct ArrayList{ uint8_t sample[2]; } ArrayList_type; ArrayList_type spi_buffer1[sizeof data_buffer]; spi_xfer_desc.p_tx_buffer = &spi_buffer1; //warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] spi_xfer_desc.tx_length = sizeof(spi_buffer1); nrf_drv_spi_xfer(&spi, &spi_xfer_desc, 0);