- I want to use UART port 1/2 on M66 for sending commands to external MicroController for project.
- I have read the UART part from M66 User Manual , utilized example UART program in SDK V2.4
- The examples show when and how to read incoming data but no example has shown how to send
data on UART whenever required.
I got following Callback handler structure for UART :
Ignore the commented part of code!
Now I want to send messages to external MCU whenever user asks M66 to do so. I am controlling water pump from M66 but I’m interfacing another MCU to manage other functions as well. So I am communicating M66 with other MCU using UART port 2(Debug) .
I want to send ON/OFF commands for various GPIO to other MCU whenever required(not only when UART is READR_TO_WRITE) . I don’t know if Callback function is called again & again whenever M66 UART is in READY_TO_WRITE condition.
How can I do that?
What will be the use of EVENT_UART_READY_TO_WRITE in UART_callback function ?
Can I write data to UART port whenever required without considering if UART port is READY TO WRITE?
Because to write data on UART port, only function needed to Call is QL_UART_WRITE() as per manual.
Please help me out.
SDK used : M66_OpenCPU_GS3_SDK_V2.4_Eclipse
UART port 2 (Debug Port) in use for application (Baud 115200)