This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220SF: What is eventCallback in UART2.h? When use it?

Part Number: CC3220SF


Hi, Support Team,

 

Our product use CC3220SF SoC. SimpleLink-SDK version: simplelink_cc32xx_sdk_4_30_00_06.

 

My question:

1.I watch example code “uart2echo”, in UART2.h, I see the UART2_Params struct. I have question what is eventCallback ?

2.When we need use eventCallback ?

 

Best Regards,

Lishen

  • if you want to track internal events on the UART, you can use the eventCallback. It is a function that you define in your application (see the prototype with the possible events below) and it will get invoked whenever an event occurs.

    /*!
    * @brief The definition of a callback function used by the UART driver.
    * The callback can occur in task or interrupt context.
    *
    * @param[in] UART2_Handle UART2_Handle
    *
    * @param[in] event UART2_EVENT that has occurred.
    *
    * @param[in] data - UART2_EVENT_OVERRUN: accumulated count
    * - UART2_EVENT_BREAK: unused
    * - UART2_EVENT_PARITY: unused
    * - UART2_EVENT_FRAMING: unused
    * - UART2_EVENT_TX_BEGIN: unused
    * - UART2_EVENT_TX_FINISHED: unused
    *
    * @param[in] userArg A user supplied argument specified
    * in UART2_Params.
    *
    * @param[in] status A UART2_STATUS code indicating
    * success or failure of the transfer.
    */
    typedef void (*UART2_EventCallback) (UART2_Handle handle, uint32_t event,
    uint32_t data, void *userArg);