| Kinetis SDK API Reference Manual 1.0.0-beta Freescale Semiconductor, Inc.

- Introduction
- Related Pages
- API Usage

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Enumerations
UART HAL driver
Universal Asynchronous Receiver/Transmitter (UART)

The section describes the programming interface of the UART HAL driver. More...

## Data Structures
struct | uart_idle_line_config_t
| Structure for idle line configuration settings. More...
struct | uart_status_flag_all_t
| Structure for all UART status flags. More...
struct | uart_interrupt_config_t
| UART interrupt configuration structure, default settings are 0 (disabled). More...
struct | uart_config_t
| UART configuration structure. More...

## Enumerations
enum | uart_status_t { kStatus_UART_Success = 0, kStatus_UART_BaudRateCalculationError, kStatus_UART_BaudRatePercentDiffExceeded, kStatus_UART_BitCountNotSupported, kStatus_UART_StopBitCountNotSupported, kStatus_UART_RxStandbyModeError, kStatus_UART_ClearStatusFlagError, kStatus_UART_MSBFirstNotSupported, kStatus_UART_ResyncNotSupported, kStatus_UART_TxNotDisabled, kStatus_UART_RxNotDisabled, kStatus_UART_TxOrRxNotDisabled, kStatus_UART_TxBusy, kStatus_UART_RxBusy, kStatus_UART_NoTransmitInProgress, kStatus_UART_NoReceiveInProgress, kStatus_UART_InvalidInstanceNumber, kStatus_UART_InvalidBitSetting, kStatus_UART_OverSamplingNotSupported, kStatus_UART_BothEdgeNotSupported, kStatus_UART_Timeout }
| Error codes for the UART driver. More...
enum | uart_stop_bit_count_t { kUartOneStopBit = 0, kUartTwoStopBit = 1 }
| UART number of stop bits. More...
enum | uart_parity_mode_t { kUartParityDisabled = 0x0, kUartParityEven = 0x2, kUartParityOdd = 0x3 }
| UART parity mode. More...
enum | uart_bit_count_per_char_t { kUart8BitsPerChar = 0, kUart9BitsPerChar = 1, kUart10BitsPerChar = 2 }
| UART number of bits in a character. More...
enum | uart_operation_config_t { kUartOperates = 0, kUartStops = 1 }
| UART operation configuration constants. More...
enum | uart_wakeup_method_t { kUartIdleLineWake = 0, kUartAddrMarkWake = 1 }
| UART wakeup from standby method constants. More...
enum | uart_idle_line_select_t { kUartIdleLineAfterStartBit = 0, kUartIdleLineAfterStopBit = 1 }
| UART idle-line detect selection types. More...
enum | uart_break_char_length_t { kUartBreakChar10BitMinimum = 0, kUartBreakChar13BitMinimum = 1 }
| UART break character length settings for transmit/detect. More...
enum | uart_singlewire_txdir_t { kUartSinglewireTxdirIn = 0, kUartSinglewireTxdirOut = 1 }
| UART single-wire mode transmit direction. More...
enum | uart_status_flag_t { kUartTransmitDataRegisterEmpty, kUartTransmissionComplete, kUartReceiveDataRegisterFull, kUartIdleLineDetect, kUartReceiveOverrun, kUartNoiseDetect, kUartFrameError, kUartParityError, kUartLineBreakDetect, kUartReceiveActiveEdgeDetect, kUartReceiverActive }
| UART status flags. More...
enum | uart_ir_tx_pulsewidth_t { kUartIrThreeSixteenthsWidth = 0, kUartIrOneSixteenthWidth = 1, kUartIrOneThirtysecondsWidth = 2, kUartIrOneFourthWidth = 3 }
| UART infrared transmitter pulse width options. More...

## UART Common Configurations
uart_status_t | uart_hal_init (uint32_t uartInstance, const uart_config_t *config)
| Initialize the UART controller. More...
uart_status_t | uart_hal_set_baud_rate (uint32_t uartInstance, uint32_t sourceClockInHz, uint32_t desiredBaudRate)
| Configure the UART baud rate. More...
uart_status_t | uart_hal_set_baud_rate_divisor (uint32_t uartInstance, uint32_t baudRateDivisor)
| Set the UART baud rate modulo divisor value. More...
uart_status_t | uart_hal_configure_bit_count_per_char (uint32_t uartInstance, uart_bit_count_per_char_t bitCountPerChar)
| Configure number of bits per character in the UART controller. More...
void | uart_hal_configure_parity_mode (uint32_t uartInstance, uart_parity_mode_t parityModeType)
| Configure the parity mode in the UART controller. More...
uart_status_t | uart_hal_configure_stop_bit_count (uint32_t uartInstance, uart_stop_bit_count_t stopBitCount)
| Configure the number of stop bits in the UART controller. More...
void | uart_hal_configure_tx_rx_inversion (uint32_t uartInstance, uint32_t rxInvert, uint32_t txInvert)
| Configure the transmit and receive inversion control in UART controller. More...
void | uart_hal_enable_transmitter (uint32_t uartInstance)
| Enable the UART transmitter. More...
void | uart_hal_disable_transmitter (uint32_t uartInstance)
| Disable the UART transmitter. More...
bool | uart_hal_is_transmitter_enabled (uint32_t uartInstance)
| Get the UART transmitter enabled/disabled configuration setting. More...
void | uart_hal_enable_receiver (uint32_t uartInstance)
| Enable the UART receiver. More...
void | uart_hal_disable_receiver (uint32_t uartInstance)
| Disable the UART receiver. More...
bool | uart_hal_is_receiver_enabled (uint32_t uartInstance)
| Get the UART receiver enabled/disabled configuration setting. More...

## UART Interrupts and DMA
void | uart_hal_configure_interrupts (uint32_t uartInstance, const uart_interrupt_config_t *interruptConfig)
| Configure the UART module interrupts to enable/disable various interrupt sources. More...
void | uart_hal_enable_break_detect_interrupt (uint32_t uartInstance)
| Enable the break_detect_interrupt. More...
void | uart_hal_disable_break_detect_interrupt (uint32_t uartInstance)
| Disable the break_detect_interrupt. More...
bool | uart_hal_is_break_detect_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the break_detect_interrupt enable setting. More...
void | uart_hal_enable_rx_active_edge_interrupt (uint32_t uartInstance)
| Enable the rx_active_edge_interrupt. More...
void | uart_hal_disable_rx_active_edge_interrupt (uint32_t uartInstance)
| Disable the rx_active_edge_interrupt. More...
bool | uart_hal_is_rx_active_edge_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the rx_active_edge_interrupt enable setting. More...
void | uart_hal_enable_tx_data_register_empty_interrupt (uint32_t uartInstance)
| Enable the tx_data_register_empty_interrupt. More...
void | uart_hal_disable_tx_data_register_empty_interrupt (uint32_t uartInstance)
| Disable the tx_data_register_empty_interrupt. More...
bool | uart_hal_is_tx_data_register_empty_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the tx_data_register_empty_interrupt enable setting. More...
void | uart_hal_enable_transmission_complete_interrupt (uint32_t uartInstance)
| Enable the transmission_complete_interrupt. More...
void | uart_hal_disable_transmission_complete_interrupt (uint32_t uartInstance)
| Disable the transmission_complete_interrupt. More...
bool | uart_hal_is_transmission_complete_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the transmission_complete_interrupt enable setting. More...
void | uart_hal_enable_rx_data_register_full_interrupt (uint32_t uartInstance)
| Enable the rx_data_register_full_interrupt. More...
void | uart_hal_disable_rx_data_register_full_interrupt (uint32_t uartInstance)
| Disable the rx_data_register_full_interrupt. More...
bool | uart_hal_is_receive_data_full_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the rx_data_register_full_interrupt enable setting. More...
void | uart_hal_enable_idle_line_interrupt (uint32_t uartInstance)
| Enable the idle_line_interrupt. More...
void | uart_hal_disable_idle_line_interrupt (uint32_t uartInstance)
| Disable the idle_line_interrupt. More...
bool | uart_hal_is_idle_line_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the idle_line_interrupt enable setting. More...
void | uart_hal_enable_rx_overrun_interrupt (uint32_t uartInstance)
| Enable the rx_overrun_interrupt. More...
void | uart_hal_disable_rx_overrun_interrupt (uint32_t uartInstance)
| Disable the rx_overrun_interrupt. More...
bool | uart_hal_is_rx_overrun_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the rx_overrun_interrupt enable setting. More...
void | uart_hal_enable_noise_error_interrupt (uint32_t uartInstance)
| Enable the noise_error_interrupt. More...
void | uart_hal_disable_noise_error_interrupt (uint32_t uartInstance)
| Disable the noise_error_interrupt. More...
bool | uart_hal_is_noise_error_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the noise_error_interrupt enable setting. More...
void | uart_hal_enable_framing_error_interrupt (uint32_t uartInstance)
| Enable the framing_error_interrupt. More...
void | uart_hal_disable_framing_error_interrupt (uint32_t uartInstance)
| Disable the framing_error_interrupt. More...
bool | uart_hal_is_framing_error_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the framing_error_interrupt enable setting. More...
void | uart_hal_enable_parity_error_interrupt (uint32_t uartInstance)
| Enable the parity_error_interrupt. More...
void | uart_hal_disable_parity_error_interrupt (uint32_t uartInstance)
| Disable the parity_error_interrupt. More...
bool | uart_hal_is_parity_error_interrupt_enabled (uint32_t uartInstance)
| Get the configuration of the parity_error_interrupt enable setting. More...
void | uart_hal_configure_dma (uint32_t uartInstance, bool txDmaConfig, bool rxDmaConfig)
| Configure the UART DMA requests for the Transmitter and Receiver. More...
bool | uart_hal_is_txdma_enabled (uint32_t uartInstance)
| Get the UART Transmit DMA request configuration setting. More...
bool | uart_hal_is_rxdma_enabled (uint32_t uartInstance)
| Get the UART Receive DMA request configuration setting. More...

## UART Transfer Functions
void | uart_hal_putchar (uint32_t uartInstance, uint8_t data)
| This function allows the user to send an 8-bit character from the UART data register. More...
void | uart_hal_putchar9 (uint32_t uartInstance, uint16_t data)
| This function allows the user to send a 9-bit character from the UART data register. More...
uart_status_t | uart_hal_putchar10 (uint32_t uartInstance, uint16_t data)
| This function allows the user to send a 10-bit character from the UART data register. More...
void | uart_hal_getchar (uint32_t uartInstance, uint8_t *readData)
| This function gets a received 8-bit character from the UART data register. More...
void | uart_hal_getchar9 (uint32_t uartInstance, uint16_t *readData)
| This function gets a received 9-bit character from the UART data register. More...
uart_status_t | uart_hal_getchar10 (uint32_t uartInstance, uint16_t *readData)
| This function gets a received 10-bit character from the UART data register. More...

## UART Special Feature Configurations
void | uart_hal_configure_wait_mode_operation (uint32_t uartInstance, uart_operation_config_t mode)
| Configure the UART to either operate or cease to operate in WAIT mode. More...
uart_operation_config_t | uart_hal_get_wait_mode_operation_config (uint32_t uartInstance)
| Determine if the UART operates or ceases to operate in WAIT mode. More...
void | uart_hal_configure_loopback_mode (uint32_t uartInstance, bool enable)
| Configure the UART loopback operation. More...
void | uart_hal_configure_singlewire_mode (uint32_t uartInstance, bool enable)
| Configure the UART single-wire operation. More...
void | uart_hal_configure_txdir_in_singlewire_mode (uint32_t uartInstance, uart_singlewire_txdir_t direction)
| Configure the UART transmit direction while in single-wire mode. More...
uart_status_t | uart_hal_put_receiver_in_standby_mode (uint32_t uartInstance)
| Place the UART receiver in standby mode. More...
void | uart_hal_put_receiver_in_normal_mode (uint32_t uartInstance)
| Place the UART receiver in normal mode (disable standby mode operation). More...
bool | uart_hal_is_receiver_in_standby (uint32_t uartInstance)
| Determine if the UART receiver is currently in standby mode. More...
void | uart_hal_select_receiver_wakeup_method (uint32_t uartInstance, uart_wakeup_method_t method)
| Select the UART receiver wakeup method (idle-line or address-mark) from standby mode. More...
uart_wakeup_method_t | uart_hal_get_receiver_wakeup_method (uint32_t uartInstance)
| Get the UART receiver wakeup method (idle-line or address-mark) from standby mode. More...
void | uart_hal_configure_idle_line_detect (uint32_t uartInstance, const uart_idle_line_config_t *config)
| Configure the operation options of the UART idle line detect. More...
void | uart_hal_set_break_char_transmit_length (uint32_t uartInstance, uart_break_char_length_t length)
| Configure the UART break character transmit length. More...
void | uart_hal_set_break_char_detect_length (uint32_t uartInstance, uart_break_char_length_t length)
| Configure the UART break character detect length. More...
void | uart_hal_queue_break_char_to_send (uint32_t uartInstance, bool enable)
| Configure the UART transmit send break character operation. More...
uart_status_t | uart_hal_configure_match_address_operation (uint32_t uartInstance, bool matchAddrMode1, bool matchAddrMode2, uint8_t matchAddrValue1, uint8_t matchAddrValue2)
| Configure the UART match address mode control operation. More...
uart_status_t | uart_hal_configure_send_msb_first_operation (uint32_t uartInstance, bool enable)
| Configure the UART to send data MSB first (Note: Feature available on select UART instances) More...
uart_status_t | uart_hal_configure_receive_resync_disable_operation (uint32_t uartInstance, bool enable)
| Configuration option to disable the UART resynchronization during received data. More...

## UART Status Flags
void | uart_hal_get_all_status_flag (uint32_t uartInstance, uart_status_flag_all_t *allStatusFlag)
| Get all of the UART status flag states. More...
bool | uart_hal_is_transmit_data_register_empty (uint32_t uartInstance)
| Get the UART Transmit data register empty flag. More...
bool | uart_hal_is_transmission_complete (uint32_t uartInstance)
| Get the UART Transmission complete flag. More...
bool | uart_hal_is_receive_data_register_full (uint32_t uartInstance)
| Get the UART Receive data register full flag. More...
bool | uart_hal_is_idle_line_detected (uint32_t uartInstance)
| Get the UART Idle-line detect flag. More...
bool | uart_hal_is_receive_overrun_detected (uint32_t uartInstance)
| Get the UART Receiver Overrun status flag. More...
bool | uart_hal_is_noise_detected (uint32_t uartInstance)
| Get the UART noise status flag. More...
bool | uart_hal_is_frame_error_detected (uint32_t uartInstance)
| Get the UART Frame error status flag. More...
bool | uart_hal_is_parity_error_detected (uint32_t uartInstance)
| Get the UART parity error status flag. More...
bool | uart_hal_is_line_break_detected (uint32_t uartInstance)
| Get the UART LIN break detect interrupt status flag. More...
bool | uart_hal_is_receive_active_edge_detected (uint32_t uartInstance)
| Get the UART Receive pin active edge interrupt status flag. More...
bool | uart_hal_is_receiver_active (uint32_t uartInstance)
| Get the UART Receiver Active Flag (RAF) state. More...
uart_status_t | uart_hal_clear_status_flag (uint32_t uartInstance, uart_status_flag_t statusFlag)
| Clear an individual and specific UART status flag. More...
void | uart_hal_clear_all_non_autoclear_status_flags (uint32_t uartInstance)
| Clear ALL of the UART status flags. More...

## Data Structure Documentation

struct uart_idle_line_config_t

This structure contains settings for the UART idle line configuration such as the Idle Line Type (ILT) and the Receiver Wake Up Idle Detect (RWUID).

### Data Fields
unsigned | idleLineType: 1
| ILT, Idle bit count start: 0 - after start bit (default), 1 - after stop bit.
unsigned | rxWakeIdleDetect: 1
| RWUID, Receiver Wake Up Idle Detect. More...

#### Field Documentation

unsigned uart_idle_line_config_t::rxWakeIdleDetect

IDLE status bit operation during receive standby. Controls whether idle character that wakes up receiver will also set IDLE status bit 0 - IDLE status bit doesn't get set (default), 1 - IDLE status bit gets set

struct uart_status_flag_all_t

This structure contains the settings for all of the UART status flags.

### Data Fields
unsigned | transmitDataRegisterEmpty: 1
| Transmit data register empty flag, sets when transmit buffer is empty.
unsigned | transmissionComplete: 1
| Transmission complete flag, sets when transmitter is idle (transmission activity complete)
unsigned | receiveDataRegisterFull: 1
| Receive data register full flag, sets when the receive data buffer is full.
unsigned | idleLineDetect: 1
| Idle line detect flag, sets when idle line detected.
unsigned | receiveOverrun: 1
| Receiver Overrun, sets when new data is received before data is read from receive register.
unsigned | noiseDetect: 1
| Receiver takes 3 samples of each received bit. More...
unsigned | frameError: 1
| Frame error flag, sets if logic 0 was detected where stop bit expected.
unsigned | parityError: 1
| If parity enabled, will set upon parity error detection.
unsigned | lineBreakDetect: 1
| LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled.
unsigned | receiveActiveEdgeDetect: 1
| Receive pin active edge interrupt flag, sets when active edge detected.
unsigned | receiverActive: 1
| Receiver Active Flag (RAF), sets at beginning of valid start bit.

#### Field Documentation

unsigned uart_status_flag_all_t::noiseDetect

If any of these samples differ, noise flag sets

struct uart_interrupt_config_t

This structure contains the settings for all of the UART interrupt configurations.

### Data Fields
unsigned | linBreakDetect: 1
| LIN break detect: 0 - disable interrupt, 1 - enable interrupt.
unsigned | rxActiveEdge: 1
| RX Active Edge: 0 - disable interrupt, 1 - enable interrupt.
unsigned | transmitDataRegisterEmpty: 1
| Transmit data register empty: 0 - disable interrupt, 1 - enable interrupt.
unsigned | transmitComplete: 1
| Transmission complete: 0 - disable interrupt, 1 - enable interrupt.
unsigned | receiverDataRegisterFull: 1
| Receiver data register full: 0 - disable interrupt, 1 - enable interrupt.
unsigned | idleLine: 1
| Idle line: 0 - disable interrupt, 1 - enable interrupt.
unsigned | receiverOverrun: 1
| Receiver Overrun: 0 - disable interrupt, 1 - enable interrupt.
unsigned | noiseErrorFlag: 1
| Noise error flag: 0 - disable interrupt, 1 - enable interrupt.
unsigned | frameErrorFlag: 1
| Framing error flag: 0 - disable interrupt, 1 - enable interrupt.
unsigned | parityErrorFlag: 1
| Parity error flag: 0 - disable interrupt, 1 - enable interrupt.

struct uart_config_t

This structure contains the settings for the most common UART configurations including the UART module source clock, baud rate, parity mode, stop bit count, data bit count per character, and tx/rx inversion options (which is the least common of the configurations).

### Data Fields
uint32_t | uartSourceClockInHz
| UART module source clock in Hz.
uint32_t | baudRate
| UART baud rate.
uart_parity_mode_t | parityMode
| Parity mode, disabled (default), even, or odd.
uart_stop_bit_count_t | stopBitCount
| Number of stop bits, 1 stop bit (default) or 2 stop bits.
uart_bit_count_per_char_t | bitCountPerChar
| Number of bits, 8-bit (default) or 9-bit in a word (up to 10-bits in some UART instances)
unsigned | rxDataInvert: 1
| Receive Data Inversion: 0 - not inverted (default), 1 - inverted.
unsigned | txDataInvert: 1
| Transmit Data Inversion: 0 - not inverted (default), 1 - inverted.

## Enumeration Type Documentation

enum uart_status_t

Enumerator
kStatus_UART_BaudRateCalculationError | UART Baud Rate calculation error out of range.
kStatus_UART_BaudRatePercentDiffExceeded | UART Baud Rate exceeds percentage difference.
kStatus_UART_BitCountNotSupported | UART bit count config not supported.
kStatus_UART_StopBitCountNotSupported | UART stop bit count config not supported.
kStatus_UART_RxStandbyModeError | UART unable to place receiver in standby mode.
kStatus_UART_ClearStatusFlagError | UART clear status flag error.
kStatus_UART_MSBFirstNotSupported | UART MSB first feature not supported.
kStatus_UART_ResyncNotSupported | UART resync disable operation not supported.
kStatus_UART_TxNotDisabled | UART Transmitter not disabled before enabling feature.
kStatus_UART_RxNotDisabled | UART Receiver not disabled before enabling feature.
kStatus_UART_TxOrRxNotDisabled | UART Transmitter or Receiver not disabled.
kStatus_UART_TxBusy | UART transmit still in progress.
kStatus_UART_RxBusy | UART receive still in progress.
kStatus_UART_NoTransmitInProgress | UART no transmit in progress.
kStatus_UART_NoReceiveInProgress | UART no receive in progress.
kStatus_UART_InvalidInstanceNumber | Invalid UART instance number.
kStatus_UART_InvalidBitSetting | Invalid setting for desired UART register bit field.
kStatus_UART_OverSamplingNotSupported | UART oversampling not supported.
kStatus_UART_BothEdgeNotSupported | UART both edge sampling not supported.
kStatus_UART_Timeout | UART transfer timed out.

enum uart_stop_bit_count_t

These constants define the number of allowable stop bits to configure in a UART instance.

Enumerator
kUartOneStopBit | one stop bit
kUartTwoStopBit | two stop bits

enum uart_parity_mode_t

These constants define the UART parity mode options: disabled or enabled of type even or odd.

Enumerator
kUartParityDisabled | parity disabled
kUartParityEven | parity enabled, type even, bit setting: PE|PT = 10
kUartParityOdd | parity enabled, type odd, bit setting: PE|PT = 11

enum uart_bit_count_per_char_t

These constants define the number of allowable data bits per UART character. Note, check the UART documentation to determine if the desired UART instance supports the desired number of data bits per UART character.

Enumerator
kUart8BitsPerChar | 8-bit data characters
kUart9BitsPerChar | 9-bit data characters
kUart10BitsPerChar | 10-bit data characters

enum uart_operation_config_t

This provides constants for UART operational states: "operates normally" or "stops/ceases operation"

Enumerator
kUartOperates | UART continues to operate normally.
kUartStops | UART ceases operation.

enum uart_wakeup_method_t

This provides constants for the two UART wakeup methods: idle-line or address-mark.

Enumerator
kUartIdleLineWake | The idle-line wakes UART receiver from standby.
kUartAddrMarkWake | The address-mark wakes UART receiver from standby.

enum uart_idle_line_select_t

This provides constants for the UART idle character bit-count start: either after start or stop bit.

Enumerator
kUartIdleLineAfterStartBit | UART idle character bit count start after start bit.
kUartIdleLineAfterStopBit | UART idle character bit count start after stop bit.

enum uart_break_char_length_t

This provides constants for the UART break character length for both transmission and detection purposes. Note that the actual maximum bit times may vary depending on the UART instance.

Enumerator
kUartBreakChar10BitMinimum | UART break char length 10 bit times (if M = 0, SBNS = 0) or 11 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 12 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1)
kUartBreakChar13BitMinimum | UART break char length 13 bit times (if M = 0, SBNS = 0) or 14 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 15 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 16 (if M10 = 1, SNBS = 1)

enum uart_singlewire_txdir_t

This provides constants for the UART transmit direction when configured for single-wire mode. The transmit line TXDIR is either an input or output.

Enumerator
kUartSinglewireTxdirIn | UART Single-Wire mode TXDIR input.
kUartSinglewireTxdirOut | UART Single-Wire mode TXDIR output.

enum uart_status_flag_t

This provides constants for the UART status flags for use in the UART functions.

Enumerator
kUartTransmitDataRegisterEmpty | Transmit data register empty flag, sets when transmit buffer is empty.
kUartTransmissionComplete | Transmission complete flag, sets when transmitter is idle (transmission activity complete)
kUartReceiveDataRegisterFull | Receive data register full flag, sets when the receive data buffer is full.
kUartIdleLineDetect | Idle line detect flag, sets when idle line detected.
kUartReceiveOverrun | Receiver Overrun, sets when new data is received before data is read from receive register.
kUartNoiseDetect | Receiver takes 3 samples of each received bit. If any of these samples differ, noise flag sets
kUartFrameError | Frame error flag, sets if logic 0 was detected where stop bit expected.
kUartParityError | If parity enabled, sets upon parity error detection.
kUartLineBreakDetect | LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled.
kUartReceiveActiveEdgeDetect | Receive pin active edge interrupt flag, sets when active edge detected.
kUartReceiverActive | Receiver Active Flag (RAF), sets at beginning of valid start bit.

enum uart_ir_tx_pulsewidth_t

This provides constants for the UART infrared (IR) pulse widths. Options include 3/16, 1/16 1/32, and 1/4 pulse widths.

Enumerator
kUartIrThreeSixteenthsWidth | 3/16 pulse
kUartIrOneSixteenthWidth | 1/16 pulse
kUartIrOneThirtysecondsWidth | 1/32 pulse
kUartIrOneFourthWidth | 1/4 pulse

## Function Documentation

uart_status_t uart_hal_init | ( | uint32_t | uartInstance,
|  | const uart_config_t * | config
| ) |  |

This function initializes the module to user defined settings and default settings. Here is an example demonstrating how to define the uart_config_t structure and call the uart_hal_init function:

uart_config_t uartConfig;
uartConfig.uartSourceClockInHz = uartSourceClock;
uartConfig.baudRate = baudRate;
uartConfig.bitCountPerChar = kUart8BitsPerChar;
uartConfig.parityMode = kUartParityDisabled;
uartConfig.stopBitCount = kUartOneStopBit;
uartConfig.txDataInvert = 0;
uartConfig.rxDataInvert = 0;
uart_hal_init(uartInstance, &uartConfig);

Parameters

  uartInstance | UART module instance number.
  config | UART configuration data.

Returns
  An error code or kStatus_UART_Success.

uart_status_t uart_hal_set_baud_rate | ( | uint32_t | uartInstance,
|  | uint32_t | sourceClockInHz,
|  | uint32_t | desiredBaudRate
| ) |  |

This function programs the UART baud rate to the desired value passed in by the user. The user must also pass in the module source clock so that the function can calculate the baud rate divisors to their appropriate values. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. Generally this is applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  sourceClockInHz | UART source input clock in Hz.
  desiredBaudRate | UART desired baud rate.

Returns
  An error code or kStatus_UART_Success

uart_status_t uart_hal_set_baud_rate_divisor | ( | uint32_t | uartInstance,
|  | uint32_t | baudRateDivisor
| ) |  |

This function allows the user to program the baud rate divisor directly in situations where the divisor value is known. In this case, the user may not want to call the uart_hal_set_baud_rate() function, as the divisor is already known.

Parameters

  uartInstance | UART module instance number.
  baudRateDivisor | The baud rate modulo division "SBR" value.

Returns
  An error code or kStatus_UART_Success.

uart_status_t uart_hal_configure_bit_count_per_char | ( | uint32_t | uartInstance,
|  | uart_bit_count_per_char_t | bitCountPerChar
| ) |  |

This function allows the user to configure the number of bits per character according to the typedef uart_bit_count_per_char_t. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  bitCountPerChar | Number of bits per char (8, 9, or 10, depending on the UART instance).

Returns
  An error code or kStatus_UART_Success.

void uart_hal_configure_parity_mode | ( | uint32_t | uartInstance,
|  | uart_parity_mode_t | parityModeType
| ) |  |

This function allows the user to configure the parity mode of the UART controller to disable it or enable it for even parity or for odd parity. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  parityModeType | Parity mode setting (enabled, disable, odd, even - see parity_mode_t struct).

uart_status_t uart_hal_configure_stop_bit_count | ( | uint32_t | uartInstance,
|  | uart_stop_bit_count_t | stopBitCount
| ) |  |

This function allows the user to configure the number of stop bits in the UART controller to be one or two stop bits. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  stopBitCount | Number of stop bits setting (1 or 2 - see uart_stop_bit_count_t struct).

Returns
  An error code (an unsupported setting in some UARTs) or kStatus_UART_Success.

void uart_hal_configure_tx_rx_inversion | ( | uint32_t | uartInstance,
|  | uint32_t | rxInvert,
|  | uint32_t | txInvert
| ) |  |

This function allows the user to invert the transmit and receive signals, independently. This function should only be called when the UART is between transmit and receive packets.

Parameters

  uartInstance | UART module instance number.
  rxInvert | Enable (1) or disable (0) receive inversion.
  txInvert | Enable (1) or disable (0) transmit inversion.

void uart_hal_enable_transmitter | ( | uint32_t | uartInstance | ) |

This function allows the user to enable the UART transmitter.

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_transmitter | ( | uint32_t | uartInstance | ) |

This function allows the user to disable the UART transmitter.

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_transmitter_enabled | ( | uint32_t | uartInstance | ) |

This function allows the user to get the setting of the UART transmitter.

Parameters

  uartInstance | UART module instance number.

Returns
  The state of UART transmitter enable(true)/disable(false) setting.

void uart_hal_enable_receiver | ( | uint32_t | uartInstance | ) |

This function allows the user to enable the UART receiver.

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_receiver | ( | uint32_t | uartInstance | ) |

This function allows the user to disable the UART receiver.

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_receiver_enabled | ( | uint32_t | uartInstance | ) |

This function allows the user to get the setting of the UART receiver.

Parameters

  uartInstance | UART module instance number.

Returns
  The state of UART receiver enable(true)/disable(false) setting.

void uart_hal_configure_interrupts | ( | uint32_t | uartInstance,
|  | const uart_interrupt_config_t * | interruptConfig
| ) |  |

This function allows the user to configure all of the UART interrupts with one function call. The user will first need to initialize and pass in a structure of type uart_interrupt_config_t which sets the configuration of each interrupt.

Parameters

  uartInstance | UART module instance number.
  interruptConfig | UART interrupt configuration data.

void uart_hal_enable_break_detect_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_break_detect_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_break_detect_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  The bit setting of the interrupt enable bit.

void uart_hal_enable_rx_active_edge_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_rx_active_edge_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_rx_active_edge_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_tx_data_register_empty_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_tx_data_register_empty_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_tx_data_register_empty_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_transmission_complete_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_transmission_complete_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_transmission_complete_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_rx_data_register_full_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_rx_data_register_full_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_receive_data_full_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_idle_line_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_idle_line_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_idle_line_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_rx_overrun_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_rx_overrun_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_rx_overrun_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit .

void uart_hal_enable_noise_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_noise_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_noise_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_framing_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_framing_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_framing_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_enable_parity_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

void uart_hal_disable_parity_error_interrupt | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_parity_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |

Parameters

  uartInstance | UART module instance number.

Returns
  Bit setting of the interrupt enable bit.

void uart_hal_configure_dma | ( | uint32_t | uartInstance,
|  | bool | txDmaConfig,
|  | bool | rxDmaConfig
| ) |  |

This function allows the user to configure the transmit data register empty flag to generate an interrupt request (default) or a DMA request. Similarly, this function allows the user to configure the receive data register full flag to generate an interrupt request (default) or a DMA request.

Parameters

  uartInstance | UART module instance number.
  txDmaConfig | Transmit DMA request configuration setting (enable: true /disable: false).
  rxDmaConfig | Receive DMA request configuration setting (enable: true/disable: false).

bool uart_hal_is_txdma_enabled | ( | uint32_t | uartInstance | ) |

This function returns the configuration setting of the Transmit DMA request.

Parameters

  uartInstance | UART module instance number.

Returns
  Transmit DMA request configuration setting (enable: true /disable: false).

bool uart_hal_is_rxdma_enabled | ( | uint32_t | uartInstance | ) |

This function returns the configuration setting of the Receive DMA request.

Parameters

  uartInstance | UART module instance number.

Returns
  Receive DMA request configuration setting (enable: true /disable: false).

void uart_hal_putchar | ( | uint32_t | uartInstance,
|  | uint8_t | data
| ) |  |

Parameters

  uartInstance | UART module instance number.
  data | The data to send of size 8-bit.

void uart_hal_putchar9 | ( | uint32_t | uartInstance,
|  | uint16_t | data
| ) |  |

Parameters

  uartInstance | UART module instance number.
  data | The data to send of size 9-bit.

uart_status_t uart_hal_putchar10 | ( | uint32_t | uartInstance,
|  | uint16_t | data
| ) |  |

        (Note: Feature available on select UART instances)

Parameters

  uartInstance | UART module instance number.
  data | The data to send of size 10-bit.

Returns
  An error code or kStatus_UART_Success.

void uart_hal_getchar | ( | uint32_t | uartInstance,
|  | uint8_t * | readData
| ) |  |

Parameters

  uartInstance | UART module instance number.
  readData | The received data read from data register of size 8-bit.

void uart_hal_getchar9 | ( | uint32_t | uartInstance,
|  | uint16_t * | readData
| ) |  |

Parameters

  uartInstance | UART module instance number.
  readData | The received data read from data register of size 9-bit.

uart_status_t uart_hal_getchar10 | ( | uint32_t | uartInstance,
|  | uint16_t * | readData
| ) |  |

       (Note: Feature available on select UART instances)

Parameters

  uartInstance | UART module instance number.
  readData | The received data read from data register of size 10-bit.

Returns
  An error code or kStatus_UART_Success.

void uart_hal_configure_wait_mode_operation | ( | uint32_t | uartInstance,
|  | uart_operation_config_t | mode
| ) |  |

The function configures the UART to either operate or cease to operate when WAIT mode is entered. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  mode | The UART WAIT mode operation - operates or ceases to operate in WAIT mode.

uart_operation_config_t uart_hal_get_wait_mode_operation_config | ( | uint32_t | uartInstance | ) |

This function returns kUartOperates if the UART has been configured to operate in WAIT mode. Else it returns KUartStops if the UART has been configured to cease-to-operate in WAIT mode.

Parameters

  uartInstance | UART module instance number.

Returns
  The UART WAIT mode operation configuration, returns either kUartOperates or KUartStops.

void uart_hal_configure_loopback_mode | ( | uint32_t | uartInstance,
|  | bool | enable
| ) |  |

This function enables or disables the UART loopback operation. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  enable | The UART loopback mode configuration, either disabled (false) or enabled (true).

void uart_hal_configure_singlewire_mode | ( | uint32_t | uartInstance,
|  | bool | enable
| ) |  |

This function enables or disables the UART single-wire operation. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  enable | The UART single-wire mode configuration, either disabled (false) or enabled (true).

void uart_hal_configure_txdir_in_singlewire_mode | ( | uint32_t | uartInstance,
|  | uart_singlewire_txdir_t | direction
| ) |  |

This function configures the transmitter direction when the UART is configured for single-wire operation.

Parameters

  uartInstance | UART module instance number.
  direction | The UART single-wire mode transmit direction configuration of type uart_singlewire_txdir_t (either kUartSinglewireTxdirIn or kUartSinglewireTxdirOut.

uart_status_t uart_hal_put_receiver_in_standby_mode | ( | uint32_t | uartInstance | ) |

This function, when called, places the UART receiver into standby mode. In some UART instances, there are conditions that must be met before placing rx in standby mode. Before placing UART in standby, determine if receiver is set to wake on idle, and if receiver is already in idle state. NOTE: RWU should only be set with C1[WAKE] = 0 (wakeup on idle) if the channel is currently not idle. This can be determined by the S2[RAF] flag. If set to wake up FROM an IDLE event and the channel is already idle, it is possible that the UART will discard data because data must be received (or a LIN break detect) after an IDLE is detected before IDLE is allowed to be reasserted.

Parameters

  uartInstance | UART module instance number.

Returns
  Error code or kStatus_UART_Success.

void uart_hal_put_receiver_in_normal_mode | ( | uint32_t | uartInstance | ) |

This function, when called, places the UART receiver into normal mode and out of standby mode.

Parameters

  uartInstance | UART module instance number.

bool uart_hal_is_receiver_in_standby | ( | uint32_t | uartInstance | ) |

This function determines the state of the UART receiver. If it returns true, this means that the UART receiver is in standby mode; if it returns false, the UART receiver is in normal mode.

Parameters

  uartInstance | UART module instance number.

Returns
  The UART receiver is in normal mode (false) or standby mode (true).

void uart_hal_select_receiver_wakeup_method | ( | uint32_t | uartInstance,
|  | uart_wakeup_method_t | method
| ) |  |

This function configures the wakeup method of the UART receiver from standby mode. The options are idle-line wake or address-mark wake.

Parameters

  uartInstance | UART module instance number.
  method | The UART receiver wakeup method options: kUartIdleLineWake - Idle-line wake or kUartAddrMarkWake - address-mark wake.

uart_wakeup_method_t uart_hal_get_receiver_wakeup_method | ( | uint32_t | uartInstance | ) |

This function returns how the UART receiver is configured to wake from standby mode. The wake method options that can be returned are kUartIdleLineWake or kUartAddrMarkWake.

Parameters

  uartInstance | UART module instance number.

Returns
  The UART receiver wakeup from standby method, false: kUartIdleLineWake (idle-line wake) or true: kUartAddrMarkWake (address-mark wake).

void uart_hal_configure_idle_line_detect | ( | uint32_t | uartInstance,
|  | const uart_idle_line_config_t * | config
| ) |  |

This function allows the user to configure the UART idle-line detect operation. There are two separate operations for the user to configure, the idle line bit-count start and the receive wake up affect on IDLE status bit. The user will pass in a structure of type uart_idle_line_config_t. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  config | The UART configuration pointer to the structure for idle-line detect operation of type uart_idle_line_config_t.

void uart_hal_set_break_char_transmit_length | ( | uint32_t | uartInstance,
|  | uart_break_char_length_t | length
| ) |  |

This function allows the user to configure the UART break character transmit length. Refer to the typedef uart_break_char_length_t for setting options. In some UART instances it is required that the transmitter be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  length | The UART break character length setting of type uart_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times.

void uart_hal_set_break_char_detect_length | ( | uint32_t | uartInstance,
|  | uart_break_char_length_t | length
| ) |  |

This function allows the user to configure the UART break character detect length. Refer to the typedef uart_break_char_length_t for setting options.

Parameters

  uartInstance | UART module instance number.
  length | The UART break character length setting of type uart_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times.

void uart_hal_queue_break_char_to_send | ( | uint32_t | uartInstance,
|  | bool | enable
| ) |  |

This function allows the user to queue a UART break character to send. If true is passed into the function, then a break character is queued for transmission. A break character will continuously be queued until this function is called again when a false is passed into this function.

Parameters

  uartInstance | UART module instance number.
  enable | If false, the UART normal/queue break character setting is disabled, which configures the UART for normal transmitter operation. If true, a break character is queued for transmission.

uart_status_t uart_hal_configure_match_address_operation | ( | uint32_t | uartInstance,
|  | bool | matchAddrMode1,
|  | bool | matchAddrMode2,
|  | uint8_t | matchAddrValue1,
|  | uint8_t | matchAddrValue2
| ) |  |

(Note: Feature available on select UART instances)

The function allows the user to configure the UART match address control operation. The user has the option to enable the match address mode and to program the match address value. There are two match address modes, each with its own enable and programmable match address value.

Parameters

  uartInstance | UART module instance number.
  matchAddrMode1 | If true, this enables match address mode 1 (MAEN1), where false disables.
  matchAddrMode2 | If true, this enables match address mode 2 (MAEN2), where false disables.
  matchAddrValue1 | The match address value to program for match address mode 1.
  matchAddrValue2 | The match address value to program for match address mode 2.

Returns
  An error code or kStatus_UART_Success.

uart_status_t uart_hal_configure_send_msb_first_operation | ( | uint32_t | uartInstance,
|  | bool | enable
| ) |  |

The function allows the user to configure the UART to send data MSB first or LSB first. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.

Parameters

  uartInstance | UART module instance number.
  enable | This configures send MSB first mode configuration. If true, the data is sent MSB first; if false, it is sent LSB first.

Returns
  An error code or kStatus_UART_Success.

uart_status_t uart_hal_configure_receive_resync_disable_operation | ( | uint32_t | uartInstance,
|  | bool | enable
| ) |  |

        (Note: Feature available on select UART instances)

This function allows the user to disable the UART resync of received data. The default setting is false, meaning that resynchronization during the received data word is supported. If the user passes in true, this disables resynchronization during the received data word.

Parameters

  uartInstance | UART module instance number.
  enable | If false, then resynchronization during the received data word is supported. If true, resynchronization during the received data word is disabled.

Returns
  An error code or kStatus_UART_Success.

void uart_hal_get_all_status_flag | ( | uint32_t | uartInstance,
|  | uart_status_flag_all_t * | allStatusFlag
| ) |  |

This function gets all of the UART status flag states and places into a structure of type uart_status_flag_all_t. The user must pass in a pointer to this structure.

Parameters

  uartInstance | UART module instance number.
  allStatusFlag | Pointer to the structure of all the UART status flags states.

bool uart_hal_is_transmit_data_register_empty | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Transmit data register empty flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Transmit data register empty flag, which is set when transmit buffer is empty.

bool uart_hal_is_transmission_complete | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Transmission complete flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Transmission complete flag, which is set when the transmitter is idle (transmission activity complete).

bool uart_hal_is_receive_data_register_full | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Receive data register full flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Receive data register full flag, which is set when the receive data buffer is full.

bool uart_hal_is_idle_line_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Idle-line detect flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Idle-line detect flag which is set when an idle-line detected.

bool uart_hal_is_receive_overrun_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the the UART Receiver Overrun status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Receiver Overrun, which is set when new data is received before data is read from receive register.

bool uart_hal_is_noise_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART noise status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of the noise flag, which is set if any of the 3 samples taken on receive differ.

bool uart_hal_is_frame_error_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Frame error status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Frame error flag, which is set if a logic 0 was detected where a stop bit was expected.

bool uart_hal_is_parity_error_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART parity error status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of parity error detection flag, which is set if parity mode enabled and the parity bit received does not match what was expected.

bool uart_hal_is_line_break_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART LIN break detect interrupt status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of LIN break detect interrupt flag, which is set when the LIN break char is detected assuming the LIN circuit is enabled.

bool uart_hal_is_receive_active_edge_detected | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Receive pin active edge interrupt status flag.

Parameters

  uartInstance | UART module instance number.

Returns
  The status of Receive pin active edge interrupt flag, which is set when active edge detected on the receive pin.

bool uart_hal_is_receiver_active | ( | uint32_t | uartInstance | ) |

This function returns the state of the UART Receiver Active Flag (RAF).

Parameters

  uartInstance | UART module instance number.

Returns
  The status of the Receiver Active Flag (RAF), which is set at the beginning of a received valid start bit.

uart_status_t uart_hal_clear_status_flag | ( | uint32_t | uartInstance,
|  | uart_status_flag_t | statusFlag
| ) |  |

This function allows the user to clear an individual and specific UART status flag. Refer to structure definition uart_status_flag_t for list of status bits.

Parameters

  uartInstance | UART module instance number.
  statusFlag | The desired UART status flag to clear.

Returns
  An error code or kStatus_UART_Success.

void uart_hal_clear_all_non_autoclear_status_flags | ( | uint32_t | uartInstance | ) |

This function tries to clear all of the UART status flags. In some cases, some of the status flags may not get cleared because the condition that set the flag may still exist.

Parameters

  uartInstance | UART module instance number.