When NRF52832 as SPI Slave, how can I know how many bytes the slave should read,the API nrf_drv_spis_buffers_set(&spis, m_tx_buf, length, m_rx_buf, length)),does not have the real receive byte
When NRF52832 as SPI Slave, how can I know how many bytes the slave should read,the API nrf_drv_spis_buffers_set(&spis, m_tx_buf, length, m_rx_buf, length)),does not have the real receive byte
This is usually defined by the Slave. So, in the usual use-case of the microcontroller being the master, you would look it up in the Slave's documentation.
As you are creating the Slave here, it is you that defines what it does.
If you want it to be variable, then you will have to devise some sort of protocol to exchange the information.
I have write a test SPI master, when execute read operation, SPI slave produce NRF_DRV_SPIS_XFER_DONE event, then the whole data is in buffer, I have no time to process the data and judgement which command have receive
I have write a test SPI master, when execute read operation, SPI slave produce NRF_DRV_SPIS_XFER_DONE event, then the whole data is in buffer, I have no time to process the data and judgement which command have receive