Kinetis UART

Kinetis UART driver. More...

There are different implementations of the UART interface. The treatment of interrupts is also slightly different. The register UARTx_BDH to UARTx_C4 look almost the same. We distinguish the type of the UART using the BRFA field in the UART C4 register. Currently, only the base TX/RX functionality is available.

UART configuration Example (for periph_conf.h)

static const uart_conf_t uart_config[] = {
    {
        .dev    = UART0,
        .clken  = (volatile uint32_t*)(BITBAND_REGADDR(SIM->SCGC4, SIM_SCGC4_UART0_SHIFT)),
        .freq   = CLOCK_CORECLOCK,
        .pin_rx = GPIO_PIN(PORT_A, 14),
        .pin_tx = GPIO_PIN(PORT_A, 15),
        .pcr_rx = PORT_PCR_MUX(3),
        .pcr_tx = PORT_PCR_MUX(3),
        .irqn   = UART0_RX_TX_IRQn,
    },
    {
        .dev    = UART1,
        .clken  = (volatile uint32_t*)(BITBAND_REGADDR(SIM->SCGC4, SIM_SCGC4_UART1_SHIFT)),
        .freq   = CLOCK_CORECLOCK,
        .pin_rx = GPIO_PIN(PORT_C, 3),
        .pin_tx = GPIO_PIN(PORT_C, 4),
        .pcr_rx = PORT_PCR_MUX(3),
        .pcr_tx = PORT_PCR_MUX(3),
        .irqn   = UART1_RX_TX_IRQn,
    },
};
#define UART_NUMOF          (sizeof(uart_config) / sizeof(uart_config[0]))

Optional settings:

#define KINETIS_UART_ADVANCED    1