UART Macro Definition Documentation

 

UART_PADS_NUM

#define UART_PADS_NUM 1

 

The number of input GPIO pad configurations for a UART interface (1 per instance)

 

Location: uart.h:41

 

SYS_UART_GPIOCONFIG

#define SYS_UART_GPIOCONFIG Sys_UART_GPIOConfig(UART, (cfg), (pad_tx), (pad_rx))

 

Macro wrapper for Sys_UART_GPIOConfig().

 

Configure two GPIOs for the specified UART interface.

 

Location: uart.h:91

 

Parameters

Direction Name Description

in

cfg

GPIO pin configuration for the UART pads

in

pad_tx

GPIO to use as the UART transmit pad

in

pad_rx

GPIO to use as the UART receive pad

 

 

Example Code for SYS_UART_GPIOCONFIG

    // Configure GPIOs 5 and 6 for the default UART interface with

    // low-pass filter disabled, 8X drive-strength, and 1 kOhm pull-up resistors

    SYS_UART_GPIOCONFIG((GPIO_LPF_DISABLE | GPIO_1K_PULL_UP  |

                       GPIO_6X_DRIVE), GPIO5GPIO6);

 

SYS_UART_CONFIG

#define SYS_UART_CONFIG Sys_UART_Config(UART, (uart_clk_hz), (baud), (config))

 

Macro wrapper for Sys_UART_Config().

 

Configure and enable a UART interface.

 

Location: uart.h:107

 

Parameters

Direction Name Description

in

uart_clk_hz

UART clock speed in hertz

in

baud

Baud rate to which UART* is configured

in

config

DMA and interrupt mode enable; use UART_TX_DMA_[ENABLE | DISABLE] UART_RX_DMA_[ENABLE | DISABLE] UART_TX_INT_[ENABLE | DISABLE] UART_RX_INT_[ENABLE | DISABLE] UART_OVERRUN_INT_[ENABLE | DISABLE]

 

 

Example Code for SYS_UART_CONFIG

    // Enable and Configure the default UART:

    //  - 8 MHz clock speed

    //  - 9600 Hz baud rate

    //  - A TX DMA request is generated when new data is

    //    requested by the UART interface

    //  - An RX DMA request is generated when new data is

    //    received by the UART interface

    //  - Interrupts enabled

    SYS_UART_CONFIG(8000000, 9600, (UART_TX_DMA_ENABLE |

                    UART_RX_DMA_ENABLE | UART_TX_START_INT_ENABLE |

                    UART_RX_INT_ENABLE | UART_OVERRUN_INT_ENABLE));