Hello everyone
I have an question when I used the 52832.
First of all,I configed "nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL);" and the file (nrf_drv_spi.h) described the information as follow:
/**
* @param handler Event handler provided by the user. If NULL, transfers will be performed in blocking mode.
*/
Note:spi_event_handler is not NULL.So the function should be Non-blocking mode
Now I want to use the SPI +Easydma to achieve the non_Block mode ,Start the SPI and EasyDMA,the code needs to free the CPU(52832),
My code have two functopns.Fuction one is that a sensor will generate an interrupt every 1ms.and I must use the 'nrf_drv_spi_transfer' to communicate to the sensor until the flag spi_xfer_done is True. and The other Function is that the 52832 used SPIS which had enabled the EasyDma to transfer 240 Bytes Data to MOSI pin anytime. The SPIS clock is 2M.The time tansfers the 240 Bytes is :(240*8*0.5)us=960us.
As description above ,CPU just need start the SPI ,it will not speed the time we calculated.But we found Two functions have mutual influence.
In my understanding,the time that started the SPI using EasyDma is just taking a few 'us'.The EasyDma will do the remaining work. But actually it seems to have failed. The effection is the interrupt missed sometimes when start the second Fuction.
What I want to know is that : when I use ‘while (!spi_xfer_done) __WFE();’,will the CPU Free? IF the SPI with EasyDma is non-block mode,the core can achieve the two fuction .
I can confirm that the dma is working.Beacause the clock is continuously。
At the same time I want to know _WFE().It allows the cpu to enter the sleep mode, dose it mean that the cpu can do other works before spi_xfer_done=True?