C:/nxpdrv/LPC1700CMSIS/Drivers/include/lpc17xx_uart.h File Reference
: Contains all macro definitions and function prototypes support for UART firmware library on LPC17xx More...
#include "LPC17xx.h"
#include "lpc_types.h"
Go to the source code of this file.
Data Structures | |
struct | UART_AB_CFG_Type |
Auto Baudrate mode configuration type definition. More... | |
struct | UART_CFG_Type |
UART Configuration Structure definition. More... | |
struct | UART_FIFO_CFG_Type |
UART FIFO Configuration Structure definition. More... | |
struct | UART1_RS485_CTRLCFG_Type |
UART1 Full modem - RS485 Control configuration type. More... | |
Defines | |
#define | UART_ACCEPTED_BAUDRATE_ERROR (3) |
#define | UART_RBR_MASKBIT ((uint8_t)0xFF) |
#define | UART_THR_MASKBIT ((uint8_t)0xFF) |
#define | UART_LOAD_DLL(div) ((div) & 0xFF) |
#define | UART_DLL_MASKBIT ((uint8_t)0xFF) |
#define | UART_DLM_MASKBIT ((uint8_t)0xFF) |
#define | UART_LOAD_DLM(div) (((div) >> 8) & 0xFF) |
#define | UART_IER_RBRINT_EN ((uint32_t)(1<<0)) |
#define | UART_IER_THREINT_EN ((uint32_t)(1<<1)) |
#define | UART_IER_RLSINT_EN ((uint32_t)(1<<2)) |
#define | UART1_IER_MSINT_EN ((uint32_t)(1<<3)) |
#define | UART1_IER_CTSINT_EN ((uint32_t)(1<<7)) |
#define | UART_IER_ABEOINT_EN ((uint32_t)(1<<8)) |
#define | UART_IER_ABTOINT_EN ((uint32_t)(1<<9)) |
#define | UART_IER_BITMASK ((uint32_t)(0x307)) |
#define | UART1_IER_BITMASK ((uint32_t)(0x38F)) |
#define | UART_IIR_INTSTAT_PEND ((uint32_t)(1<<0)) |
#define | UART_IIR_INTID_RLS ((uint32_t)(3<<1)) |
#define | UART_IIR_INTID_RDA ((uint32_t)(2<<1)) |
#define | UART_IIR_INTID_CTI ((uint32_t)(6<<1)) |
#define | UART_IIR_INTID_THRE ((uint32_t)(1<<1)) |
#define | UART1_IIR_INTID_MODEM ((uint32_t)(0<<1)) |
#define | UART_IIR_INTID_MASK ((uint32_t)(7<<1)) |
#define | UART_IIR_FIFO_EN ((uint32_t)(3<<6)) |
#define | UART_IIR_ABEO_INT ((uint32_t)(1<<8)) |
#define | UART_IIR_ABTO_INT ((uint32_t)(1<<9)) |
#define | UART_IIR_BITMASK ((uint32_t)(0x3CF)) |
#define | UART_FCR_FIFO_EN ((uint8_t)(1<<0)) |
#define | UART_FCR_RX_RS ((uint8_t)(1<<1)) |
#define | UART_FCR_TX_RS ((uint8_t)(1<<2)) |
#define | UART_FCR_DMAMODE_SEL ((uint8_t)(1<<3)) |
#define | UART_FCR_TRG_LEV0 ((uint8_t)(0)) |
#define | UART_FCR_TRG_LEV1 ((uint8_t)(1<<6)) |
#define | UART_FCR_TRG_LEV2 ((uint8_t)(2<<6)) |
#define | UART_FCR_TRG_LEV3 ((uint8_t)(3<<6)) |
#define | UART_FCR_BITMASK ((uint8_t)(0xCF)) |
#define | UART_TX_FIFO_SIZE (16) |
#define | UART_LCR_WLEN5 ((uint8_t)(0)) |
#define | UART_LCR_WLEN6 ((uint8_t)(1<<0)) |
#define | UART_LCR_WLEN7 ((uint8_t)(2<<0)) |
#define | UART_LCR_WLEN8 ((uint8_t)(3<<0)) |
#define | UART_LCR_STOPBIT_SEL ((uint8_t)(1<<2)) |
#define | UART_LCR_PARITY_EN ((uint8_t)(1<<3)) |
#define | UART_LCR_PARITY_ODD ((uint8_t)(0)) |
#define | UART_LCR_PARITY_EVEN ((uint8_t)(1<<4)) |
#define | UART_LCR_PARITY_F_1 ((uint8_t)(2<<4)) |
#define | UART_LCR_PARITY_F_0 ((uint8_t)(3<<4)) |
#define | UART_LCR_BREAK_EN ((uint8_t)(1<<6)) |
#define | UART_LCR_DLAB_EN ((uint8_t)(1<<7)) |
#define | UART_LCR_BITMASK ((uint8_t)(0xFF)) |
#define | UART1_MCR_DTR_CTRL ((uint8_t)(1<<0)) |
#define | UART1_MCR_RTS_CTRL ((uint8_t)(1<<1)) |
#define | UART1_MCR_LOOPB_EN ((uint8_t)(1<<4)) |
#define | UART1_MCR_AUTO_RTS_EN ((uint8_t)(1<<6)) |
#define | UART1_MCR_AUTO_CTS_EN ((uint8_t)(1<<7)) |
#define | UART1_MCR_BITMASK ((uint8_t)(0x0F3)) |
#define | UART_LSR_RDR ((uint8_t)(1<<0)) |
#define | UART_LSR_OE ((uint8_t)(1<<1)) |
#define | UART_LSR_PE ((uint8_t)(1<<2)) |
#define | UART_LSR_FE ((uint8_t)(1<<3)) |
#define | UART_LSR_BI ((uint8_t)(1<<4)) |
#define | UART_LSR_THRE ((uint8_t)(1<<5)) |
#define | UART_LSR_TEMT ((uint8_t)(1<<6)) |
#define | UART_LSR_RXFE ((uint8_t)(1<<7)) |
#define | UART_LSR_BITMASK ((uint8_t)(0xFF)) |
#define | UART1_MSR_DELTA_CTS ((uint8_t)(1<<0)) |
#define | UART1_MSR_DELTA_DSR ((uint8_t)(1<<1)) |
#define | UART1_MSR_LO2HI_RI ((uint8_t)(1<<2)) |
#define | UART1_MSR_DELTA_DCD ((uint8_t)(1<<3)) |
#define | UART1_MSR_CTS ((uint8_t)(1<<4)) |
#define | UART1_MSR_DSR ((uint8_t)(1<<5)) |
#define | UART1_MSR_RI ((uint8_t)(1<<6)) |
#define | UART1_MSR_DCD ((uint8_t)(1<<7)) |
#define | UART1_MSR_BITMASK ((uint8_t)(0xFF)) |
#define | UART_SCR_BIMASK ((uint8_t)(0xFF)) |
#define | UART_ACR_START ((uint32_t)(1<<0)) |
#define | UART_ACR_MODE ((uint32_t)(1<<1)) |
#define | UART_ACR_AUTO_RESTART ((uint32_t)(1<<2)) |
#define | UART_ACR_ABEOINT_CLR ((uint32_t)(1<<8)) |
#define | UART_ACR_ABTOINT_CLR ((uint32_t)(1<<9)) |
#define | UART_ACR_BITMASK ((uint32_t)(0x307)) |
#define | UART_ICR_IRDAEN ((uint32_t)(1<<0)) |
#define | UART_ICR_IRDAINV ((uint32_t)(1<<1)) |
#define | UART_ICR_FIXPULSE_EN ((uint32_t)(1<<2)) |
#define | UART_ICR_PULSEDIV(n) ((uint32_t)((n&0x07)<<3)) |
#define | UART_ICR_BITMASK ((uint32_t)(0x3F)) |
#define | UART_FDR_DIVADDVAL(n) ((uint32_t)(n&0x0F)) |
#define | UART_FDR_MULVAL(n) ((uint32_t)((n<<4)&0xF0)) |
#define | UART_FDR_BITMASK ((uint32_t)(0xFF)) |
#define | UART_TER_TXEN ((uint8_t)(1<<7)) |
#define | UART_TER_BITMASK ((uint8_t)(0x80)) |
#define | UART1_RS485CTRL_NMM_EN ((uint32_t)(1<<0)) |
#define | UART1_RS485CTRL_RX_DIS ((uint32_t)(1<<1)) |
#define | UART1_RS485CTRL_AADEN ((uint32_t)(1<<2)) |
#define | UART1_RS485CTRL_SEL_DTR ((uint32_t)(1<<3)) |
#define | UART1_RS485CTRL_DCTRL_EN ((uint32_t)(1<<4)) |
#define | UART1_RS485CTRL_OINV_1 ((uint32_t)(1<<5)) |
#define | UART1_RS485CTRL_BITMASK ((uint32_t)(0x3F)) |
#define | UART1_RS485ADRMATCH_BITMASK ((uint8_t)(0xFF)) |
#define | UART1_RS485DLY_BITMASK ((uint8_t)(0xFF)) |
#define | UART_FIFOLVL_RXFIFOLVL(n) ((uint32_t)(n&0x0F)) |
#define | UART_FIFOLVL_TXFIFOLVL(n) ((uint32_t)((n>>8)&0x0F)) |
#define | UART_FIFOLVL_BITMASK ((uint32_t)(0x0F0F)) |
#define | PARAM_UART_DATABIT(databit) |
#define | PARAM_UART_STOPBIT(stopbit) ((stopbit==UART_STOPBIT_1) || (stopbit==UART_STOPBIT_2)) |
#define | PARAM_UART_PARITY(parity) |
#define | PARAM_UART_FIFO_LEVEL(fifo) |
#define | PARAM_UART_INTCFG(IntCfg) |
#define | PARAM_UART1_INTCFG(IntCfg) ((IntCfg==UART1_INTCFG_MS) || (IntCfg==UART1_INTCFG_CTS)) |
#define | PARAM_UART_AUTOBAUD_MODE(ABmode) ((ABmode==UART_AUTOBAUD_MODE0) || (ABmode==UART_AUTOBAUD_MODE1)) |
#define | PARAM_UART_AUTOBAUD_INTSTAT(ABIntStat) ((ABIntStat==UART_AUTOBAUD_INTSTAT_ABEO) || (ABIntStat==UART_AUTOBAUD_INTSTAT_ABTO)) |
#define | PARAM_UART_IrDA_PULSEDIV(PulseDiv) |
#define | PARAM_UART1_SIGNALSTATE(x) ((x==INACTIVE) || (x==ACTIVE)) |
#define | PARAM_UART1_MODEM_PIN(x) ((x==UART1_MODEM_PIN_DTR) || (x==UART1_MODEM_PIN_RTS)) |
#define | PARAM_UART1_MODEM_MODE(x) |
#define | PARAM_UART_RS485_DIRCTRL_PIN(x) ((x==UART1_RS485_DIRCTRL_RTS) || (x==UART1_RS485_DIRCTRL_DTR)) |
#define | PARAM_UARTx(x) |
#define | PARAM_UART_IrDA(x) (((uint32_t *)x)==((uint32_t *)LPC_UART3)) |
#define | PARAM_UART1_MODEM(x) (((uint32_t *)x)==((uint32_t *)LPC_UART1)) |
#define | PARAM_UART1_RS485_CFG_MATCHADDRVALUE(x) ((x<0xFF)) |
#define | PARAM_UART1_RS485_CFG_DELAYVALUE(x) ((x<0xFF)) |
#define | UART_BLOCKING_TIMEOUT (0xFFFFFFFFUL) |
Typedefs | |
typedef void( | fnRxCbs_Type )(void) |
typedef void( | fnTxCbs_Type )(void) |
typedef void( | fnABCbs_Type )(uint32_t bABIntType) |
typedef void( | fnErrCbs_Type )(uint8_t bError) |
typedef void( | fnModemCbs_Type )(uint8_t ModemStatus) |
Enumerations | |
enum | UART_DATABIT_Type { UART_DATABIT_5 = 0, UART_DATABIT_6, UART_DATABIT_7, UART_DATABIT_8 } |
UART Databit type definitions. More... | |
enum | UART_STOPBIT_Type { UART_STOPBIT_1 = (0), UART_STOPBIT_2 } |
UART Stop bit type definitions. More... | |
enum | UART_PARITY_Type { UART_PARITY_NONE = 0, UART_PARITY_ODD, UART_PARITY_EVEN, UART_PARITY_SP_1, UART_PARITY_SP_0 } |
UART Parity type definitions. More... | |
enum | UART_FITO_LEVEL_Type { UART_FIFO_TRGLEV0 = 0, UART_FIFO_TRGLEV1, UART_FIFO_TRGLEV2, UART_FIFO_TRGLEV3 } |
FIFO Level type definitions. More... | |
enum | UART_INT_Type { UART_INTCFG_RBR = 0, UART_INTCFG_THRE, UART_INTCFG_RLS, UART1_INTCFG_MS, UART1_INTCFG_CTS, UART_INTCFG_ABEO, UART_INTCFG_ABTO } |
UART Interrupt Type definitions. More... | |
enum | UART_LS_Type { UART_LINESTAT_RDR = UART_LSR_RDR, UART_LINESTAT_OE = UART_LSR_OE, UART_LINESTAT_PE = UART_LSR_PE, UART_LINESTAT_FE = UART_LSR_FE, UART_LINESTAT_BI = UART_LSR_BI, UART_LINESTAT_THRE = UART_LSR_THRE, UART_LINESTAT_TEMT = UART_LSR_TEMT, UART_LINESTAT_RXFE = UART_LSR_RXFE } |
UART Line Status Type definition. More... | |
enum | UART_AB_MODE_Type { UART_AUTOBAUD_MODE0 = 0, UART_AUTOBAUD_MODE1 } |
UART Auto-baudrate mode type definition. More... | |
enum | UART_ABEO_Type { UART_AUTOBAUD_INTSTAT_ABEO = UART_IIR_ABEO_INT, UART_AUTOBAUD_INTSTAT_ABTO = UART_IIR_ABTO_INT } |
UART End of Auto-baudrate type definition. More... | |
enum | UART_IrDA_PULSE_Type { UART_IrDA_PULSEDIV2 = 0, UART_IrDA_PULSEDIV4, UART_IrDA_PULSEDIV8, UART_IrDA_PULSEDIV16, UART_IrDA_PULSEDIV32, UART_IrDA_PULSEDIV64, UART_IrDA_PULSEDIV128, UART_IrDA_PULSEDIV256 } |
enum | UART1_SignalState { INACTIVE = 0, ACTIVE = !INACTIVE } |
UART1 Full modem - Signal states definition. More... | |
enum | UART_MODEM_STAT_type { UART1_MODEM_STAT_DELTA_CTS = UART1_MSR_DELTA_CTS, UART1_MODEM_STAT_DELTA_DSR = UART1_MSR_DELTA_DSR, UART1_MODEM_STAT_LO2HI_RI = UART1_MSR_LO2HI_RI, UART1_MODEM_STAT_DELTA_DCD = UART1_MSR_DELTA_DCD, UART1_MODEM_STAT_CTS = UART1_MSR_CTS, UART1_MODEM_STAT_DSR = UART1_MSR_DSR, UART1_MODEM_STAT_RI = UART1_MSR_RI, UART1_MODEM_STAT_DCD = UART1_MSR_DCD } |
UART modem status type definition. More... | |
enum | UART_MODEM_PIN_Type { UART1_MODEM_PIN_DTR = 0, UART1_MODEM_PIN_RTS } |
Modem output pin type definition. More... | |
enum | UART_MODEM_MODE_Type { UART1_MODEM_MODE_LOOPBACK = 0, UART1_MODEM_MODE_AUTO_RTS, UART1_MODEM_MODE_AUTO_CTS } |
UART Modem mode type definition. More... | |
enum | UART_RS485_DIRCTRL_PIN_Type { UART1_RS485_DIRCTRL_RTS = 0, UART1_RS485_DIRCTRL_DTR } |
UART Direction Control Pin type definition. More... | |
Functions | |
void | UART_DeInit (LPC_UART_TypeDef *UARTx) |
De-initializes the UARTx peripheral registers to their default reset values. | |
void | UART_Init (LPC_UART_TypeDef *UARTx, UART_CFG_Type *UART_ConfigStruct) |
Initializes the UARTx peripheral according to the specified parameters in the UART_ConfigStruct. | |
void | UART_ConfigStructInit (UART_CFG_Type *UART_InitStruct) |
Fills each UART_InitStruct member with its default value: 9600 bps 8-bit data 1 Stopbit None Parity. | |
void | UART_SendData (LPC_UART_TypeDef *UARTx, uint8_t Data) |
Transmit a single data through UART peripheral. | |
uint8_t | UART_ReceiveData (LPC_UART_TypeDef *UARTx) |
Receive a single data from UART peripheral. | |
void | UART_ForceBreak (LPC_UART_TypeDef *UARTx) |
Force BREAK character on UART line, output pin UARTx TXD is forced to logic 0. | |
void | UART_IrDAInvtInputCmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState) |
Enable or disable inverting serial input function of IrDA on UART peripheral. | |
void | UART_IrDACmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState) |
Enable or disable IrDA function on UART peripheral. | |
void | UART_IrDAPulseDivConfig (LPC_UART_TypeDef *UARTx, UART_IrDA_PULSE_Type PulseDiv) |
Configure Pulse divider for IrDA function on UART peripheral. | |
void | UART_IntConfig (LPC_UART_TypeDef *UARTx, UART_INT_Type UARTIntCfg, FunctionalState NewState) |
Enable or disable specified UART interrupt. | |
uint8_t | UART_GetLineStatus (LPC_UART_TypeDef *UARTx) |
Get current value of Line Status register in UART peripheral. | |
FlagStatus | UART_CheckBusy (LPC_UART_TypeDef *UARTx) |
Check whether if UART is busy or not. | |
void | UART_FIFOConfig (LPC_UART_TypeDef *UARTx, UART_FIFO_CFG_Type *FIFOCfg) |
Configure FIFO function on selected UART peripheral. | |
void | UART_FIFOConfigStructInit (UART_FIFO_CFG_Type *UART_FIFOInitStruct) |
Fills each UART_FIFOInitStruct member with its default value:
| |
void | UART_ABCmd (LPC_UART_TypeDef *UARTx, UART_AB_CFG_Type *ABConfigStruct, FunctionalState NewState) |
Start/Stop Auto Baudrate activity. | |
void | UART_TxCmd (LPC_UART_TypeDef *UARTx, FunctionalState NewState) |
Enable/Disable transmission on UART TxD pin. | |
void | UART_FullModemForcePinState (LPC_UART1_TypeDef *UARTx, UART_MODEM_PIN_Type Pin, UART1_SignalState NewState) |
Force pin DTR/RTS corresponding to given state (Full modem mode). | |
void | UART_FullModemConfigMode (LPC_UART1_TypeDef *UARTx, UART_MODEM_MODE_Type Mode, FunctionalState NewState) |
Configure Full Modem mode for UART peripheral. | |
uint8_t | UART_FullModemGetStatus (LPC_UART1_TypeDef *UARTx) |
Get current status of modem status register. | |
void | UART_RS485Config (LPC_UART1_TypeDef *UARTx, UART1_RS485_CTRLCFG_Type *RS485ConfigStruct) |
Configure UART peripheral in RS485 mode according to the specified parameters in the RS485ConfigStruct. | |
void | UART_RS485ReceiverCmd (LPC_UART1_TypeDef *UARTx, FunctionalState NewState) |
Enable/Disable receiver in RS485 module in UART1. | |
void | UART_RS485SendSlvAddr (LPC_UART1_TypeDef *UARTx, uint8_t SlvAddr) |
Send Slave address frames on RS485 bus. | |
uint32_t | UART_RS485SendData (LPC_UART1_TypeDef *UARTx, uint8_t *pData, uint32_t size) |
Send Data frames on RS485 bus. | |
uint32_t | UART_Send (LPC_UART_TypeDef *UARTx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Send a block of data via UART peripheral. | |
uint32_t | UART_Receive (LPC_UART_TypeDef *UARTx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Receive a block of data via UART peripheral. | |
void | UART_SetupCbs (LPC_UART_TypeDef *UARTx, uint8_t CbType, void *pfnCbs) |
Setup call-back function for UART interrupt handler for each UART peripheral. | |
void | UART0_StdIntHandler (void) |
Standard UART0 interrupt handler. | |
void | UART1_StdIntHandler (void) |
Standard UART1 interrupt handler. | |
void | UART2_StdIntHandler (void) |
Standard UART2 interrupt handler. | |
void | UART3_StdIntHandler (void) |
Standard UART3 interrupt handler. |
Detailed Description
: Contains all macro definitions and function prototypes support for UART firmware library on LPC17xx
- Version:
- : 1.0
- Date:
- : 18. Mar. 2009
- Author:
- : HieuNguyen
Definition in file lpc17xx_uart.h.
Generated on Mon Feb 8 10:01:41 2010 for LPC1700CMSIS Standard Peripheral Firmware Library by 1.5.9