2 UARTE using libuartes: Recoginize what port (context) are communicating

Hi, I'm using the example "libuartes" and developing 2 UARTE. But I dont know how to recoginize what port are communicating with external device because I only have 1 uart_event_handle. So how can I detect ?

  • Did you mean the "libuarte" example? If you really mean the "libuartes", what SDK version are you using?

    If it is in fact the libuarte, then the event holds information telling you what UARTE instance it is.

    From this screenshot, the two words that are marked are the same (the pointer points to the instance that you initialized it with). So if you initialized two, then you can use this to tell which of the instances that triggered the event handler. Alternatively, you can set up two different event handlers for the two instances when you initialize using nrf_libuarte_async_init().

    Best regards,

    Edvin

Related