![]() |
LPCOpen Platform for LPC112X microcontrollers
112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
|
Data Structures | |
struct | LPC_UART_T |
UART register block structure. More... | |
Macros | |
#define | UART_RBR_MASKBIT (0xFF) |
Macro defines for UART Receive Buffer register. More... | |
#define | UART_LOAD_DLL(div) ((div) & 0xFF) |
Macro defines for UART Divisor Latch LSB register. More... | |
#define | UART_DLL_MASKBIT (0xFF) |
#define | UART_LOAD_DLM(div) (((div) >> 8) & 0xFF) |
Macro defines for UART Divisor Latch MSB register. More... | |
#define | UART_DLM_MASKBIT (0xFF) |
#define | UART_IER_RBRINT (1 << 0) |
Macro defines for UART Interrupt Enable Register. More... | |
#define | UART_IER_THREINT (1 << 1) |
#define | UART_IER_RLSINT (1 << 2) |
#define | UART_IER_MSINT (1 << 3) |
#define | UART_IER_CTSINT (1 << 7) |
#define | UART_IER_ABEOINT (1 << 8) |
#define | UART_IER_ABTOINT (1 << 9) |
#define | UART_IER_BITMASK (0x307) |
#define | UART1_IER_BITMASK (0x30F) |
#define | UART2_IER_BITMASK (0x38F) |
#define | UART_IIR_INTSTAT_PEND (1 << 0) |
Macro defines for UART Interrupt Identification Register. More... | |
#define | UART_IIR_FIFO_EN (3 << 6) |
#define | UART_IIR_ABEO_INT (1 << 8) |
#define | UART_IIR_ABTO_INT (1 << 9) |
#define | UART_IIR_BITMASK (0x3CF) |
#define | UART_IIR_INTID_MASK (7 << 1) |
#define | UART_IIR_INTID_RLS (3 << 1) |
#define | UART_IIR_INTID_RDA (2 << 1) |
#define | UART_IIR_INTID_CTI (6 << 1) |
#define | UART_IIR_INTID_THRE (1 << 1) |
#define | UART_IIR_INTID_MODEM (0 << 1) |
#define | UART_FCR_FIFO_EN (1 << 0) |
Macro defines for UART FIFO Control Register. More... | |
#define | UART_FCR_RX_RS (1 << 1) |
#define | UART_FCR_TX_RS (1 << 2) |
#define | UART_FCR_DMAMODE_SEL (1 << 3) |
#define | UART_FCR_BITMASK (0xCF) |
#define | UART_TX_FIFO_SIZE (16) |
#define | UART_FCR_TRG_LEV0 (0) |
#define | UART_FCR_TRG_LEV1 (1 << 6) |
#define | UART_FCR_TRG_LEV2 (2 << 6) |
#define | UART_FCR_TRG_LEV3 (3 << 6) |
#define | UART_LCR_WLEN_MASK (3 << 0) |
Macro defines for UART Line Control Register. More... | |
#define | UART_LCR_WLEN5 (0 << 0) |
#define | UART_LCR_WLEN6 (1 << 0) |
#define | UART_LCR_WLEN7 (2 << 0) |
#define | UART_LCR_WLEN8 (3 << 0) |
#define | UART_LCR_SBS_MASK (1 << 2) |
#define | UART_LCR_SBS_1BIT (0 << 2) |
#define | UART_LCR_SBS_2BIT (1 << 2) |
#define | UART_LCR_PARITY_EN (1 << 3) |
#define | UART_LCR_PARITY_DIS (0 << 3) |
#define | UART_LCR_PARITY_ODD (0 << 4) |
#define | UART_LCR_PARITY_EVEN (1 << 4) |
#define | UART_LCR_PARITY_F_1 (2 << 4) |
#define | UART_LCR_PARITY_F_0 (3 << 4) |
#define | UART_LCR_BREAK_EN (1 << 6) |
#define | UART_LCR_DLAB_EN (1 << 7) |
#define | UART_LCR_BITMASK (0xFF) |
#define | UART_MCR_DTR_CTRL (1 << 0) |
Macro defines for UART Modem Control Register. More... | |
#define | UART_MCR_RTS_CTRL (1 << 1) |
#define | UART_MCR_LOOPB_EN (1 << 4) |
#define | UART_MCR_AUTO_RTS_EN (1 << 6) |
#define | UART_MCR_AUTO_CTS_EN (1 << 7) |
#define | UART_MCR_BITMASK (0xD3) |
#define | UART_LSR_RDR (1 << 0) |
Macro defines for UART Line Status Register. More... | |
#define | UART_LSR_OE (1 << 1) |
#define | UART_LSR_PE (1 << 2) |
#define | UART_LSR_FE (1 << 3) |
#define | UART_LSR_BI (1 << 4) |
#define | UART_LSR_THRE (1 << 5) |
#define | UART_LSR_TEMT (1 << 6) |
#define | UART_LSR_RXFE (1 << 7) |
#define | UART_LSR_TXFE (1 << 8) |
#define | UART_LSR_BITMASK (0xFF) |
#define | UART1_LSR_BITMASK (0x1FF) |
#define | UART_MSR_DELTA_CTS (1 << 0) |
Macro defines for UART Modem Status Register. More... | |
#define | UART_MSR_DELTA_DSR (1 << 1) |
#define | UART_MSR_LO2HI_RI (1 << 2) |
#define | UART_MSR_DELTA_DCD (1 << 3) |
#define | UART_MSR_CTS (1 << 4) |
#define | UART_MSR_DSR (1 << 5) |
#define | UART_MSR_RI (1 << 6) |
#define | UART_MSR_DCD (1 << 7) |
#define | UART_MSR_BITMASK (0xFF) |
#define | UART_ACR_START (1 << 0) |
Macro defines for UART Auto baudrate control register. More... | |
#define | UART_ACR_MODE (1 << 1) |
#define | UART_ACR_AUTO_RESTART (1 << 2) |
#define | UART_ACR_ABEOINT_CLR (1 << 8) |
#define | UART_ACR_ABTOINT_CLR (1 << 9) |
#define | UART_ACR_BITMASK (0x307) |
#define | UART_RS485CTRL_NMM_EN (1 << 0) |
Macro defines for UART RS485 Control register. More... | |
#define | UART_RS485CTRL_RX_DIS (1 << 1) |
#define | UART_RS485CTRL_AADEN (1 << 2) |
#define | UART_RS485CTRL_SEL_DTR (1 << 3) |
#define | UART_RS485CTRL_DCTRL_EN (1 << 4) |
#define | UART_RS485CTRL_OINV_1 (1 << 5) |
#define | UART_RS485CTRL_BITMASK (0x3F) |
#define | UART_ICR_IRDAEN (1 << 0) |
Macro defines for UART IrDA Control Register - valid for 11xx, 17xx/40xx UART0/2/3, 18xx/43xx UART3 only. More... | |
#define | UART_ICR_IRDAINV (1 << 1) |
#define | UART_ICR_FIXPULSE_EN (1 << 2) |
#define | UART_ICR_PULSEDIV(n) ((n & 0x07) << 3) |
#define | UART_ICR_BITMASK (0x3F) |
#define | UART_HDEN_HDEN ((1 << 0)) |
Macro defines for UART half duplex register - ???? More... | |
#define | UART_SCICTRL_SCIEN (1 << 0) |
Macro defines for UART Smart card interface Control Register - valid for 11xx, 18xx/43xx UART0/2/3 only. More... | |
#define | UART_SCICTRL_NACKDIS (1 << 1) |
#define | UART_SCICTRL_PROTSEL_T1 (1 << 2) |
#define | UART_SCICTRL_TXRETRY(n) ((n & 0x07) << 5) |
#define | UART_SCICTRL_GUARDTIME(n) ((n & 0xFF) << 8) |
#define | UART_FDR_DIVADDVAL(n) (n & 0x0F) |
Macro defines for UART Fractional Divider Register. More... | |
#define | UART_FDR_MULVAL(n) ((n << 4) & 0xF0) |
#define | UART_FDR_BITMASK (0xFF) |
#define | UART_TER1_TXEN (1 << 7) |
Macro defines for UART Tx Enable Register. More... | |
#define | UART_TER2_TXEN (1 << 0) |
#define | UART_SYNCCTRL_SYNC (1 << 0) |
Macro defines for UART Synchronous Control Register - 11xx, 18xx/43xx UART0/2/3 only. More... | |
#define | UART_SYNCCTRL_CSRC_MASTER (1 << 1) |
#define | UART_SYNCCTRL_FES (1 << 2) |
#define | UART_SYNCCTRL_TSBYPASS (1 << 3) |
#define | UART_SYNCCTRL_CSCEN (1 << 4) |
#define | UART_SYNCCTRL_STARTSTOPDISABLE (1 << 5) |
#define | UART_SYNCCTRL_CCCLR (1 << 6) |
Functions | |
STATIC INLINE void | Chip_UART_TXEnable (LPC_UART_T *pUART) |
Enable transmission on UART TxD pin. More... | |
STATIC INLINE void | Chip_UART_TXDisable (LPC_UART_T *pUART) |
Disable transmission on UART TxD pin. More... | |
STATIC INLINE void | Chip_UART_SendByte (LPC_UART_T *pUART, uint8_t data) |
Transmit a single data byte through the UART peripheral. More... | |
STATIC INLINE uint8_t | Chip_UART_ReadByte (LPC_UART_T *pUART) |
Read a single byte data from the UART peripheral. More... | |
STATIC INLINE void | Chip_UART_IntEnable (LPC_UART_T *pUART, uint32_t intMask) |
Enable UART interrupts. More... | |
STATIC INLINE void | Chip_UART_IntDisable (LPC_UART_T *pUART, uint32_t intMask) |
Disable UART interrupts. More... | |
STATIC INLINE uint32_t | Chip_UART_GetIntsEnabled (LPC_UART_T *pUART) |
Returns UART interrupts that are enabled. More... | |
STATIC INLINE uint32_t | Chip_UART_ReadIntIDReg (LPC_UART_T *pUART) |
Read the Interrupt Identification Register (IIR) More... | |
STATIC INLINE void | Chip_UART_SetupFIFOS (LPC_UART_T *pUART, uint32_t fcr) |
Setup the UART FIFOs. More... | |
STATIC INLINE void | Chip_UART_ConfigData (LPC_UART_T *pUART, uint32_t config) |
Configure data width, parity and stop bits. More... | |
STATIC INLINE void | Chip_UART_EnableDivisorAccess (LPC_UART_T *pUART) |
Enable access to Divisor Latches. More... | |
STATIC INLINE void | Chip_UART_DisableDivisorAccess (LPC_UART_T *pUART) |
Disable access to Divisor Latches. More... | |
STATIC INLINE void | Chip_UART_SetDivisorLatches (LPC_UART_T *pUART, uint8_t dll, uint8_t dlm) |
Set LSB and MSB divisor latch registers. More... | |
STATIC INLINE uint32_t | Chip_UART_ReadModemControl (LPC_UART_T *pUART) |
Return modem control register/status. More... | |
STATIC INLINE void | Chip_UART_SetModemControl (LPC_UART_T *pUART, uint32_t mcr) |
Set modem control register/status. More... | |
STATIC INLINE void | Chip_UART_ClearModemControl (LPC_UART_T *pUART, uint32_t mcr) |
Clear modem control register/status. More... | |
STATIC INLINE uint32_t | Chip_UART_ReadLineStatus (LPC_UART_T *pUART) |
Return Line Status register/status (LSR) More... | |
STATIC INLINE uint32_t | Chip_UART_ReadModemStatus (LPC_UART_T *pUART) |
Return Modem Status register/status (MSR) More... | |
STATIC INLINE void | Chip_UART_SetScratch (LPC_UART_T *pUART, uint8_t data) |
Write a byte to the scratchpad register. More... | |
STATIC INLINE uint8_t | Chip_UART_ReadScratch (LPC_UART_T *pUART) |
Returns current byte value in the scratchpad register. More... | |
STATIC INLINE void | Chip_UART_SetAutoBaudReg (LPC_UART_T *pUART, uint32_t acr) |
Set autobaud register options. More... | |
STATIC INLINE void | Chip_UART_ClearAutoBaudReg (LPC_UART_T *pUART, uint32_t acr) |
Clear autobaud register options. More... | |
STATIC INLINE void | Chip_UART_SetRS485Flags (LPC_UART_T *pUART, uint32_t ctrl) |
Set RS485 control register options. More... | |
STATIC INLINE void | Chip_UART_ClearRS485Flags (LPC_UART_T *pUART, uint32_t ctrl) |
Clear RS485 control register options. More... | |
STATIC INLINE void | Chip_UART_SetRS485Addr (LPC_UART_T *pUART, uint8_t addr) |
Set RS485 address match value. More... | |
STATIC INLINE uint8_t | Chip_UART_GetRS485Addr (LPC_UART_T *pUART) |
Read RS485 address match value. More... | |
STATIC INLINE void | Chip_UART_SetRS485Delay (LPC_UART_T *pUART, uint8_t dly) |
Set RS485 direction control (RTS or DTR) delay value. More... | |
STATIC INLINE uint8_t | Chip_UART_GetRS485Delay (LPC_UART_T *pUART) |
Read RS485 direction control (RTS or DTR) delay value. More... | |
void | Chip_UART_Init (LPC_UART_T *pUART) |
Initializes the pUART peripheral. More... | |
void | Chip_UART_DeInit (LPC_UART_T *pUART) |
De-initializes the pUART peripheral. More... | |
int | Chip_UART_Send (LPC_UART_T *pUART, const void *data, int numBytes) |
Transmit a byte array through the UART peripheral (non-blocking) More... | |
int | Chip_UART_Read (LPC_UART_T *pUART, void *data, int numBytes) |
Read data through the UART peripheral (non-blocking) More... | |
uint32_t | Chip_UART_SetBaud (LPC_UART_T *pUART, uint32_t baudrate) |
Sets best dividers to get a target bit rate (without fractional divider) More... | |
uint32_t | Chip_UART_SetBaudFDR (LPC_UART_T *pUART, uint32_t baud) |
Sets best dividers to get a target bit rate (with fractional divider) More... | |
int | Chip_UART_SendBlocking (LPC_UART_T *pUART, const void *data, int numBytes) |
Transmit a byte array through the UART peripheral (blocking) More... | |
int | Chip_UART_ReadBlocking (LPC_UART_T *pUART, void *data, int numBytes) |
Read data through the UART peripheral (blocking) More... | |
void | Chip_UART_RXIntHandlerRB (LPC_UART_T *pUART, RINGBUFF_T *pRB) |
UART receive-only interrupt handler for ring buffers. More... | |
void | Chip_UART_TXIntHandlerRB (LPC_UART_T *pUART, RINGBUFF_T *pRB) |
UART transmit-only interrupt handler for ring buffers. More... | |
uint32_t | Chip_UART_SendRB (LPC_UART_T *pUART, RINGBUFF_T *pRB, const void *data, int bytes) |
Populate a transmit ring buffer and start UART transmit. More... | |
int | Chip_UART_ReadRB (LPC_UART_T *pUART, RINGBUFF_T *pRB, void *data, int bytes) |
Copy data from a receive ring buffer. More... | |
void | Chip_UART_IRQRBHandler (LPC_UART_T *pUART, RINGBUFF_T *pRXRB, RINGBUFF_T *pTXRB) |
UART receive/transmit interrupt handler for ring buffers. More... | |
#define UART1_IER_BITMASK (0x30F) |
UART1 interrupt enable register bit mask - valid for 11xx only
Definition at line 111 of file uart_112x.h.
#define UART1_LSR_BITMASK (0x1FF) |
UART1 Line status bit mask - valid for 11xx, 18xx/43xx UART0/2/3 only
Definition at line 197 of file uart_112x.h.
#define UART2_IER_BITMASK (0x38F) |
UART2 interrupt enable register bit mask - valid for 17xx/40xx UART1, 18xx/43xx UART1 only
Definition at line 112 of file uart_112x.h.
#define UART_ACR_ABEOINT_CLR (1 << 8) |
UART End of auto-baud interrupt clear
Definition at line 218 of file uart_112x.h.
#define UART_ACR_ABTOINT_CLR (1 << 9) |
UART Auto-baud time-out interrupt clear
Definition at line 219 of file uart_112x.h.
#define UART_ACR_AUTO_RESTART (1 << 2) |
UART Auto baudrate restart
Definition at line 217 of file uart_112x.h.
#define UART_ACR_BITMASK (0x307) |
UART Auto Baudrate register bit mask
Definition at line 220 of file uart_112x.h.
#define UART_ACR_MODE (1 << 1) |
UART Auto baudrate Mode 1
Definition at line 216 of file uart_112x.h.
#define UART_ACR_START (1 << 0) |
Macro defines for UART Auto baudrate control register.
UART Auto-baud start
Definition at line 215 of file uart_112x.h.
#define UART_DLL_MASKBIT (0xFF) |
Divisor latch LSB bit mask
Definition at line 92 of file uart_112x.h.
#define UART_DLM_MASKBIT (0xFF) |
Divisor latch MSB bit mask
Definition at line 98 of file uart_112x.h.
#define UART_FCR_BITMASK (0xCF) |
UART FIFO control bit mask
Definition at line 138 of file uart_112x.h.
#define UART_FCR_DMAMODE_SEL (1 << 3) |
UART DMA mode selection - valid for 17xx/40xx, 18xx/43xx only
Definition at line 137 of file uart_112x.h.
#define UART_FCR_FIFO_EN (1 << 0) |
Macro defines for UART FIFO Control Register.
UART FIFO enable
Definition at line 134 of file uart_112x.h.
#define UART_FCR_RX_RS (1 << 1) |
UART RX FIFO reset
Definition at line 135 of file uart_112x.h.
#define UART_FCR_TRG_LEV0 (0) |
UART FIFO trigger level 0: 1 character
Definition at line 143 of file uart_112x.h.
#define UART_FCR_TRG_LEV1 (1 << 6) |
UART FIFO trigger level 1: 4 character
Definition at line 144 of file uart_112x.h.
#define UART_FCR_TRG_LEV2 (2 << 6) |
UART FIFO trigger level 2: 8 character
Definition at line 145 of file uart_112x.h.
#define UART_FCR_TRG_LEV3 (3 << 6) |
UART FIFO trigger level 3: 14 character
Definition at line 146 of file uart_112x.h.
#define UART_FCR_TX_RS (1 << 2) |
UART TX FIFO reset
Definition at line 136 of file uart_112x.h.
#define UART_FDR_BITMASK (0xFF) |
UART Fractional Divider register bit mask
Definition at line 267 of file uart_112x.h.
#define UART_FDR_DIVADDVAL | ( | n | ) | (n & 0x0F) |
Macro defines for UART Fractional Divider Register.
Baud-rate generation pre-scaler divisor
Definition at line 265 of file uart_112x.h.
#define UART_FDR_MULVAL | ( | n | ) | ((n << 4) & 0xF0) |
Baud-rate pre-scaler multiplier value
Definition at line 266 of file uart_112x.h.
#define UART_HDEN_HDEN ((1 << 0)) |
Macro defines for UART half duplex register - ????
enable half-duplex mode
Definition at line 251 of file uart_112x.h.
#define UART_ICR_BITMASK (0x3F) |
UART IRDA bit mask
Definition at line 246 of file uart_112x.h.
#define UART_ICR_FIXPULSE_EN (1 << 2) |
IrDA fixed pulse width mode
Definition at line 244 of file uart_112x.h.
#define UART_ICR_IRDAEN (1 << 0) |
Macro defines for UART IrDA Control Register - valid for 11xx, 17xx/40xx UART0/2/3, 18xx/43xx UART3 only.
IrDA mode enable
Definition at line 242 of file uart_112x.h.
#define UART_ICR_IRDAINV (1 << 1) |
IrDA serial input inverted
Definition at line 243 of file uart_112x.h.
#define UART_ICR_PULSEDIV | ( | n | ) | ((n & 0x07) << 3) |
PulseDiv - Configures the pulse when FixPulseEn = 1
Definition at line 245 of file uart_112x.h.
#define UART_IER_ABEOINT (1 << 8) |
Enables the end of auto-baud interrupt
Definition at line 108 of file uart_112x.h.
#define UART_IER_ABTOINT (1 << 9) |
Enables the auto-baud time-out interrupt
Definition at line 109 of file uart_112x.h.
#define UART_IER_BITMASK (0x307) |
UART interrupt enable register bit mask - valid for 13xx, 17xx/40xx UART0/2/3, 18xx/43xx UART0/2/3 only
Definition at line 110 of file uart_112x.h.
#define UART_IER_CTSINT (1 << 7) |
CTS signal transition interrupt enable - valid for 17xx/40xx UART1, 18xx/43xx UART1 only
Definition at line 107 of file uart_112x.h.
#define UART_IER_MSINT (1 << 3) |
Modem status interrupt enable - valid for 1125, 17xx/40xx UART1, 18xx/43xx UART1 only
Definition at line 106 of file uart_112x.h.
#define UART_IER_RBRINT (1 << 0) |
Macro defines for UART Interrupt Enable Register.
RBR Interrupt enable
Definition at line 103 of file uart_112x.h.
#define UART_IER_RLSINT (1 << 2) |
RX line status interrupt enable
Definition at line 105 of file uart_112x.h.
#define UART_IER_THREINT (1 << 1) |
THR Interrupt enable
Definition at line 104 of file uart_112x.h.
#define UART_IIR_ABEO_INT (1 << 8) |
End of auto-baud interrupt
Definition at line 119 of file uart_112x.h.
#define UART_IIR_ABTO_INT (1 << 9) |
Auto-baud time-out interrupt
Definition at line 120 of file uart_112x.h.
#define UART_IIR_BITMASK (0x3CF) |
UART interrupt identification register bit mask
Definition at line 121 of file uart_112x.h.
#define UART_IIR_FIFO_EN (3 << 6) |
These bits are equivalent to FCR[0]
Definition at line 118 of file uart_112x.h.
#define UART_IIR_INTID_CTI (6 << 1) |
Interrupt identification: Character time-out indicator interrupt
Definition at line 127 of file uart_112x.h.
#define UART_IIR_INTID_MASK (7 << 1) |
Interrupt identification: Interrupt ID mask
Definition at line 124 of file uart_112x.h.
#define UART_IIR_INTID_MODEM (0 << 1) |
Interrupt identification: Modem interrupt
Definition at line 129 of file uart_112x.h.
#define UART_IIR_INTID_RDA (2 << 1) |
Interrupt identification: Receive data available interrupt
Definition at line 126 of file uart_112x.h.
#define UART_IIR_INTID_RLS (3 << 1) |
Interrupt identification: Receive line interrupt
Definition at line 125 of file uart_112x.h.
#define UART_IIR_INTID_THRE (1 << 1) |
Interrupt identification: THRE interrupt
Definition at line 128 of file uart_112x.h.
#define UART_IIR_INTSTAT_PEND (1 << 0) |
Macro defines for UART Interrupt Identification Register.
Interrupt pending status - Active low
Definition at line 117 of file uart_112x.h.
#define UART_LCR_BITMASK (0xFF) |
UART line control bit mask
Definition at line 172 of file uart_112x.h.
#define UART_LCR_BREAK_EN (1 << 6) |
UART Break transmission enable
Definition at line 170 of file uart_112x.h.
#define UART_LCR_DLAB_EN (1 << 7) |
UART Divisor Latches Access bit enable
Definition at line 171 of file uart_112x.h.
#define UART_LCR_PARITY_DIS (0 << 3) |
UART Parity Disable
Definition at line 165 of file uart_112x.h.
#define UART_LCR_PARITY_EN (1 << 3) |
UART Parity Enable
Definition at line 164 of file uart_112x.h.
#define UART_LCR_PARITY_EVEN (1 << 4) |
UART Parity select: Even parity
Definition at line 167 of file uart_112x.h.
#define UART_LCR_PARITY_F_0 (3 << 4) |
UART Parity select: Forced 0 stick parity
Definition at line 169 of file uart_112x.h.
#define UART_LCR_PARITY_F_1 (2 << 4) |
UART Parity select: Forced 1 stick parity
Definition at line 168 of file uart_112x.h.
#define UART_LCR_PARITY_ODD (0 << 4) |
UART Parity select: Odd parity
Definition at line 166 of file uart_112x.h.
#define UART_LCR_SBS_1BIT (0 << 2) |
UART stop bit select: 1 stop bit
Definition at line 160 of file uart_112x.h.
#define UART_LCR_SBS_2BIT (1 << 2) |
UART stop bit select: 2 stop bits (in 5 bit data mode, 1.5 stop bits)
Definition at line 161 of file uart_112x.h.
#define UART_LCR_SBS_MASK (1 << 2) |
UART stop bit select: bit mask
Definition at line 159 of file uart_112x.h.
#define UART_LCR_WLEN5 (0 << 0) |
UART word length select: 5 bit data mode
Definition at line 153 of file uart_112x.h.
#define UART_LCR_WLEN6 (1 << 0) |
UART word length select: 6 bit data mode
Definition at line 154 of file uart_112x.h.
#define UART_LCR_WLEN7 (2 << 0) |
UART word length select: 7 bit data mode
Definition at line 155 of file uart_112x.h.
#define UART_LCR_WLEN8 (3 << 0) |
UART word length select: 8 bit data mode
Definition at line 156 of file uart_112x.h.
#define UART_LCR_WLEN_MASK (3 << 0) |
Macro defines for UART Line Control Register.
UART word length select bit mask
Definition at line 152 of file uart_112x.h.
#define UART_LOAD_DLL | ( | div | ) | ((div) & 0xFF) |
Macro defines for UART Divisor Latch LSB register.
Macro for loading LSB of divisor
Definition at line 91 of file uart_112x.h.
#define UART_LOAD_DLM | ( | div | ) | (((div) >> 8) & 0xFF) |
Macro defines for UART Divisor Latch MSB register.
Macro for loading MSB of divisors
Definition at line 97 of file uart_112x.h.
#define UART_LSR_BI (1 << 4) |
Line status: Break interrupt
Definition at line 191 of file uart_112x.h.
#define UART_LSR_BITMASK (0xFF) |
UART Line status bit mask
Definition at line 196 of file uart_112x.h.
#define UART_LSR_FE (1 << 3) |
Line status: Framing error
Definition at line 190 of file uart_112x.h.
#define UART_LSR_OE (1 << 1) |
Line status: Overrun error
Definition at line 188 of file uart_112x.h.
#define UART_LSR_PE (1 << 2) |
Line status: Parity error
Definition at line 189 of file uart_112x.h.
#define UART_LSR_RDR (1 << 0) |
Macro defines for UART Line Status Register.
Line status: Receive data ready
Definition at line 187 of file uart_112x.h.
#define UART_LSR_RXFE (1 << 7) |
Line status: Error in RX FIFO
Definition at line 194 of file uart_112x.h.
#define UART_LSR_TEMT (1 << 6) |
Line status: Transmitter empty
Definition at line 193 of file uart_112x.h.
#define UART_LSR_THRE (1 << 5) |
Line status: Transmit holding register empty
Definition at line 192 of file uart_112x.h.
#define UART_LSR_TXFE (1 << 8) |
Line status: Error in RX FIFO
Definition at line 195 of file uart_112x.h.
#define UART_MCR_AUTO_CTS_EN (1 << 7) |
Enable Auto CTS flow-control
Definition at line 181 of file uart_112x.h.
#define UART_MCR_AUTO_RTS_EN (1 << 6) |
Enable Auto RTS flow-control
Definition at line 180 of file uart_112x.h.
#define UART_MCR_BITMASK (0xD3) |
UART bit mask value
Definition at line 182 of file uart_112x.h.
#define UART_MCR_DTR_CTRL (1 << 0) |
Macro defines for UART Modem Control Register.
Source for modem output pin DTR
Definition at line 177 of file uart_112x.h.
#define UART_MCR_LOOPB_EN (1 << 4) |
Loop back mode select
Definition at line 179 of file uart_112x.h.
#define UART_MCR_RTS_CTRL (1 << 1) |
Source for modem output pin RTS
Definition at line 178 of file uart_112x.h.
#define UART_MSR_BITMASK (0xFF) |
Modem status: MSR register bit-mask value
Definition at line 210 of file uart_112x.h.
#define UART_MSR_CTS (1 << 4) |
Modem status: Clear To Send State
Definition at line 206 of file uart_112x.h.
#define UART_MSR_DCD (1 << 7) |
Modem status: Data Carrier Detect State
Definition at line 209 of file uart_112x.h.
#define UART_MSR_DELTA_CTS (1 << 0) |
Macro defines for UART Modem Status Register.
Modem status: State change of input CTS
Definition at line 202 of file uart_112x.h.
#define UART_MSR_DELTA_DCD (1 << 3) |
Modem status: State change of input DCD
Definition at line 205 of file uart_112x.h.
#define UART_MSR_DELTA_DSR (1 << 1) |
Modem status: State change of input DSR
Definition at line 203 of file uart_112x.h.
#define UART_MSR_DSR (1 << 5) |
Modem status: Data Set Ready State
Definition at line 207 of file uart_112x.h.
#define UART_MSR_LO2HI_RI (1 << 2) |
Modem status: Low to high transition of input RI
Definition at line 204 of file uart_112x.h.
#define UART_MSR_RI (1 << 6) |
Modem status: Ring Indicator State
Definition at line 208 of file uart_112x.h.
#define UART_RBR_MASKBIT (0xFF) |
Macro defines for UART Receive Buffer register.
UART Received Buffer mask bit (8 bits)
Definition at line 86 of file uart_112x.h.
#define UART_RS485CTRL_AADEN (1 << 2) |
Auto Address Detect (AAD) is enabled
Definition at line 227 of file uart_112x.h.
#define UART_RS485CTRL_BITMASK (0x3F) |
RS485 control bit-mask value
Definition at line 237 of file uart_112x.h.
#define UART_RS485CTRL_DCTRL_EN (1 << 4) |
Enable Auto Direction Control
Definition at line 231 of file uart_112x.h.
#define UART_RS485CTRL_NMM_EN (1 << 0) |
Macro defines for UART RS485 Control register.
RS-485/EIA-485 Normal Multi-drop Mode (NMM) is disabled
Definition at line 225 of file uart_112x.h.
#define UART_RS485CTRL_OINV_1 (1 << 5) |
This bit reverses the polarity of the direction control signal on the RTS (or DTR) pin. The direction control pin will be driven to logic "1" when the transmitter has data to be sent
Definition at line 232 of file uart_112x.h.
#define UART_RS485CTRL_RX_DIS (1 << 1) |
The receiver is disabled
Definition at line 226 of file uart_112x.h.
#define UART_RS485CTRL_SEL_DTR (1 << 3) |
If direction control is enabled (bit DCTRL = 1), pin DTR is used for direction control
Definition at line 228 of file uart_112x.h.
#define UART_SCICTRL_GUARDTIME | ( | n | ) | ((n & 0xFF) << 8) |
Extra guard time
Definition at line 260 of file uart_112x.h.
#define UART_SCICTRL_NACKDIS (1 << 1) |
NACK response is inhibited
Definition at line 257 of file uart_112x.h.
#define UART_SCICTRL_PROTSEL_T1 (1 << 2) |
ISO7816-3 protocol T1 is selected
Definition at line 258 of file uart_112x.h.
#define UART_SCICTRL_SCIEN (1 << 0) |
Macro defines for UART Smart card interface Control Register - valid for 11xx, 18xx/43xx UART0/2/3 only.
enable asynchronous half-duplex smart card interface
Definition at line 256 of file uart_112x.h.
#define UART_SCICTRL_TXRETRY | ( | n | ) | ((n & 0x07) << 5) |
number of retransmission
Definition at line 259 of file uart_112x.h.
#define UART_SYNCCTRL_CCCLR (1 << 6) |
stop continuous clock
Definition at line 284 of file uart_112x.h.
#define UART_SYNCCTRL_CSCEN (1 << 4) |
Continuous running clock enable (master mode only)
Definition at line 282 of file uart_112x.h.
#define UART_SYNCCTRL_CSRC_MASTER (1 << 1) |
synchronous master mode
Definition at line 279 of file uart_112x.h.
#define UART_SYNCCTRL_FES (1 << 2) |
sample on falling edge
Definition at line 280 of file uart_112x.h.
#define UART_SYNCCTRL_STARTSTOPDISABLE (1 << 5) |
Do not send start/stop bit
Definition at line 283 of file uart_112x.h.
#define UART_SYNCCTRL_SYNC (1 << 0) |
Macro defines for UART Synchronous Control Register - 11xx, 18xx/43xx UART0/2/3 only.
enable synchronous mode
Definition at line 278 of file uart_112x.h.
#define UART_SYNCCTRL_TSBYPASS (1 << 3) |
to be defined
Definition at line 281 of file uart_112x.h.
#define UART_TER1_TXEN (1 << 7) |
Macro defines for UART Tx Enable Register.
Transmit enable bit - valid for 11xx, 13xx, 17xx/40xx only
Definition at line 272 of file uart_112x.h.
#define UART_TER2_TXEN (1 << 0) |
Transmit enable bit - valid for 18xx/43xx only
Definition at line 273 of file uart_112x.h.
#define UART_TX_FIFO_SIZE (16) |
Definition at line 140 of file uart_112x.h.
STATIC INLINE void Chip_UART_ClearAutoBaudReg | ( | LPC_UART_T * | pUART, |
uint32_t | acr | ||
) |
Clear autobaud register options.
pUART | : Pointer to selected UART peripheral |
acr | : Or'ed values to clear for ACR register |
Definition at line 555 of file uart_112x.h.
STATIC INLINE void Chip_UART_ClearModemControl | ( | LPC_UART_T * | pUART, |
uint32_t | mcr | ||
) |
Clear modem control register/status.
pUART | : Pointer to selected UART peripheral |
mcr | : Modem control register flags to clear |
Definition at line 484 of file uart_112x.h.
STATIC INLINE void Chip_UART_ClearRS485Flags | ( | LPC_UART_T * | pUART, |
uint32_t | ctrl | ||
) |
Clear RS485 control register options.
pUART | : Pointer to selected UART peripheral |
ctrl | : Or'ed values to clear for RS485 control register |
Definition at line 581 of file uart_112x.h.
STATIC INLINE void Chip_UART_ConfigData | ( | LPC_UART_T * | pUART, |
uint32_t | config | ||
) |
Configure data width, parity and stop bits.
pUART | : Pointer to selected pUART peripheral |
config | : UART configuration, OR'ed values of UART_LCR_* defines |
Definition at line 410 of file uart_112x.h.
void Chip_UART_DeInit | ( | LPC_UART_T * | pUART | ) |
De-initializes the pUART peripheral.
pUART | : Pointer to selected pUART peripheral |
Definition at line 67 of file uart_112x.c.
STATIC INLINE void Chip_UART_DisableDivisorAccess | ( | LPC_UART_T * | pUART | ) |
Disable access to Divisor Latches.
pUART | : Pointer to selected UART peripheral |
Definition at line 430 of file uart_112x.h.
STATIC INLINE void Chip_UART_EnableDivisorAccess | ( | LPC_UART_T * | pUART | ) |
Enable access to Divisor Latches.
pUART | : Pointer to selected UART peripheral |
Definition at line 420 of file uart_112x.h.
STATIC INLINE uint32_t Chip_UART_GetIntsEnabled | ( | LPC_UART_T * | pUART | ) |
Returns UART interrupts that are enabled.
pUART | : Pointer to selected UART peripheral |
Definition at line 370 of file uart_112x.h.
STATIC INLINE uint8_t Chip_UART_GetRS485Addr | ( | LPC_UART_T * | pUART | ) |
Read RS485 address match value.
pUART | : Pointer to selected UART peripheral |
Definition at line 602 of file uart_112x.h.
STATIC INLINE uint8_t Chip_UART_GetRS485Delay | ( | LPC_UART_T * | pUART | ) |
Read RS485 direction control (RTS or DTR) delay value.
pUART | : Pointer to selected UART peripheral |
Definition at line 627 of file uart_112x.h.
void Chip_UART_Init | ( | LPC_UART_T * | pUART | ) |
Initializes the pUART peripheral.
pUART | : Pointer to selected pUART peripheral |
Definition at line 51 of file uart_112x.c.
STATIC INLINE void Chip_UART_IntDisable | ( | LPC_UART_T * | pUART, |
uint32_t | intMask | ||
) |
Disable UART interrupts.
pUART | : Pointer to selected UART peripheral |
intMask | : OR'ed Interrupts to disable in the Interrupt Enable Register (IER) |
Definition at line 357 of file uart_112x.h.
STATIC INLINE void Chip_UART_IntEnable | ( | LPC_UART_T * | pUART, |
uint32_t | intMask | ||
) |
Enable UART interrupts.
pUART | : Pointer to selected UART peripheral |
intMask | : OR'ed Interrupts to enable in the Interrupt Enable Register (IER) |
Definition at line 342 of file uart_112x.h.
void Chip_UART_IRQRBHandler | ( | LPC_UART_T * | pUART, |
RINGBUFF_T * | pRXRB, | ||
RINGBUFF_T * | pTXRB | ||
) |
UART receive/transmit interrupt handler for ring buffers.
pUART | : Pointer to selected UART peripheral |
pRXRB | : Pointer to transmit ring buffer |
pTXRB | : Pointer to receive ring buffer |
Definition at line 213 of file uart_112x.c.
int Chip_UART_Read | ( | LPC_UART_T * | pUART, |
void * | data, | ||
int | numBytes | ||
) |
Read data through the UART peripheral (non-blocking)
pUART | : Pointer to selected UART peripheral |
data | : Pointer to bytes array to fill |
numBytes | : Size of the passed data array |
Definition at line 106 of file uart_112x.c.
int Chip_UART_ReadBlocking | ( | LPC_UART_T * | pUART, |
void * | data, | ||
int | numBytes | ||
) |
Read data through the UART peripheral (blocking)
pUART | : Pointer to selected UART peripheral |
data | : Pointer to data array to fill |
numBytes | : Size of the passed data array |
Definition at line 123 of file uart_112x.c.
STATIC INLINE uint8_t Chip_UART_ReadByte | ( | LPC_UART_T * | pUART | ) |
Read a single byte data from the UART peripheral.
pUART | : Pointer to selected UART peripheral |
Definition at line 327 of file uart_112x.h.
STATIC INLINE uint32_t Chip_UART_ReadIntIDReg | ( | LPC_UART_T * | pUART | ) |
Read the Interrupt Identification Register (IIR)
pUART | : Pointer to selected UART peripheral |
Definition at line 380 of file uart_112x.h.
STATIC INLINE uint32_t Chip_UART_ReadLineStatus | ( | LPC_UART_T * | pUART | ) |
Return Line Status register/status (LSR)
pUART | : Pointer to selected UART peripheral |
Definition at line 496 of file uart_112x.h.
STATIC INLINE uint32_t Chip_UART_ReadModemControl | ( | LPC_UART_T * | pUART | ) |
Return modem control register/status.
pUART | : Pointer to selected UART peripheral |
Definition at line 458 of file uart_112x.h.
STATIC INLINE uint32_t Chip_UART_ReadModemStatus | ( | LPC_UART_T * | pUART | ) |
Return Modem Status register/status (MSR)
pUART | : Pointer to selected UART peripheral |
Definition at line 508 of file uart_112x.h.
int Chip_UART_ReadRB | ( | LPC_UART_T * | pUART, |
RINGBUFF_T * | pRB, | ||
void * | data, | ||
int | bytes | ||
) |
Copy data from a receive ring buffer.
pUART | : Pointer to selected UART peripheral |
pRB | : Pointer to ring buffer structure to use |
data | : Pointer to buffer to fill from ring buffer |
bytes | : Size of the passed buffer in bytes |
Definition at line 205 of file uart_112x.c.
STATIC INLINE uint8_t Chip_UART_ReadScratch | ( | LPC_UART_T * | pUART | ) |
Returns current byte value in the scratchpad register.
pUART | : Pointer to selected UART peripheral |
Definition at line 529 of file uart_112x.h.
void Chip_UART_RXIntHandlerRB | ( | LPC_UART_T * | pUART, |
RINGBUFF_T * | pRB | ||
) |
UART receive-only interrupt handler for ring buffers.
pUART | : Pointer to selected UART peripheral |
pRB | : Pointer to ring buffer structure to use |
Definition at line 161 of file uart_112x.c.
int Chip_UART_Send | ( | LPC_UART_T * | pUART, |
const void * | data, | ||
int | numBytes | ||
) |
Transmit a byte array through the UART peripheral (non-blocking)
pUART | : Pointer to selected UART peripheral |
data | : Pointer to bytes to transmit |
numBytes | : Number of bytes to transmit |
Definition at line 73 of file uart_112x.c.
int Chip_UART_SendBlocking | ( | LPC_UART_T * | pUART, |
const void * | data, | ||
int | numBytes | ||
) |
Transmit a byte array through the UART peripheral (blocking)
pUART | : Pointer to selected UART peripheral |
data | : Pointer to data to transmit |
numBytes | : Number of bytes to transmit |
Definition at line 90 of file uart_112x.c.
STATIC INLINE void Chip_UART_SendByte | ( | LPC_UART_T * | pUART, |
uint8_t | data | ||
) |
Transmit a single data byte through the UART peripheral.
pUART | : Pointer to selected UART peripheral |
data | : Byte to transmit |
Definition at line 314 of file uart_112x.h.
uint32_t Chip_UART_SendRB | ( | LPC_UART_T * | pUART, |
RINGBUFF_T * | pRB, | ||
const void * | data, | ||
int | bytes | ||
) |
Populate a transmit ring buffer and start UART transmit.
pUART | : Pointer to selected UART peripheral |
pRB | : Pointer to ring buffer structure to use |
data | : Pointer to buffer to move to ring buffer |
bytes | : Number of bytes to move |
Definition at line 183 of file uart_112x.c.
STATIC INLINE void Chip_UART_SetAutoBaudReg | ( | LPC_UART_T * | pUART, |
uint32_t | acr | ||
) |
Set autobaud register options.
pUART | : Pointer to selected UART peripheral |
acr | : Or'ed values to set for ACR register |
Definition at line 542 of file uart_112x.h.
uint32_t Chip_UART_SetBaud | ( | LPC_UART_T * | pUART, |
uint32_t | baudrate | ||
) |
Sets best dividers to get a target bit rate (without fractional divider)
pUART | : Pointer to selected UART peripheral |
baudrate | : Target baud rate (baud rate = bit rate) |
Definition at line 139 of file uart_112x.c.
uint32_t Chip_UART_SetBaudFDR | ( | LPC_UART_T * | pUART, |
uint32_t | baud | ||
) |
Sets best dividers to get a target bit rate (with fractional divider)
pUART | : Pointer to selected UART peripheral |
baud | : Target baud rate (baud rate = bit rate) |
Definition at line 230 of file uart_112x.c.
STATIC INLINE void Chip_UART_SetDivisorLatches | ( | LPC_UART_T * | pUART, |
uint8_t | dll, | ||
uint8_t | dlm | ||
) |
Set LSB and MSB divisor latch registers.
pUART | : Pointer to selected UART peripheral |
dll | : Divisor Latch LSB value |
dlm | : Divisor Latch MSB value |
Definition at line 445 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetModemControl | ( | LPC_UART_T * | pUART, |
uint32_t | mcr | ||
) |
Set modem control register/status.
pUART | : Pointer to selected UART peripheral |
mcr | : Modem control register flags to set |
Definition at line 471 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetRS485Addr | ( | LPC_UART_T * | pUART, |
uint8_t | addr | ||
) |
Set RS485 address match value.
pUART | : Pointer to selected UART peripheral |
addr | : Address match value for RS-485/EIA-485 mode |
Definition at line 592 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetRS485Delay | ( | LPC_UART_T * | pUART, |
uint8_t | dly | ||
) |
Set RS485 direction control (RTS or DTR) delay value.
pUART | : Pointer to selected UART peripheral |
dly | : direction control (RTS or DTR) delay value |
Definition at line 615 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetRS485Flags | ( | LPC_UART_T * | pUART, |
uint32_t | ctrl | ||
) |
Set RS485 control register options.
pUART | : Pointer to selected UART peripheral |
ctrl | : Or'ed values to set for RS485 control register |
Definition at line 568 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetScratch | ( | LPC_UART_T * | pUART, |
uint8_t | data | ||
) |
Write a byte to the scratchpad register.
pUART | : Pointer to selected UART peripheral |
data | : Byte value to write |
Definition at line 519 of file uart_112x.h.
STATIC INLINE void Chip_UART_SetupFIFOS | ( | LPC_UART_T * | pUART, |
uint32_t | fcr | ||
) |
Setup the UART FIFOs.
pUART | : Pointer to selected UART peripheral |
fcr | : FIFO control register setup OR'ed flags |
Definition at line 395 of file uart_112x.h.
STATIC INLINE void Chip_UART_TXDisable | ( | LPC_UART_T * | pUART | ) |
Disable transmission on UART TxD pin.
pUART | : Pointer to selected pUART peripheral |
Definition at line 301 of file uart_112x.h.
STATIC INLINE void Chip_UART_TXEnable | ( | LPC_UART_T * | pUART | ) |
Enable transmission on UART TxD pin.
pUART | : Pointer to selected pUART peripheral |
Definition at line 291 of file uart_112x.h.
void Chip_UART_TXIntHandlerRB | ( | LPC_UART_T * | pUART, |
RINGBUFF_T * | pRB | ||
) |
UART transmit-only interrupt handler for ring buffers.
pUART | : Pointer to selected UART peripheral |
pRB | : Pointer to ring buffer structure to use |
Definition at line 171 of file uart_112x.c.