Pin assignment GPIOTE and UARTE

Hello there,

If I init a UARTE module (nrf_drv_uart_init) with e.g. Pin RX = 3 is it already enough to just disable the module (nrf_uarte_disable) so I can use the RX as interrupt with GPIOTE module? Do I need to disconnect the Pin (nrf_uarte_txrx_pins_disconnect)?

Basically my question is when is it possible to use a Pin with a other module? Is disabling enough? Do I need to uninit and after interrupt to init again? Thanks :)

Parents
  • Hi,

    If I init a UARTE module (nrf_drv_uart_init) with e.g. Pin RX = 3 is it already enough to just disable the module (nrf_uarte_disable) so I can use the RX as interrupt with GPIOTE module? Do I need to disconnect the Pin (nrf_uarte_txrx_pins_disconnect)?

    Yes and no. As you are using the driver, you should uninit the driver by calling nrf_drv_uart_uninit(). This in turn calls nrfx_uarte_uninit(), which calls nrf_uarte_txrx_pins_disconnect() for you.

    Basically my question is when is it possible to use a Pin with a other module?

    Yes, but you need to properly uninit the driver before using the pins for something else, and then init it again afterwards.

Reply
  • Hi,

    If I init a UARTE module (nrf_drv_uart_init) with e.g. Pin RX = 3 is it already enough to just disable the module (nrf_uarte_disable) so I can use the RX as interrupt with GPIOTE module? Do I need to disconnect the Pin (nrf_uarte_txrx_pins_disconnect)?

    Yes and no. As you are using the driver, you should uninit the driver by calling nrf_drv_uart_uninit(). This in turn calls nrfx_uarte_uninit(), which calls nrf_uarte_txrx_pins_disconnect() for you.

    Basically my question is when is it possible to use a Pin with a other module?

    Yes, but you need to properly uninit the driver before using the pins for something else, and then init it again afterwards.

Children
Related