![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Modules | |
| CHIP: LPC11xx UART Driver blocking transfer functions | |
| CHIP: LPC11xx UART Driver interrupt transfer functions | |
Functions | |
| void | Chip_UART_Init (LPC_USART_T *pUART) |
| Initializes the pUART peripheral. | |
| void | Chip_UART_DeInit (LPC_USART_T *pUART) |
| De-initializes the pUART peripheral. | |
| STATIC INLINE void | Chip_UART_TXEnable (LPC_USART_T *pUART) |
| Enable transmission on UART TxD pin. | |
| STATIC INLINE void | Chip_UART_TXDisable (LPC_USART_T *pUART) |
| Disable transmission on UART TxD pin. | |
| STATIC INLINE void | Chip_UART_SendByte (LPC_USART_T *pUART, uint8_t data) |
| Transmit a single byte through the UART peripheral. | |
| STATIC INLINE uint8_t | Chip_UART_ReadByte (LPC_USART_T *pUART) |
| Get a single data from UART peripheral. | |
| int | Chip_UART_Send (LPC_USART_T *pUART, const void *data, int numBytes) |
| Transmit a byte array through the UART peripheral (non-blocking) | |
| int | Chip_UART_Read (LPC_USART_T *pUART, void *data, int numBytes) |
| Read data through the UART peripheral (non-blocking) | |
| STATIC INLINE void | Chip_UART_IntEnable (LPC_USART_T *pUART, uint32_t intMask) |
| Enable UART interrupts. | |
| STATIC INLINE void | Chip_UART_IntDisable (LPC_USART_T *pUART, uint32_t intMask) |
| Disable UART interrupts. | |
| STATIC INLINE uint32_t | Chip_UART_ReadIntIDReg (LPC_USART_T *pUART) |
| Read the Interrupt Identification Register (IIR) | |
| STATIC INLINE void | Chip_UART_SetupFIFOS (LPC_USART_T *pUART, uint32_t fcr) |
| Setup the UART FIFOs. | |
| STATIC INLINE void | Chip_UART_ConfigData (LPC_USART_T *pUART, uint32_t config) |
| Configure data width, parity mode and stop bits. | |
| STATIC INLINE void | Chip_UART_EnableDivisorAccess (LPC_USART_T *pUART) |
| Enable access to Divisor Latches. | |
| STATIC INLINE void | Chip_UART_DisableDivisorAccess (LPC_USART_T *pUART) |
| Disable access to Divisor Latches. | |
| STATIC INLINE void | Chip_UART_SetDivisorLatches (LPC_USART_T *pUART, uint8_t dll, uint8_t dlm) |
| Set LSB and MSB divisor latch registers. | |
| STATIC INLINE uint32_t | Chip_UART_ReadModemControl (LPC_USART_T *pUART) |
| Return modem control register/status. | |
| STATIC INLINE void | Chip_UART_SetModemControl (LPC_USART_T *pUART, uint32_t mcr) |
| Set modem control register/status. | |
| STATIC INLINE void | Chip_UART_ClearModemControl (LPC_USART_T *pUART, uint32_t mcr) |
| Clear modem control register/status. | |
| STATIC INLINE uint32_t | Chip_UART_ReadLineStatus (LPC_USART_T *pUART) |
| Return Line Status register/status (LSR) | |
| STATIC INLINE uint32_t | Chip_UART_ReadModemStatus (LPC_USART_T *pUART) |
| Return Modem Status register/status (MSR) | |
| STATIC INLINE void | Chip_UART_SetScratch (LPC_USART_T *pUART, uint8_t data) |
| Write a byte to the scratchpad register. | |
| STATIC INLINE uint8_t | Chip_UART_ReadScratch (LPC_USART_T *pUART) |
| Returns current byte value in the scratchpad register. | |
| STATIC INLINE void | Chip_UART_SetAutoBaudReg (LPC_USART_T *pUART, uint32_t acr) |
| Set autobaud register options. | |
| STATIC INLINE void | Chip_UART_ClearAutoBaudReg (LPC_USART_T *pUART, uint32_t acr) |
| Clear autobaud register options. | |
| STATIC INLINE void | Chip_UART_SetRS485Flags (LPC_USART_T *pUART, uint32_t ctrl) |
| Set RS485 control register options. | |
| STATIC INLINE void | Chip_UART_ClearRS485Flags (LPC_USART_T *pUART, uint32_t ctrl) |
| Clear RS485 control register options. | |
| STATIC INLINE void | Chip_UART_SetRS485Addr (LPC_USART_T *pUART, uint8_t addr) |
| Set RS485 address match value. | |
| STATIC INLINE uint8_t | Chip_UART_GetRS485Addr (LPC_USART_T *pUART) |
| Read RS485 address match value. | |
| STATIC INLINE void | Chip_UART_SetRS485Delay (LPC_USART_T *pUART, uint8_t dly) |
| Set RS485 direction control (RTS or DTR) delay value. | |
| STATIC INLINE uint8_t | Chip_UART_GetRS485Delay (LPC_USART_T *pUART) |
| Read RS485 direction control (RTS or DTR) delay value. | |
| uint32_t | Chip_UART_SetBaud (LPC_USART_T *pUART, uint32_t baudrate) |
| Sets best dividers to get a target bit rate (without fractional divider) | |
| STATIC INLINE uint32_t | Chip_UART_SetBaudFDR (LPC_USART_T *pUART, uint32_t baudrate) |
| Sets best dividers to get a target bit rate (with fractional divider) | |
| STATIC INLINE void Chip_UART_ClearAutoBaudReg | ( | LPC_USART_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 339 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_ClearModemControl | ( | LPC_USART_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 268 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_ClearRS485Flags | ( | LPC_USART_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 365 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_ConfigData | ( | LPC_USART_T * | pUART, |
| uint32_t | config | ||
| ) |
Configure data width, parity mode and stop bits.
| pUART | : Pointer to selected pUART peripheral |
| config | : UART configuration, Or'ed values of UART_LCR_* defines |
Definition at line 194 of file uart_11xx.h.
| void Chip_UART_DeInit | ( | LPC_USART_T * | pUART | ) |
De-initializes the pUART peripheral.
| pUART | : Pointer to selected pUART peripheral |
Definition at line 64 of file uart_11xx.c.
| STATIC INLINE void Chip_UART_DisableDivisorAccess | ( | LPC_USART_T * | pUART | ) |
Disable access to Divisor Latches.
| pUART | : Pointer to selected UART peripheral |
Definition at line 215 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_EnableDivisorAccess | ( | LPC_USART_T * | pUART | ) |
Enable access to Divisor Latches.
| pUART | : Pointer to selected UART peripheral |
Definition at line 205 of file uart_11xx.h.
| STATIC INLINE uint8_t Chip_UART_GetRS485Addr | ( | LPC_USART_T * | pUART | ) |
Read RS485 address match value.
| pUART | : Pointer to selected UART peripheral |
Definition at line 386 of file uart_11xx.h.
| STATIC INLINE uint8_t Chip_UART_GetRS485Delay | ( | LPC_USART_T * | pUART | ) |
Read RS485 direction control (RTS or DTR) delay value.
| pUART | : Pointer to selected UART peripheral |
Definition at line 411 of file uart_11xx.h.
| void Chip_UART_Init | ( | LPC_USART_T * | pUART | ) |
Initializes the pUART peripheral.
| pUART | : Pointer to selected pUART peripheral |
Definition at line 54 of file uart_11xx.c.
| STATIC INLINE void Chip_UART_IntDisable | ( | LPC_USART_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 154 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_IntEnable | ( | LPC_USART_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 139 of file uart_11xx.h.
| int Chip_UART_Read | ( | LPC_USART_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_11xx.c.
| STATIC INLINE uint8_t Chip_UART_ReadByte | ( | LPC_USART_T * | pUART | ) |
Get a single data from UART peripheral.
| pUART | : Pointer to selected UART peripheral |
Definition at line 99 of file uart_11xx.h.
| STATIC INLINE uint32_t Chip_UART_ReadIntIDReg | ( | LPC_USART_T * | pUART | ) |
Read the Interrupt Identification Register (IIR)
| pUART | : Pointer to selected UART peripheral |
Definition at line 164 of file uart_11xx.h.
| STATIC INLINE uint32_t Chip_UART_ReadLineStatus | ( | LPC_USART_T * | pUART | ) |
Return Line Status register/status (LSR)
| pUART | : Pointer to selected UART peripheral |
Definition at line 280 of file uart_11xx.h.
| STATIC INLINE uint32_t Chip_UART_ReadModemControl | ( | LPC_USART_T * | pUART | ) |
Return modem control register/status.
| pUART | : Pointer to selected UART peripheral |
Definition at line 242 of file uart_11xx.h.
| STATIC INLINE uint32_t Chip_UART_ReadModemStatus | ( | LPC_USART_T * | pUART | ) |
Return Modem Status register/status (MSR)
| pUART | : Pointer to selected UART peripheral |
Definition at line 292 of file uart_11xx.h.
| STATIC INLINE uint8_t Chip_UART_ReadScratch | ( | LPC_USART_T * | pUART | ) |
Returns current byte value in the scratchpad register.
| pUART | : Pointer to selected UART peripheral |
Definition at line 313 of file uart_11xx.h.
| int Chip_UART_Send | ( | LPC_USART_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_11xx.c.
| STATIC INLINE void Chip_UART_SendByte | ( | LPC_USART_T * | pUART, |
| uint8_t | data | ||
| ) |
Transmit a single byte through the UART peripheral.
Transmit a 8 bits data.
| pUART | : Pointer to selected UART peripheral |
| data | : Byte to transmit |
Definition at line 86 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetAutoBaudReg | ( | LPC_USART_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 326 of file uart_11xx.h.
| uint32_t Chip_UART_SetBaud | ( | LPC_USART_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_11xx.c.
| STATIC INLINE uint32_t Chip_UART_SetBaudFDR | ( | LPC_USART_T * | pUART, |
| uint32_t | baudrate | ||
| ) |
Sets best dividers to get a target bit rate (with fractional divider)
| pUART | : Pointer to selected UART peripheral |
| baudrate | : Target baud rate (baud rate = bit rate) |
Definition at line 430 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetDivisorLatches | ( | LPC_USART_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 230 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetModemControl | ( | LPC_USART_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 255 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetRS485Addr | ( | LPC_USART_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 376 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetRS485Delay | ( | LPC_USART_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 399 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetRS485Flags | ( | LPC_USART_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 352 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetScratch | ( | LPC_USART_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 303 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_SetupFIFOS | ( | LPC_USART_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 179 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_TXDisable | ( | LPC_USART_T * | pUART | ) |
Disable transmission on UART TxD pin.
| pUART | : Pointer to selected pUART peripheral |
Definition at line 73 of file uart_11xx.h.
| STATIC INLINE void Chip_UART_TXEnable | ( | LPC_USART_T * | pUART | ) |
Enable transmission on UART TxD pin.
| pUART | : Pointer to selected pUART peripheral |
Definition at line 63 of file uart_11xx.h.