Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_uart_driver.h File Reference

Some devices count the UART instances with LPUART(e.g., KL27) or UART0(e.g., KL25) together. More...

#include <stdint.h>
#include <stdbool.h>
#include "fsl_os_abstraction.h"
#include "fsl_uart_hal.h"

Data Structures

struct  uart_state_t
 Runtime state of the UART driver. More...
 
struct  uart_user_config_t
 User configuration structure for the UART driver. More...
 

Typedefs

typedef void(* uart_rx_callback_t )(uint32_t instance, void *uartState)
 UART receive callback function type.
 
typedef void(* uart_tx_callback_t )(uint32_t instance, void *uartState)
 UART transmit callback function type.
 

Functions

UART Interrupt Driver
uart_status_t UART_DRV_Init (uint32_t instance, uart_state_t *uartStatePtr, const uart_user_config_t *uartUserConfig)
 Initializes an UART instance for operation. More...
 
uart_status_t UART_DRV_Deinit (uint32_t instance)
 Shuts down the UART by disabling interrupts and the transmitter/receiver. More...
 
uart_rx_callback_t UART_DRV_InstallRxCallback (uint32_t instance, uart_rx_callback_t function, uint8_t *rxBuff, void *callbackParam, bool alwaysEnableRxIrq)
 Installs the callback function for the UART receive. More...
 
uart_tx_callback_t UART_DRV_InstallTxCallback (uint32_t instance, uart_tx_callback_t function, uint8_t *txBuff, void *callbackParam)
 Installs the callback function for the UART transmit. More...
 
uart_status_t UART_DRV_SendDataBlocking (uint32_t instance, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout)
 Sends (transmits) data out through the UART module using a blocking method. More...
 
uart_status_t UART_DRV_SendData (uint32_t instance, const uint8_t *txBuff, uint32_t txSize)
 Sends (transmits) data through the UART module using a non-blocking method. More...
 
uart_status_t UART_DRV_GetTransmitStatus (uint32_t instance, uint32_t *bytesRemaining)
 Returns whether the previous UART transmit has finished. More...
 
uart_status_t UART_DRV_AbortSendingData (uint32_t instance)
 Terminates an asynchronous UART transmission early. More...
 
uart_status_t UART_DRV_ReceiveDataBlocking (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout)
 Gets (receives) data from the UART module using a blocking method. More...
 
uart_status_t UART_DRV_ReceiveData (uint32_t instance, uint8_t *rxBuff, uint32_t rxSize)
 Gets (receives) data from the UART module using a non-blocking method. More...
 
uart_status_t UART_DRV_GetReceiveStatus (uint32_t instance, uint32_t *bytesRemaining)
 Returns whether the previous UART receive is complete. More...
 
uart_status_t UART_DRV_AbortReceivingData (uint32_t instance)
 Terminates an asynchronous UART receive early. More...
 

Variables

UART_Type *const g_uartBase [UART_INSTANCE_COUNT]
 Table of base addresses for UART instances. More...
 
const IRQn_Type g_uartRxTxIrqId [UART_INSTANCE_COUNT]
 Table to save UART IRQ enumeration numbers defined in the CMSIS header file.
 

Detailed Description

However, they are different IPs with separate drivers: LPSCI for UART0, LPUART for LPUART. In such cases, this UART driver only works with specific UART instances.

For example, in KL27, there is LPUART0, LPUART1 and UART2. For LPUART0 and LPUART1, use the LPUART driver. For UART2, use this driver and pass in 2 as the instance number. 0 and 1 are not valid.