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

Is there any example about app_uart.c?

I can't find it in my SDK. Pls let me know, if there is.:)

  • Hi,

    hci_slip.c file located in the app_common folder instanciate and use app_uart.c lib.

    Have a look in this file for more information.

    Here is the initialization to have a first idea of the implementation:

    /** @brief Function for enabling the UART module when the SLIP layer is opened.
     */
    static uint32_t slip_uart_open(void)
    {
        uint32_t err_code;
    
        app_uart_comm_params_t comm_params =
        {
            HCI_SLIP_UART_RX_PIN_NUMBER,
            HCI_SLIP_UART_TX_PIN_NUMBER,
            HCI_SLIP_UART_RTS_PIN_NUMBER,
            HCI_SLIP_UART_CTS_PIN_NUMBER,
            HCI_SLIP_UART_MODE,
            false,
            HCI_SLIP_UART_BAUDRATE
        };
    
        err_code = app_uart_init(&comm_params,
                                 NULL,
                                 slip_uart_eventhandler,
                                 APP_IRQ_PRIORITY_LOW,
                                 &m_uart_id);
    
        if (err_code == NRF_SUCCESS)
        {
            m_current_state = SLIP_READY;
        }
    
        return err_code;
    }
    
Related