spi_write16_read16_blocking() function
Write/Read half words to/from an SPI device Write \p len halfwords from \p src to SPI. Simultaneously read \p len halfwords from SPI to \p dst. Blocks until all data is transferred. No timeout, as SPI hardware always transfers at a known data rate.
Arguments
spi
SPI instance specifier, either
spi0
or
spi1
src
Buffer of data to write
len
Length of BOTH buffers in halfwords
Return value
Number of halfwords written/read
Notes
SPI should be initialised with 16 data_bits using spi_set_format first, otherwise this function will only read/write 8 data_bits.