I have a simple ANT beacon application. UART will be enabled to do some communication. How can I turn it off before ANT goes into sleep mode? Is there a call back function I can put some "before sleep" clean up code?
Thanks
I have a simple ANT beacon application. UART will be enabled to do some communication. How can I turn it off before ANT goes into sleep mode? Is there a call back function I can put some "before sleep" clean up code?
Thanks
How are you using the UART? Driver or something else?
Use nRF driver to do some communication. I guess you are thinking I know when to shut off the UART. And you are right , in this case actually I could. So my broader question will be: Is there a "callback" in the stack I can put my "clean up" code there to MAKE SURE everything gets turned off.
But are you using nrf_drv_uart.h directly or something like app_uart.h?
I am using app_uart.h
APP_UART_FIFO_INIT(&uartComm, 32, 64, uart_event_handler, APP_IRQ_PRIORITY_HIGH, err_code);
You can call app_uart_close() before you go into sleep, so before sd_app_evt_wait();
If you want to be absolutely sure, you can check that NRF_UART0->ENABLE is 0 before you go to sleep.
Then you would have to reinitialize UART when you want to use it again.