Hi All,
I am a beginner,Can you please explain me what is the role of this line?
APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length));
Hi All,
I am a beginner,Can you please explain me what is the role of this line?
APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length));
Is the data being sent extra? I can rely on this practice?
I believe description of nrf_drv_spi_transfer
function on Infocenter is clear: you can either init SPIM driver in blocking mode or with event handler (doing first one will lead into problems in most of the designs so prefer the latter). What it does is simply running the SPI CLK, and running m_tx_buf
data on MOSI line and capturing data from MISO line to m_rf_buf
. See this basic diagram.
And final recommendation: no, it's not "safe" to take some advice from random folks on the internet, never;) You should get logical analyzer (like Saleae or some cheap Chinese clones) and observe it!