This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART close and open(reinit)

Hello, I am using nrf52810 and S112 Softdevice.

After initializing uart, use uart close for uart sleep.

Then the uart close will be checked.

I want to make an uart init and bring it back to life.

What is the method?

Thank you.

Parents Reply
  • PUBLIC void uart_init(void)
    {
        U32                     err_code;
        UART_CONFIG_t* p_uart = get_uart_config();
        app_uart_comm_params_t const comm_params =
        {     
            .rx_pin_no    = p_uart->RX_pin_no,
            .tx_pin_no    = p_uart->TX_pin_no,
            .rts_pin_no   = p_uart->RTS_pin_no,
            .cts_pin_no   = p_uart->CTS_pin_no,        
            .flow_control = p_uart->FlowCtrl,
            .use_parity   = p_uart->ParityBit,
            .baud_rate    = p_uart->BaudRate
        };
    
        APP_UART_FIFO_INIT(&comm_params,
                           UART_RX_BUF_SIZE,
                           UART_TX_BUF_SIZE,
                           uart_event_handle,
                           APP_IRQ_PRIORITY_LOWEST,
                           err_code);
        APP_ERROR_CHECK(err_code);
    
    }

    This is my uart init code.
    I can't come back to life if I initialize again.

Children
Related