spi_read16_blocking() function
Read from an SPI device 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. \p repeated_tx_data is output repeatedly on TX as data is read in from RX. Generally this can be 0, but some devices require a specific value here, e.g. SD cards expect 0xff
Arguments
spi
SPI instance specifier, either
spi0
or
spi1
repeated_tx_data
Buffer of data to write
len
Length of buffer \p dst 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 8 data_bits.