TLE986x Device Family SDK
Data Structures | Functions
uart.h File Reference

Go to the source code of this file.

Detailed Description

UART low level access library.

Version
V0.2.1
Date
12. Oct 2020

Include Graph

Include dependency graph for uart.h:

Data Structures

struct  TUart
 This struct lists parameter (clock) of UART1/UART2. More...
 

Functions

INLINE void UART1_BaudRate_Value_Set (uint16 br_val)
 Writes the baudrate timer register (UART1). More...
 
INLINE void UART1_BaudRateGen_Dis (void)
 disables Baud-rate generator (UART1). More...
 
INLINE void UART1_BaudRateGen_En (void)
 enables Baud-rate generator (UART1). More...
 
INLINE void UART2_BaudRate_Value_Set (uint16 br_val)
 Writes the baudrate timer register (UART2). More...
 
INLINE void UART2_BaudRateGen_Dis (void)
 disables Baud-rate generator (UART2). More...
 
INLINE void UART2_BaudRateGen_En (void)
 enables Baud-rate generator (UART2). More...
 
INLINE void UART1_Buffer_Set (uint8 data)
 Sends a Byte via UART1. More...
 
INLINE void UART2_Buffer_Set (uint8 data)
 Sends a Byte via UART2. More...
 
INLINE uint8 UART1_Buffer_Get (void)
 Reads UART1 Buffer. More...
 
INLINE uint8 UART2_Buffer_Get (void)
 Reads UART2 Buffer. More...
 
INLINE uint8 UART1_RX_Sts (void)
 reads the receive interrupt flag of UART1. More...
 
INLINE uint8 UART1_TX_Sts (void)
 reads the transmit interrupt flag of UART1. More...
 
INLINE uint8 UART2_RX_Sts (void)
 reads the receive interrupt flag of UART2. More...
 
INLINE uint8 UART2_TX_Sts (void)
 reads the transmit interrupt flag of UART2. More...
 
INLINE void UART1_Receiver_En (void)
 enables Receiver of Serial Port (UART1). More...
 
INLINE void UART1_Receiver_Dis (void)
 disables Receiver of Serial Port (UART1). More...
 
INLINE void UART2_Receiver_En (void)
 enables Receiver of Serial Port (UART2). More...
 
INLINE void UART2_Receiver_Dis (void)
 disables Receiver of Serial Port (UART2). More...
 
INLINE void UART1_RX_Int_Clr (void)
 clears receive interrupt flag for UART1. More...
 
INLINE void UART1_TX_Int_Clr (void)
 clears transmit interrupt flag of UART1. More...
 
INLINE void UART2_RX_Int_Clr (void)
 clears receive interrupt flag of UART2. More...
 
INLINE void UART2_TX_Int_Clr (void)
 clears transmit interrupt flag of UART2. More...
 
INLINE void UART1_RX_Int_En (void)
 enables receive interrupt of UART1. More...
 
INLINE void UART1_RX_Int_Dis (void)
 disables receive interrupt of UART1. More...
 
INLINE void UART1_TX_Int_En (void)
 enables transmit interrupt of UART1. More...
 
INLINE void UART1_TX_Int_Dis (void)
 disables transmit interrupt of UART1. More...
 
INLINE void UART2_RX_Int_En (void)
 enables receive interrupt of UART2. More...
 
INLINE void UART2_RX_Int_Dis (void)
 disables receive interrupt of UART2. More...
 
INLINE void UART2_TX_Int_En (void)
 enables transmit interrupt of UART2. More...
 
INLINE void UART2_TX_Int_Dis (void)
 disables transmit interrupt of UART2. More...
 
void UART1_Init (void)
 Initializes the UART1 module. More...
 
void UART2_Init (void)
 Initializes the UART2 module. More...
 
void UART1_BaudRate_Set (uint32 baudrate)
 Sets the baudrate of UART1. More...
 
void UART2_BaudRate_Set (uint32 baudrate)
 Sets the baudrate of UART2. More...
 
INLINE void UART1_Send_Byte (uint8 c)
 clears the UART1 Transmit interrupt and sends a Byte via UART1. More...
 
INLINE uint8 UART1_Get_Byte (void)
 Clears the UART1 receive interrupt and returns the UART1 buffer. More...
 
INLINE bool UART1_isByteReceived (void)
 checks if UART1 has received Byte or not. More...
 
INLINE bool UART1_isByteTransmitted (void)
 checks if UART1 has transmitted a Byte or not. More...
 
INLINE void UART2_Send_Byte (uint8 c)
 clears the UART2 Transmit interrupt and sends a Byte via UART2. More...
 
INLINE uint8 UART2_Get_Byte (void)
 Clears the UART2 receive interrupt and returns the UART2 buffer. More...
 
INLINE bool UART2_isByteReceived (void)
 checks if UART2 has received Byte or not. More...
 
INLINE bool UART2_isByteTransmitted (void)
 checks if UART2 has transmitted a Byte or not. More...
 

Function Documentation

◆ UART1_BaudRate_Set()

void UART1_BaudRate_Set ( uint32  baudrate)

Sets the baudrate of UART1.

Parameters
baudratebaudrate, e.g. 19200, or 115200; range: 1221 to 5000000 (a value out of this range will not be applied)

Example

This example sets UART1 BAUDRATE to 19200.

void Example_Function(void)
{
}

◆ UART1_BaudRate_Value_Set()

INLINE void UART1_BaudRate_Value_Set ( uint16  br_val)

Writes the baudrate timer register (UART1).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART1 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART1_BaudRateGen_Dis()

INLINE void UART1_BaudRateGen_Dis ( void  )

disables Baud-rate generator (UART1).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART1 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART1_BaudRateGen_En()

INLINE void UART1_BaudRateGen_En ( void  )

enables Baud-rate generator (UART1).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART1 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART1_Buffer_Get()

INLINE uint8 UART1_Buffer_Get ( void  )

Reads UART1 Buffer.

Returns
Received Byte

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_Buffer_Set()

INLINE void UART1_Buffer_Set ( uint8  data)

Sends a Byte via UART1.

Parameters
dataByte to send

Example

This example sends "A" via UART1.

void Example_Function(void)
{
{
}
}

◆ UART1_Get_Byte()

INLINE uint8 UART1_Get_Byte ( void  )

Clears the UART1 receive interrupt and returns the UART1 buffer.

Returns
Received Byte

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_Init()

void UART1_Init ( void  )

Initializes the UART1 module.

◆ UART1_isByteReceived()

INLINE bool UART1_isByteReceived ( void  )

checks if UART1 has received Byte or not.

Return values
TRUEa byte was received
FALSEno byte was received

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_isByteTransmitted()

INLINE bool UART1_isByteTransmitted ( void  )

checks if UART1 has transmitted a Byte or not.

Return values
TRUEa byte was transmitted
FALSEno byte was transmitted

Example

This example sends "A" via UART1.

void Example_Function(void)
{
{
}
}

◆ UART1_Receiver_Dis()

INLINE void UART1_Receiver_Dis ( void  )

disables Receiver of Serial Port (UART1).

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_Receiver_En()

INLINE void UART1_Receiver_En ( void  )

enables Receiver of Serial Port (UART1).

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_RX_Int_Clr()

INLINE void UART1_RX_Int_Clr ( void  )

clears receive interrupt flag for UART1.

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART1_RX_Int_Dis()

INLINE void UART1_RX_Int_Dis ( void  )

disables receive interrupt of UART1.

Example

This example treats the receive interrupt for UART1.

void Example_Function(void)
{
if (UART1_RX_Sts() == (uint8)1u)
{
UART1_RX_CALLBACK();
}
}

◆ UART1_RX_Int_En()

INLINE void UART1_RX_Int_En ( void  )

enables receive interrupt of UART1.

Example

This example treats the receive interrupt for UART1.

void Example_Function(void)
{
if (UART1_RX_Sts() == (uint8)1u)
{
UART1_RX_CALLBACK();
}
}

◆ UART1_RX_Sts()

INLINE uint8 UART1_RX_Sts ( void  )

reads the receive interrupt flag of UART1.

Returns
Receive Interrupt Flag Status

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
if (UART1_RX_Sts() == (uint8)1u)
{
}
}

◆ UART1_Send_Byte()

INLINE void UART1_Send_Byte ( uint8  c)

clears the UART1 Transmit interrupt and sends a Byte via UART1.

Parameters
cByte to send

Example

This example sends "A" via UART1.

void Example_Function(void)
{
{
}
}

◆ UART1_TX_Int_Clr()

INLINE void UART1_TX_Int_Clr ( void  )

clears transmit interrupt flag of UART1.

Example

This example sends "A" via UART1.

void Example_Function(void)
{
{
}
}

◆ UART1_TX_Int_Dis()

INLINE void UART1_TX_Int_Dis ( void  )

disables transmit interrupt of UART1.

Example

This example treats the transmit interrupt for UART1.

void Example_Function(void)
{
if (UART1_TX_Sts() == (uint8)1u)
{
UART1_TX_CALLBACK();
}
}

◆ UART1_TX_Int_En()

INLINE void UART1_TX_Int_En ( void  )

enables transmit interrupt of UART1.

Example

This example treats the transmit interrupt for UART1.

void Example_Function(void)
{
if (UART1_TX_Sts() == (uint8)1u)
{
UART1_TX_CALLBACK();
}
}

◆ UART1_TX_Sts()

INLINE uint8 UART1_TX_Sts ( void  )

reads the transmit interrupt flag of UART1.

Returns
Receive Interrupt Flag Status

Example

This example receives a Byte via UART1.

void Example_Function(void)
{
uint8 ch;
if (UART1_RX_Sts() == (uint8)1u)
{
}
}

◆ UART2_BaudRate_Set()

void UART2_BaudRate_Set ( uint32  baudrate)

Sets the baudrate of UART2.

Parameters
baudratebaudrate, e.g. 19200, or 115200; range: 1221 to 5000000 (a value out of this range will not be applied)

Example

This example sets UART2 BAUDRATE to 19200.

void Example_Function(void)
{
}

◆ UART2_BaudRate_Value_Set()

INLINE void UART2_BaudRate_Value_Set ( uint16  br_val)

Writes the baudrate timer register (UART2).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART1 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART2_BaudRateGen_Dis()

INLINE void UART2_BaudRateGen_Dis ( void  )

disables Baud-rate generator (UART2).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART2 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART2_BaudRateGen_En()

INLINE void UART2_BaudRateGen_En ( void  )

enables Baud-rate generator (UART2).

Note
Setting new Baud-rate value must be when BaudRateGen is disabled.

Example

This example receives a Byte via UART2 (baud-rate is equal to 19200 when frequency is equal to 40MHz).

◆ UART2_Buffer_Get()

INLINE uint8 UART2_Buffer_Get ( void  )

Reads UART2 Buffer.

Returns
Received Byte

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_Buffer_Set()

INLINE void UART2_Buffer_Set ( uint8  data)

Sends a Byte via UART2.

Parameters
dataByte to send

Example

This example sends "A" via UART2.

void Example_Function(void)
{
{
}
}

◆ UART2_Get_Byte()

INLINE uint8 UART2_Get_Byte ( void  )

Clears the UART2 receive interrupt and returns the UART2 buffer.

Returns
Received Byte

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_Init()

void UART2_Init ( void  )

Initializes the UART2 module.

◆ UART2_isByteReceived()

INLINE bool UART2_isByteReceived ( void  )

checks if UART2 has received Byte or not.

Return values
TRUEa byte was received
FALSEno byte was receive

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_isByteTransmitted()

INLINE bool UART2_isByteTransmitted ( void  )

checks if UART2 has transmitted a Byte or not.

Return values
TRUEa byte was transmitted
FALSEno byte was transmitted

Example

This example sends "A" via UART2.

void Example_Function(void)
{
{
}
}

◆ UART2_Receiver_Dis()

INLINE void UART2_Receiver_Dis ( void  )

disables Receiver of Serial Port (UART2).

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_Receiver_En()

INLINE void UART2_Receiver_En ( void  )

enables Receiver of Serial Port (UART2).

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_RX_Int_Clr()

INLINE void UART2_RX_Int_Clr ( void  )

clears receive interrupt flag of UART2.

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
{
}
}

◆ UART2_RX_Int_Dis()

INLINE void UART2_RX_Int_Dis ( void  )

disables receive interrupt of UART2.

Example

This example treats the receive interrupt for UART2.

void Example_Function(void)
{
if (UART2_RX_Sts() == (uint8)1u)
{
UART2_RX_CALLBACK();
}
}

◆ UART2_RX_Int_En()

INLINE void UART2_RX_Int_En ( void  )

enables receive interrupt of UART2.

Example

This example treats the receive interrupt for UART2.

void Example_Function(void)
{
if (UART2_RX_Sts() == (uint8)1u)
{
UART2_RX_CALLBACK();
}
}

◆ UART2_RX_Sts()

INLINE uint8 UART2_RX_Sts ( void  )

reads the receive interrupt flag of UART2.

Returns
Receive Interrupt Flag Status

Example

This example receives a Byte via UART2.

void Example_Function(void)
{
uint8 ch;
if (UART2_RX_Sts() == (uint8)1u)
{
}
}

◆ UART2_Send_Byte()

INLINE void UART2_Send_Byte ( uint8  c)

clears the UART2 Transmit interrupt and sends a Byte via UART2.

Parameters
cByte to send

Example

This example sends "A" via UART2.

void Example_Function(void)
{
{
}
}

◆ UART2_TX_Int_Clr()

INLINE void UART2_TX_Int_Clr ( void  )

clears transmit interrupt flag of UART2.

Example

This example sends "A" via UART2.

void Example_Function(void)
{
{
}
}

◆ UART2_TX_Int_Dis()

INLINE void UART2_TX_Int_Dis ( void  )

disables transmit interrupt of UART2.

Example

This example treats the transmit interrupt for UART2.

void Example_Function(void)
{
if (UART2_TX_Sts() == (uint8)1u)
{
UART2_TX_CALLBACK();
}
}

◆ UART2_TX_Int_En()

INLINE void UART2_TX_Int_En ( void  )

enables transmit interrupt of UART2.

Example

This example treats the transmit interrupt for UART2.

void Example_Function(void)
{
if (UART2_TX_Sts() == (uint8)1u)
{
UART2_TX_CALLBACK();
}
}

◆ UART2_TX_Sts()

INLINE uint8 UART2_TX_Sts ( void  )

reads the transmit interrupt flag of UART2.

Returns
Transmit Interrupt Flag Status

Example

This example sends "A" via UART2.

void Example_Function(void)
{
if (UART2_TX_Sts() == (uint8)1u)
{
}
}
UART1_Get_Byte
INLINE uint8 UART1_Get_Byte(void)
Clears the UART1 receive interrupt and returns the UART1 buffer.
Definition: uart.h:969
UART2_Send_Byte
INLINE void UART2_Send_Byte(uint8 c)
clears the UART2 Transmit interrupt and sends a Byte via UART2.
Definition: uart.h:1058
UART2_RX_Int_Dis
INLINE void UART2_RX_Int_Dis(void)
disables receive interrupt of UART2.
Definition: uart.h:803
UART1_BaudRate_Value_Set
INLINE void UART1_BaudRate_Value_Set(uint16 br_val)
Writes the baudrate timer register (UART1).
Definition: uart.h:127
UART1_RX_Sts
INLINE uint8 UART1_RX_Sts(void)
reads the receive interrupt flag of UART1.
Definition: uart.h:399
UART2_TX_Sts
INLINE uint8 UART2_TX_Sts(void)
reads the transmit interrupt flag of UART2.
Definition: uart.h:474
UART1_BaudRateGen_Dis
INLINE void UART1_BaudRateGen_Dis(void)
disables Baud-rate generator (UART1).
Definition: uart.h:156
UART1_TX_Int_En
INLINE void UART1_TX_Int_En(void)
enables transmit interrupt of UART1.
Definition: uart.h:735
UART2_BaudRate_Set
void UART2_BaudRate_Set(uint32 baudrate)
Sets the baudrate of UART2.
UART2_TX_Int_En
INLINE void UART2_TX_Int_En(void)
enables transmit interrupt of UART2.
Definition: uart.h:825
UART2_BaudRateGen_En
INLINE void UART2_BaudRateGen_En(void)
enables Baud-rate generator (UART2).
Definition: uart.h:271
UART2_TX_Int_Dis
INLINE void UART2_TX_Int_Dis(void)
disables transmit interrupt of UART2.
Definition: uart.h:848
UART2_Receiver_En
INLINE void UART2_Receiver_En(void)
enables Receiver of Serial Port (UART2).
Definition: uart.h:547
UART1_isByteReceived
INLINE bool UART1_isByteReceived(void)
checks if UART1 has received Byte or not.
Definition: uart.h:997
UART1_RX_Int_En
INLINE void UART1_RX_Int_En(void)
enables receive interrupt of UART1.
Definition: uart.h:690
UART2_isByteTransmitted
INLINE bool UART2_isByteTransmitted(void)
checks if UART2 has transmitted a Byte or not.
Definition: uart.h:1144
UART1_RX_Int_Dis
INLINE void UART1_RX_Int_Dis(void)
disables receive interrupt of UART1.
Definition: uart.h:713
UART1_Buffer_Set
INLINE void UART1_Buffer_Set(uint8 data)
Sends a Byte via UART1.
Definition: uart.h:295
UART1_TX_Sts
INLINE uint8 UART1_TX_Sts(void)
reads the transmit interrupt flag of UART1.
Definition: uart.h:425
TRUE
#define TRUE
Boolean definitions.
Definition: types.h:92
UART2_Buffer_Get
INLINE uint8 UART2_Buffer_Get(void)
Reads UART2 Buffer.
Definition: uart.h:373
uint8
unsigned char uint8
8 bit unsigned value
Definition: types.h:139
UART2_Get_Byte
INLINE uint8 UART2_Get_Byte(void)
Clears the UART2 receive interrupt and returns the UART2 buffer.
Definition: uart.h:1085
UART1_Receiver_En
INLINE void UART1_Receiver_En(void)
enables Receiver of Serial Port (UART1).
Definition: uart.h:498
UART1_RX_Int_Clr
INLINE void UART1_RX_Int_Clr(void)
clears receive interrupt flag for UART1.
Definition: uart.h:598
UART2_RX_Sts
INLINE uint8 UART2_RX_Sts(void)
reads the receive interrupt flag of UART2.
Definition: uart.h:451
UART1_isByteTransmitted
INLINE bool UART1_isByteTransmitted(void)
checks if UART1 has transmitted a Byte or not.
Definition: uart.h:1028
UART1_TX_Int_Clr
INLINE void UART1_TX_Int_Clr(void)
clears transmit interrupt flag of UART1.
Definition: uart.h:620
UART2_Receiver_Dis
INLINE void UART2_Receiver_Dis(void)
disables Receiver of Serial Port (UART2).
Definition: uart.h:572
UART1_Buffer_Get
INLINE uint8 UART1_Buffer_Get(void)
Reads UART1 Buffer.
Definition: uart.h:346
UART2_TX_Int_Clr
INLINE void UART2_TX_Int_Clr(void)
clears transmit interrupt flag of UART2.
Definition: uart.h:667
UART1_Receiver_Dis
INLINE void UART1_Receiver_Dis(void)
disables Receiver of Serial Port (UART1).
Definition: uart.h:523
UART2_RX_Int_En
INLINE void UART2_RX_Int_En(void)
enables receive interrupt of UART2.
Definition: uart.h:780
UART2_BaudRate_Value_Set
INLINE void UART2_BaudRate_Value_Set(uint16 br_val)
Writes the baudrate timer register (UART2).
Definition: uart.h:214
UART1_TX_Int_Dis
INLINE void UART1_TX_Int_Dis(void)
disables transmit interrupt of UART1.
Definition: uart.h:758
UART1_BaudRateGen_En
INLINE void UART1_BaudRateGen_En(void)
enables Baud-rate generator (UART1).
Definition: uart.h:185
UART2_RX_Int_Clr
INLINE void UART2_RX_Int_Clr(void)
clears receive interrupt flag of UART2.
Definition: uart.h:645
UART2_isByteReceived
INLINE bool UART2_isByteReceived(void)
checks if UART2 has received Byte or not.
Definition: uart.h:1113
UART2_BaudRateGen_Dis
INLINE void UART2_BaudRateGen_Dis(void)
disables Baud-rate generator (UART2).
Definition: uart.h:243
UART2_Buffer_Set
INLINE void UART2_Buffer_Set(uint8 data)
Sends a Byte via UART2.
Definition: uart.h:319
UART1_BaudRate_Set
void UART1_BaudRate_Set(uint32 baudrate)
Sets the baudrate of UART1.
UART1_Send_Byte
INLINE void UART1_Send_Byte(uint8 c)
clears the UART1 Transmit interrupt and sends a Byte via UART1.
Definition: uart.h:942