1) Why nrf_delay_ms(500) is required in twi_sensor example, in main.c, while(true) loop?
2) Is the __WFE(); interrupted by NRF_DRV_TWI_XFER_RX inside twi_handler?
3) From my understanding, the example code will Tx command to the TWI sensor, then TWI sensor will return data continuously (never stop), right?
int main(void)
{
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();
NRF_LOG_INFO("\r\nTWI sensor example started.");
NRF_LOG_FLUSH();
twi_init();
LM75B_set_mode();
while (true)
{
nrf_delay_ms(500);
do
{
/**
Assembly Instruction
\brief Wait For Event
\details Wait For Event is a hint instruction that permits the processor to enter
a low-power state until one of a number of events occurs.
*/
__WFE();
}while (m_xfer_done == false);
read_sensor_data();
NRF_LOG_FLUSH();
}
}
Thank you!!