The friendly Operating System for the Internet of Things
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 functionality is available.

UART configuration Example (for periph_conf.h)

#define UART_NUMOF          (1U)
#define UART_0_EN           1
#define UART_IRQ_PRIO       1
#define UART_CLK            (48e6)

// UART 0 device configuration
#define KINETIS_UART        UART0_Type
#define UART_0_DEV          UART0
#define UART_0_CLKEN()      (SIM->SCGC4 |= (SIM_SCGC4_UART0_MASK))
#define UART_0_CLK          UART_CLK
#define UART_0_IRQ_CHAN     UART0_IRQn
#define UART_0_ISR          isr_uart0
// UART 0 pin configuration
#define UART_0_PORT_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTA_MASK))
#define UART_0_PORT         PORTA
#define UART_0_RX_PIN       1
#define UART_0_TX_PIN       2
#define UART_0_AF           2

Optional settings:

#define KINETIS_UART_ADVANCED    1