If you can expect the data to be sent or received at random times over UART, does it make sense to suspend the UART in the driver? Is it fine to leave both TX and RX enabled?
If you can expect the data to be sent or received at random times over UART, does it make sense to suspend the UART in the driver? Is it fine to leave both TX and RX enabled?
Hi
I assume you mean to keep the UART peripheral enabled at all times? There shouldn't be any issues except that the current consumption will be higher while any peripheral is enabled. If your application is dependent on as low as possible current consumption and the device doesn't do anything except waiting for these UART messages in the meantime it would make sense to disable the UART peripheral and go to sleep so that it can be awoken whenever a UART transmission occurs.
Best regards,
Simon
Hi
I assume you mean to keep the UART peripheral enabled at all times? There shouldn't be any issues except that the current consumption will be higher while any peripheral is enabled. If your application is dependent on as low as possible current consumption and the device doesn't do anything except waiting for these UART messages in the meantime it would make sense to disable the UART peripheral and go to sleep so that it can be awoken whenever a UART transmission occurs.
Best regards,
Simon
Thanks. Once the UART peripheral is disabled, you would have to explicitly enable it in the application to start receiving interrupts again, right? how would you go about doing that assuming in terms of logic?
Correct. Do you mean how you would disable and enable the UART peripheral? To disable it using app_uart_close() is recommended to use, which will call the proper uninit functions. Then you can use the app_uart_init() function to enable the UART peripheral again.
Best regards,
Simon