How to use the RXTO event trigger rx interrupt?

software:nRF CONNECT SDK 1.6.1

CPU type:nrf5340

module:uarte

hi professor,

I want to trigger receiving interrupt when receiving timeout.I see the product specification there are rxto event in nrf5340.Do you have any example code for me?

Parents
  • Hello,

    I don't think we have any example code showing you how to use the RXTO event directly, but it also doesn't do what you describe. The RXTO event is triggered if you use the STOP task register. 

    From what I understand from your question, you want to receive a buffer after a certain time, perhaps from the first byte. Is that correct? If so, you can look into the peripheral_uart sample found in NCS\nrf\samples\bluetooth\peripheral_uart.

    In this sample, you will get a callback when the UART receives some bytes, and then stops. After a given amount of time, the UART will trigger a callback with all the bytes received before the timeout.

    Best regards,

    Edvin

  • hi professor,

    I have uesd peripherl_uart example to test and it can meet my needs. But I must use path \zephyr\samples\bluetooth to create my project.Do you have any other suggestions

  • Hello,

    sunnyyang said:
    The peripheral_uart  use uart_rx_enable to enable uart.

    But did you check what uart_rx_enable does? It uses the uarte_nrfx_init() inside uart_nrfx_uarte.c found in ncs\zephyr\drivers\serial\uart_nrfx_uarte.c.

    sunnyyang said:
    But I must use path \zephyr\samples\bluetooth to create my project

    What do you mean by this? And why must you use this folder?

    Best regards,

    Edvin

Reply
  • Hello,

    sunnyyang said:
    The peripheral_uart  use uart_rx_enable to enable uart.

    But did you check what uart_rx_enable does? It uses the uarte_nrfx_init() inside uart_nrfx_uarte.c found in ncs\zephyr\drivers\serial\uart_nrfx_uarte.c.

    sunnyyang said:
    But I must use path \zephyr\samples\bluetooth to create my project

    What do you mean by this? And why must you use this folder?

    Best regards,

    Edvin

Children
Related