Dataflow Runtime API  3.0.3.0
Enumerations | Functions
SystemPeripherals_UART.h File Reference
#include <Imt.Base.Core.Platform/Platform.h>
#include "SystemMemoryMap.h"

Enumerations

enum  UartModuleAddress {
  UartModuleAddress_UART0 = SOC_UART_0_REGS , UartModuleAddress_UART1 = SOC_UART_1_REGS , UartModuleAddress_UART2 = SOC_UART_2_REGS , UartModuleAddress_UART3 = SOC_UART_3_REGS ,
  UartModuleAddress_UART4 = SOC_UART_4_REGS , UartModuleAddress_UART5 = SOC_UART_5_REGS
}
 Universal Asynchronous Receiver/Transmitter (UART) peripheral module. More...
 
enum  UartBaudRate {
  BaudRate_300 , BaudRate_600 , BaudRate_1200 , BaudRate_2400 ,
  BaudRate_4800 , BaudRate_9600 , BaudRate_14400 , BaudRate_19200 ,
  BaudRate_28800 , BaudRate_38400 , BaudRate_57600 , BaudRate_115200 ,
  BaudRate_230400 , BaudRate_460800 , BaudRate_576000 , BaudRate_921600 ,
  BaudRate_1843200 , BaudRate_3686400
}
 Id's of the supported UART baud rates. More...
 
enum  UartDataBits { DataBits_5 , DataBits_6 , DataBits_7 , DataBits_8 }
 Id's of the supported UART data bit types. More...
 
enum  UartStopBits { StopBits_1 , StopBits_1_5 , StopBits_2 }
 Id's of the supported UART stop bit types. More...
 
enum  UartParity {
  Parity_None , Parity_Even , Parity_Odd , Parity_Mark ,
  Parity_Space
}
 Id's of the supported UART parity types. More...
 
enum  UartFlowControl { FlowControl_Off , FlowControl_RtsCts , FlowControl_XOnXOff }
 Id's of the supported UART flow control types. More...
 

Functions

void UART_Init (const UartModuleAddress uartModule, const UartBaudRate baudRate, const UartDataBits dataBits, const UartStopBits stopBits, const UartParity parity, const UartFlowControl flowControl, const uint8_t xOnCharacter=0x11, const uint8_t xOffCharacter=0x13)
 Initializes the UART module according to the specified parameters. More...
 
void UART_EnableReceivingInterrupt (const UartModuleAddress uartModule, const bool enable)
 Enable the interrupt when a byte is received. More...
 
bool UART_HasDataToRead (const UartModuleAddress uartModule)
 Check if data is ready to be read from the receiver holding register. More...
 
uint8_t UART_ReadByte (const UartModuleAddress uartModule)
 Read the content of the receiver holding register. More...
 
void UART_WriteByte (const UartModuleAddress uartModule, const uint8_t data)
 Write the data to the the transmit holding register. More...
 
bool UART_IsTxFifoFull (const UartModuleAddress uartModule)
 Check if the TX FIFO is full. More...
 
bool UART_IsClearToSend (const UartModuleAddress uartModule)
 Check if the CTS is active (receiver is ready for receive). More...
 

Enumeration Type Documentation

◆ UartBaudRate

Id's of the supported UART baud rates.

Enumerator
BaudRate_300 
BaudRate_600 
BaudRate_1200 
BaudRate_2400 
BaudRate_4800 
BaudRate_9600 
BaudRate_14400 
BaudRate_19200 
BaudRate_28800 
BaudRate_38400 
BaudRate_57600 
BaudRate_115200 
BaudRate_230400 
BaudRate_460800 
BaudRate_576000 
BaudRate_921600 
BaudRate_1843200 
BaudRate_3686400 

◆ UartDataBits

Id's of the supported UART data bit types.

Enumerator
DataBits_5 
DataBits_6 
DataBits_7 
DataBits_8 

◆ UartFlowControl

Id's of the supported UART flow control types.

Enumerator
FlowControl_Off 
FlowControl_RtsCts 
FlowControl_XOnXOff 

◆ UartModuleAddress

Universal Asynchronous Receiver/Transmitter (UART) peripheral module.

The UART interface contains 6 instantiations of the UART/IrDA (UARTIRDAOCP) peripheral. There are six UART modules called UART0 – UART5. see SystemMemoryMap.h (SOC_UART_0_REGS - SOC_UART_5_REGS) Enumeration of the available UART modules

Enumerator
UartModuleAddress_UART0 
UartModuleAddress_UART1 
UartModuleAddress_UART2 
UartModuleAddress_UART3 
UartModuleAddress_UART4 
UartModuleAddress_UART5 

◆ UartParity

enum UartParity

Id's of the supported UART parity types.

Enumerator
Parity_None 
Parity_Even 
Parity_Odd 
Parity_Mark 
Parity_Space 

◆ UartStopBits

Id's of the supported UART stop bit types.

Enumerator
StopBits_1 
StopBits_1_5 
StopBits_2 

Function Documentation

◆ UART_EnableReceivingInterrupt()

void UART_EnableReceivingInterrupt ( const UartModuleAddress  uartModule,
const bool  enable 
)

Enable the interrupt when a byte is received.

Parameters
uartModulethe desired UART module
enable

◆ UART_HasDataToRead()

bool UART_HasDataToRead ( const UartModuleAddress  uartModule)

Check if data is ready to be read from the receiver holding register.

Parameters
uartModulethe desired UART module
Returns
true when data can be read, false otherwise

◆ UART_Init()

void UART_Init ( const UartModuleAddress  uartModule,
const UartBaudRate  baudRate,
const UartDataBits  dataBits,
const UartStopBits  stopBits,
const UartParity  parity,
const UartFlowControl  flowControl,
const uint8_t  xOnCharacter = 0x11,
const uint8_t  xOffCharacter = 0x13 
)

Initializes the UART module according to the specified parameters.

Parameters
uartModuleThe UART module to configure
baudRateThe baud rate to use
dataBitsThe data bits type to use
stopBitsThe stop bits type to use
parityThe parity to use
flowControlThe flow control to use
xOnCharacterThe XON character to use for software flow control (Default is 0x11 = DC1 / XON)
xOffCharacterThe XOFF character to use for software flow control (Default is 0x13 = DC3 / XOFF)

◆ UART_IsClearToSend()

bool UART_IsClearToSend ( const UartModuleAddress  uartModule)

Check if the CTS is active (receiver is ready for receive).

Parameters
uartModulethe desired UART module
Returns
true when receiver is ready for receive, false otherwise

◆ UART_IsTxFifoFull()

bool UART_IsTxFifoFull ( const UartModuleAddress  uartModule)

Check if the TX FIFO is full.

Parameters
uartModulethe desired UART module
Returns
true when TX FIFO is full, false otherwise

◆ UART_ReadByte()

uint8_t UART_ReadByte ( const UartModuleAddress  uartModule)

Read the content of the receiver holding register.

Parameters
uartModulethe desired UART module
Returns
the data

◆ UART_WriteByte()

void UART_WriteByte ( const UartModuleAddress  uartModule,
const uint8_t  data 
)

Write the data to the the transmit holding register.

Call this method only if the TX FIFO is not full (check with UART_IsTxFifoFull).

Parameters
uartModulethe desired UART module
data