LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
usart_002.h File Reference
#include "sys_config.h"
#include "cmsis.h"

Go to the source code of this file.

Data Structures

struct  IP_USART_002_T
 USART2 register block structure. More...
 

Macros

#define RXRDY_INT   (0x01 << 0)
 
#define TXRDY_INT   (0x01 << 2)
 
#define CTS_DELTA_INT   (0x01 << 5)
 
#define TXINT_DIS_INT   (0x01 << 6)
 
#define OVRN_ERR_INT   (0x01 << 8)
 
#define DELTA_RXBRK_INT   (0x01 << 11)
 
#define START_DETECT_INT   (0x01 << 12)
 
#define FRM_ERR_INT   (0x01 << 13)
 
#define PAR_ERR_INT   (0x01 << 14)
 
#define RXNOISE_INT   (0x01 << 15)
 
#define RXRDY   (0x01 << 0)
 
#define RXIDLE   (0x01 << 1)
 
#define TXRDY   (0x01 << 2)
 
#define TXIDLE   (0x01 << 3)
 
#define CTS   (0x01 << 4)
 
#define CTS_DELTA   (0x01 << 5)
 
#define TXINT_DIS   (0x01 << 6)
 
#define OVRN_ERR   (0x01 << 8)
 
#define RXBRK   (0x01 << 10)
 
#define DELTA_RXBRK   (0x01 << 11)
 
#define START_DETECT   (0x01 << 12)
 
#define FRM_ERR   (0x01 << 13)
 
#define PAR_ERR   (0x01 << 14)
 
#define RXNOISE   (0x01 << 15)
 
#define UART_002_SYNCEN(n)   ((n) == ENABLE ? (1 << 11) : 0)
 
#define UART_002_ENABLE   (1UL)
 

Enumerations

enum  IP_UART_002_PARITY_T { UART_PARITY_NONE = (0x00 << 4), UART_PARITY_EVEN = (0x02 << 4), UART_PARITY_ODD = (0x03 << 4) }
 UART Parity type definitions. More...
 
enum  IP_UART_002_FITO_LEVEL_T { UART_FIFO_TRGLEV0 = 0, UART_FIFO_TRGLEV1, UART_FIFO_TRGLEV2, UART_FIFO_TRGLEV3 }
 FIFO Level type definitions. More...
 
enum  IP_UART_002_STOPLEN_T { UART_STOPLEN_1 = (0 << 6), UART_STOPLEN_2 = (1 << 6) }
 UART Stop bit type definitions. More...
 
enum  IP_UART_002_DATALEN_T { UART_DATALEN_7 = (0x00 << 2), UART_DATALEN_8 = (0x01 << 2), UART_DATALEN_9 = (0x02 << 2) }
 UART Databit length type definitions. More...
 
enum  IP_UART_002_CLKPOL_T { UART_CLKPOL_FALLING = (0 << 12), UART_CLKPOL_RISING = (1 << 12) }
 UART clock polarity and sampling edge of received data type definitions. More...
 

Functions

STATIC INLINE void IP_UART_Init (IP_USART_002_T *pUART)
 Initialise the UART.
 
STATIC INLINE void IP_UART_SetBaudRate (IP_USART_002_T *pUART, uint32_t baudrate)
 Set USART Baud Rate Generator register.
 
STATIC INLINE uint32_t IP_UART_GetBaudRate (IP_USART_002_T *pUART)
 Get the USART Baud Rate Generator register.
 
STATIC INLINE void IP_UART_Transmit (IP_USART_002_T *pUART, uint8_t data)
 Write data to transmit register.
 
STATIC INLINE uint8_t IP_UART_Receive (IP_USART_002_T *pUART)
 Get received UART data.
 
STATIC INLINE uint32_t IP_UART_GetIntStatus (IP_USART_002_T *pUART)
 Get the interrupt status register.
 
STATIC INLINE uint32_t IP_UART_GetStatus (IP_USART_002_T *pUART)
 Get the UART status register.
 
STATIC INLINE void IP_UART_ClearStatus (IP_USART_002_T *pUART, uint32_t StatusFlag)
 Clear the UART status.
 
void IP_UART_Config (IP_USART_002_T *pUART, IP_UART_002_DATALEN_T Databits, IP_UART_002_PARITY_T Parity, IP_UART_002_STOPLEN_T Stopbits)
 Configure the UART protocol.
 
void IP_UART_IntEnable (IP_USART_002_T *pUART, uint32_t UARTIntCfg, FunctionalState NewState)
 Enable/Disable UART Interrupts.