Herzog Library 00.00.01  rel_libdev.herzog.00.00.01.10606
Data Structures | Macros | Functions
uart_sfrs.h File Reference

Go to the source code of this file.

Data Structures

struct  UART_SFRS_t
 A structure to represent Special Function Registers for UART. More...
 

Macros

#define UART_SFRS   ((__IO UART_SFRS_t *) (0x50000010))
 
#define E_UART_STATUS_DATA_READY   ((uint8_t) (1<<0))
 
#define E_UART_STATUS_OVERRUN_ERROR   ((uint8_t) (1<<1))
 
#define E_UART_STATUS_PARITY_ERROR   ((uint8_t) (1<<2))
 
#define E_UART_STATUS_FRAME_ERROR   ((uint8_t) (1<<3))
 
#define E_UART_STATUS_BREAKINT_ERROR   ((uint8_t) (1<<4))
 
#define E_UART_STATUS_TX_FIFO_EMPTY   ((uint8_t) (1<<5))
 
#define E_UART_STATUS_TX_EMPTY   ((uint8_t) (1<<6))
 
#define E_UART_STATUS_ERROR   ((uint8_t) (1<<7))
 
#define E_UART_INT_STATUS_NONE   0x01
 
#define E_UART_INT_STATUS_TX_COMPLETE   0x02
 
#define E_UART_INT_STATUS_RX_READY   0x04
 
#define E_UART_INT_STATUS_RX_ERROR   0x06
 
#define E_UART_INT_STATUS_RX_TIMEOUT   0x0C
 
#define E_UART_DATA_SIZE_5BIT   0
 
#define E_UART_DATA_SIZE_6BIT   1
 
#define E_UART_DATA_SIZE_7BIT   2
 
#define E_UART_DATA_SIZE_8BIT   3
 
#define E_UART_STOP_BIT_1   0
 
#define E_UART_STOP_BIT_2   1
 
#define E_UART_PARITY_BIT_ODD   0
 
#define E_UART_PARITY_BIT_EVEN   1
 
#define E_UART_INT_DELAY_1   0
 
#define E_UART_INT_DELAY_3   1
 

Functions

static __INLINE void f_UART_BaudRateDiv (uint32_t div)
 Set UART baud rate divider. More...
 
static __INLINE uint8_t f_UART_LineStatus (void)
 Get UART line status. More...
 
static __INLINE void f_UART_RxFiFoReset (void)
 Reset UART receiver FIFO. More...
 
static __INLINE void f_UART_TxFiFoReset (void)
 Reset UART transmitter FIFO. More...
 
static __INLINE void f_UART_Enable (void)
 Enable UART hardware module. More...
 
static __INLINE void f_UART_Disable (void)
 Disable UART hardware module. More...
 
static __INLINE uint8_t f_UART_RxData (void)
 UART receive data. More...
 
static __INLINE void f_UART_TxData (uint8_t data)
 UART transmit data. More...
 
static __INLINE void f_UART_EnableRxIRQ (void)
 Enable UART receiver interrupt. More...
 
static __INLINE void f_UART_DisableRxIRQ (void)
 Disable UART receiver interrupt. More...
 
static __INLINE void f_UART_EnableTxIRQ (void)
 Enable UART transmitter interrupt. More...
 
static __INLINE void f_UART_DisableTxIRQ (void)
 Disable UART transmitter interrupt. More...
 
static __INLINE void f_UART_EnableRxTimeoutIRQ (void)
 Enable UART receiver time out interrupt. More...
 
static __INLINE void f_UART_DisableRxTimeoutIRQ (void)
 Disable UART receiver time out interrupt. More...
 
static __INLINE void f_UART_EnableRxErrorIRQ (void)
 Enable UART receiver error interrupt. More...
 
static __INLINE void f_UART_DisableRxErrorIRQ (void)
 Disable UART receiver error interrupt. More...
 
static __INLINE uint8_t f_UART_TxEmpty (void)
 Check if UART transmitter empty. More...
 
static __INLINE uint8_t f_UART_RxDataReady (void)
 check if UART data received More...
 
static __INLINE uint8_t f_UART_IntStatus (void)
 Get UART interrupt status. More...
 
static __INLINE void f_UART_SetDataSize (uint8_t size)
 Set UART data size in number of bits. More...
 
static __INLINE void f_UART_SetStopBit (uint8_t stop)
 Set UART stop bit size in number of bits. More...
 
static __INLINE void f_UART_SetEvenParityBit (void)
 Set UART parity bit as even. More...
 
static __INLINE void f_UART_SetOddParityBit (void)
 Set UART parity bit as odd. More...
 
static __INLINE void f_UART_EnableParity (void)
 Enable UART parity. More...
 
static __INLINE void f_UART_DisableParity (void)
 Disable UART parity. More...
 
static __INLINE void f_UART_EnableStickyParity (void)
 Enable UART sticky parity. More...
 
static __INLINE void f_UART_DisableStickyParity (void)
 Disable UART sticky parity. More...
 
static __INLINE void f_UART_EnableBreak (void)
 Enable UART break. More...
 
static __INLINE void f_UART_DisableBreak (void)
 Disable UART break. More...
 
static __INLINE void f_UART_EnableLoopBack (void)
 Enable UART loop back. More...
 
static __INLINE void f_UART_DisableLoopBack (void)
 Disable UART loop back. More...
 
static __INLINE void f_UART_SetInterruptDelay (uint8_t delay)
 Set UART interrupt delay in cycles. More...
 

Detailed Description

This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.

Macro Definition Documentation

#define E_UART_DATA_SIZE_5BIT   0

UART data size 5 bits.

#define E_UART_DATA_SIZE_6BIT   1

UART data size 6 bits.

#define E_UART_DATA_SIZE_7BIT   2

UART data size 7 bits.

#define E_UART_DATA_SIZE_8BIT   3

UART data size 8 bits.

#define E_UART_INT_DELAY_1   0

UART interrupt delay 1 cycle.

#define E_UART_INT_DELAY_3   1

UART interrupt delay 3 cycles.

#define E_UART_INT_STATUS_NONE   0x01

UART no interrupt.

#define E_UART_INT_STATUS_RX_ERROR   0x06

UART error occurred in receiver.

#define E_UART_INT_STATUS_RX_READY   0x04

UART data received.

#define E_UART_INT_STATUS_RX_TIMEOUT   0x0C

UART receiver time out.

#define E_UART_INT_STATUS_TX_COMPLETE   0x02

UART transmission complete.

#define E_UART_PARITY_BIT_EVEN   1

UART even parity bit.

#define E_UART_PARITY_BIT_ODD   0

UART odd parity bit.

#define E_UART_STATUS_BREAKINT_ERROR   ((uint8_t) (1<<4))

UART break interrupt occurred.

#define E_UART_STATUS_DATA_READY   ((uint8_t) (1<<0))

UART data ready.

#define E_UART_STATUS_ERROR   ((uint8_t) (1<<7))

UART error occurred.

#define E_UART_STATUS_FRAME_ERROR   ((uint8_t) (1<<3))

UART frame error occurred.

#define E_UART_STATUS_OVERRUN_ERROR   ((uint8_t) (1<<1))

UART over run error occurred.

#define E_UART_STATUS_PARITY_ERROR   ((uint8_t) (1<<2))

UART parity error occurred.

#define E_UART_STATUS_TX_EMPTY   ((uint8_t) (1<<6))

UART transmitter empty.

#define E_UART_STATUS_TX_FIFO_EMPTY   ((uint8_t) (1<<5))

UART transmission FIFO empty.

#define E_UART_STOP_BIT_1   0

UART 1 stop bit.

#define E_UART_STOP_BIT_2   1

UART 2 stop bit.

#define UART_SFRS   ((__IO UART_SFRS_t *) (0x50000010))

The starting address of UART SFRS.

Function Documentation

static __INLINE void f_UART_BaudRateDiv ( uint32_t  div)
static

Set UART baud rate divider.

Parameters
divThe baud rate divider.
static __INLINE void f_UART_Disable ( void  )
static

Disable UART hardware module.

static __INLINE void f_UART_DisableBreak ( void  )
static

Disable UART break.

static __INLINE void f_UART_DisableLoopBack ( void  )
static

Disable UART loop back.

static __INLINE void f_UART_DisableParity ( void  )
static

Disable UART parity.

static __INLINE void f_UART_DisableRxErrorIRQ ( void  )
static

Disable UART receiver error interrupt.

static __INLINE void f_UART_DisableRxIRQ ( void  )
static

Disable UART receiver interrupt.

static __INLINE void f_UART_DisableRxTimeoutIRQ ( void  )
static

Disable UART receiver time out interrupt.

static __INLINE void f_UART_DisableStickyParity ( void  )
static

Disable UART sticky parity.

static __INLINE void f_UART_DisableTxIRQ ( void  )
static

Disable UART transmitter interrupt.

static __INLINE void f_UART_Enable ( void  )
static

Enable UART hardware module.

static __INLINE void f_UART_EnableBreak ( void  )
static

Enable UART break.

static __INLINE void f_UART_EnableLoopBack ( void  )
static

Enable UART loop back.

static __INLINE void f_UART_EnableParity ( void  )
static

Enable UART parity.

static __INLINE void f_UART_EnableRxErrorIRQ ( void  )
static

Enable UART receiver error interrupt.

static __INLINE void f_UART_EnableRxIRQ ( void  )
static

Enable UART receiver interrupt.

static __INLINE void f_UART_EnableRxTimeoutIRQ ( void  )
static

Enable UART receiver time out interrupt.

static __INLINE void f_UART_EnableStickyParity ( void  )
static

Enable UART sticky parity.

static __INLINE void f_UART_EnableTxIRQ ( void  )
static

Enable UART transmitter interrupt.

static __INLINE uint8_t f_UART_IntStatus ( void  )
static

Get UART interrupt status.

Returns
The value of UART interrupt status register.
static __INLINE uint8_t f_UART_LineStatus ( void  )
static

Get UART line status.

Returns
The line status byte.
static __INLINE uint8_t f_UART_RxData ( void  )
static

UART receive data.

Returns
The data received.
static __INLINE uint8_t f_UART_RxDataReady ( void  )
static

check if UART data received

Returns
The status of UART data ready flag.
static __INLINE void f_UART_RxFiFoReset ( void  )
static

Reset UART receiver FIFO.

static __INLINE void f_UART_SetDataSize ( uint8_t  size)
static

Set UART data size in number of bits.

Parameters
sizeThe number of bits.
static __INLINE void f_UART_SetEvenParityBit ( void  )
static

Set UART parity bit as even.

static __INLINE void f_UART_SetInterruptDelay ( uint8_t  delay)
static

Set UART interrupt delay in cycles.

static __INLINE void f_UART_SetOddParityBit ( void  )
static

Set UART parity bit as odd.

static __INLINE void f_UART_SetStopBit ( uint8_t  stop)
static

Set UART stop bit size in number of bits.

Parameters
stopThe number of bits.
static __INLINE void f_UART_TxData ( uint8_t  data)
static

UART transmit data.

Parameters
dataThe data to be transmitted.
static __INLINE uint8_t f_UART_TxEmpty ( void  )
static

Check if UART transmitter empty.

Returns
The status of UART empty flag.
static __INLINE void f_UART_TxFiFoReset ( void  )
static

Reset UART transmitter FIFO.