![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Functions | |
STATIC INLINE void | Chip_UART_ConfigData (LPC_USART_Type *UARTx, UART_DATABIT_Type Databits, UART_PARITY_Type Parity, UART_STOPBIT_Type Stopbits) |
Configure data width, parity mode and stop bits. | |
STATIC INLINE uint32_t | Chip_UART_Send (LPC_USART_Type *UARTx, uint8_t *txbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Send a block of data via UART peripheral. | |
STATIC INLINE uint32_t | Chip_UART_Receive (LPC_USART_Type *UARTx, uint8_t *rxbuf, uint32_t buflen, TRANSFER_BLOCK_Type flag) |
Receive a block of data via UART peripheral. | |
STATIC INLINE void | Chip_UART_FIFOConfig (LPC_USART_Type *UARTx, UART_FIFO_CFG_Type *FIFOCfg) |
Configure FIFO function on selected UART peripheral. | |
STATIC INLINE void | Chip_UART_FIFOConfigStructInit (UART_FIFO_CFG_Type *UART_FIFOInitStruct) |
Fills each UART_FIFOInitStruct member with its default value: | |
STATIC INLINE void | Chip_UART_IntConfig (LPC_USART_Type *UARTx, UART_INT_Type UARTIntCfg, FunctionalState NewState) |
Enable or disable specified UART interrupt. | |
STATIC INLINE uint32_t | Chip_UART_IntGetStatus (LPC_USART_Type *UARTx) |
Get Source Interrupt. | |
STATIC INLINE uint8_t | Chip_UART_GetLineStatus (LPC_USART_Type *UARTx) |
Get current value of Line Status register in UART peripheral. | |
STATIC INLINE FlagStatus | Chip_UART_CheckBusy (LPC_USART_Type *UARTx) |
Check whether if UART is busy or not. | |
STATIC INLINE void | Chip_UART_ForceBreak (LPC_USART_Type *UARTx) |
Force BREAK character on UART line, output pin UARTx TXD is forced to logic 0. | |
STATIC INLINE Status | Chip_UART_SendByte (LPC_USART_Type *UARTx, uint8_t Data) |
Transmit a single data through UART peripheral. | |
STATIC INLINE Status | Chip_UART_ReceiveByte (LPC_USART_Type *UARTx, uint8_t *Data) |
Receive a single data from UART peripheral. | |
void | Chip_UART_Init (LPC_USART_Type *UARTx) |
Initializes the UARTx peripheral. | |
void | Chip_UART_DeInit (LPC_USART_Type *UARTx) |
De-initializes the UARTx peripheral. | |
Status | Chip_UART_SetBaud (LPC_USART_Type *UARTx, uint32_t baudrate) |
Determines best dividers to get a target baud rate. | |
void | Chip_UART_TxCmd (LPC_USART_Type *UARTx, FunctionalState NewState) |
Enable/Disable transmission on UART TxD pin. | |
UART_Int_Status | Chip_UART_GetIntStatus (LPC_USART_Type *UARTx) |
Get Interrupt Stream Status. | |
void | Chip_UART_Interrupt_Handler (LPC_USART_Type *UARTx) |
Uart interrupt service routine (chip layer) | |
uint32_t | Chip_UART_Interrupt_Transmit (LPC_USART_Type *UARTx, uint8_t *txbuf, uint8_t buflen) |
UART transmit function for interrupt mode (using ring buffers) | |
uint32_t | Chip_UART_Interrupt_Receive (LPC_USART_Type *UARTx, uint8_t *rxbuf, uint8_t buflen) |
UART read function for interrupt mode (using ring buffers) | |
void | Chip_UART_InitRingBuffer (void) |
Reset Tx and Rx ring buffer (head and tail) | |
STATIC INLINE FlagStatus Chip_UART_CheckBusy | ( | LPC_USART_Type * | UARTx | ) |
Check whether if UART is busy or not.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 174 of file uart_18xx_43xx.h.
STATIC INLINE void Chip_UART_ConfigData | ( | LPC_USART_Type * | UARTx, |
UART_DATABIT_Type | Databits, | ||
UART_PARITY_Type | Parity, | ||
UART_STOPBIT_Type | Stopbits | ||
) |
Configure data width, parity mode and stop bits.
UARTx | : Pointer to selected UARTx peripheral |
Databits | : UART Data width, should be: UART_DATABIT_5: UART 5 bit data mode UART_DATABIT_6: UART 6 bit data mode UART_DATABIT_7: UART 7 bit data mode UART_DATABIT_8: UART 8 bit data mode |
Parity | : UART Parity mode, should be: UART_PARITY_NONE: No parity UART_PARITY_ODD: Odd parity UART_PARITY_EVEN: Even parity UART_PARITY_SP_1: Forced "1" stick parity UART_PARITY_SP_0: Forced "0" stick parity |
Stopbits | : Number of stop bits, should be: UART_STOPBIT_1: One Stop Bit Select UART_STOPBIT_2: Two Stop Bits Select |
Definition at line 65 of file uart_18xx_43xx.h.
void Chip_UART_DeInit | ( | LPC_USART_Type * | UARTx | ) |
De-initializes the UARTx peripheral.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 105 of file uart_18xx_43xx.c.
STATIC INLINE void Chip_UART_FIFOConfig | ( | LPC_USART_Type * | UARTx, |
UART_FIFO_CFG_Type * | FIFOCfg | ||
) |
Configure FIFO function on selected UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
FIFOCfg | : Pointer to a UART_FIFO_CFG_Type Structure that contains specified information about FIFO configuration |
Definition at line 109 of file uart_18xx_43xx.h.
STATIC INLINE void Chip_UART_FIFOConfigStructInit | ( | UART_FIFO_CFG_Type * | UART_FIFOInitStruct | ) |
Fills each UART_FIFOInitStruct member with its default value:
UART_FIFOInitStruct | : Pointer to a UART_FIFO_CFG_Type structure which will be initialized. |
Definition at line 124 of file uart_18xx_43xx.h.
STATIC INLINE void Chip_UART_ForceBreak | ( | LPC_USART_Type * | UARTx | ) |
Force BREAK character on UART line, output pin UARTx TXD is forced to logic 0.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 184 of file uart_18xx_43xx.h.
UART_Int_Status Chip_UART_GetIntStatus | ( | LPC_USART_Type * | UARTx | ) |
Get Interrupt Stream Status.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 135 of file uart_18xx_43xx.c.
STATIC INLINE uint8_t Chip_UART_GetLineStatus | ( | LPC_USART_Type * | UARTx | ) |
Get current value of Line Status register in UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 164 of file uart_18xx_43xx.h.
void Chip_UART_Init | ( | LPC_USART_Type * | UARTx | ) |
Initializes the UARTx peripheral.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 94 of file uart_18xx_43xx.c.
void Chip_UART_InitRingBuffer | ( | void | ) |
Reset Tx and Rx ring buffer (head and tail)
Definition at line 344 of file uart_18xx_43xx.c.
STATIC INLINE void Chip_UART_IntConfig | ( | LPC_USART_Type * | UARTx, |
UART_INT_Type | UARTIntCfg, | ||
FunctionalState | NewState | ||
) |
Enable or disable specified UART interrupt.
UARTx | : Pointer to selected UARTx peripheral |
UARTIntCfg | : Specifies the interrupt flag, should be one of the following:
|
NewState | : New state of specified UART interrupt type, should be ENALBE or DISALBE |
Definition at line 144 of file uart_18xx_43xx.h.
void Chip_UART_Interrupt_Handler | ( | LPC_USART_Type * | UARTx | ) |
Uart interrupt service routine (chip layer)
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 171 of file uart_18xx_43xx.c.
uint32_t Chip_UART_Interrupt_Receive | ( | LPC_USART_Type * | UARTx, |
uint8_t * | rxbuf, | ||
uint8_t | buflen | ||
) |
UART read function for interrupt mode (using ring buffers)
UARTx | : Selected UART peripheral used to send data, should be UART0 |
rxbuf | : Pointer to Received buffer |
buflen | : Length of Received buffer |
Definition at line 312 of file uart_18xx_43xx.c.
uint32_t Chip_UART_Interrupt_Transmit | ( | LPC_USART_Type * | UARTx, |
uint8_t * | txbuf, | ||
uint8_t | buflen | ||
) |
UART transmit function for interrupt mode (using ring buffers)
UARTx | : Selected UART peripheral used to send data, should be UART0 |
txbuf | : Pointer to Transmit buffer |
buflen | : Length of Transmit buffer |
Definition at line 237 of file uart_18xx_43xx.c.
STATIC INLINE uint32_t Chip_UART_IntGetStatus | ( | LPC_USART_Type * | UARTx | ) |
Get Source Interrupt.
UARTx | : Pointer to selected UARTx peripheral |
Definition at line 154 of file uart_18xx_43xx.h.
STATIC INLINE uint32_t Chip_UART_Receive | ( | LPC_USART_Type * | UARTx, |
uint8_t * | rxbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Receive a block of data via UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
rxbuf | : Pointer to Received buffer |
buflen | : Length of Received buffer |
flag | : Flag mode, should be NONE_BLOCKING or BLOCKING |
Definition at line 94 of file uart_18xx_43xx.h.
STATIC INLINE Status Chip_UART_ReceiveByte | ( | LPC_USART_Type * | UARTx, |
uint8_t * | Data | ||
) |
Receive a single data from UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
*Data | : Pointer to Data to receive (must be 8-bit long) |
Definition at line 206 of file uart_18xx_43xx.h.
STATIC INLINE uint32_t Chip_UART_Send | ( | LPC_USART_Type * | UARTx, |
uint8_t * | txbuf, | ||
uint32_t | buflen, | ||
TRANSFER_BLOCK_Type | flag | ||
) |
Send a block of data via UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
txbuf | : Pointer to Transmit buffer |
buflen | : Length of Transmit buffer |
flag | : Flag used in UART transfer, should be NONE_BLOCKING or BLOCKING |
Definition at line 81 of file uart_18xx_43xx.h.
STATIC INLINE Status Chip_UART_SendByte | ( | LPC_USART_Type * | UARTx, |
uint8_t | Data | ||
) |
Transmit a single data through UART peripheral.
UARTx | : Pointer to selected UARTx peripheral |
Data | : Data to transmit (must be 8-bit long) |
Definition at line 195 of file uart_18xx_43xx.h.
Status Chip_UART_SetBaud | ( | LPC_USART_Type * | UARTx, |
uint32_t | baudrate | ||
) |
Determines best dividers to get a target baud rate.
UARTx | : Pointer to selected UARTx peripheral |
baudrate | : Desired UART baud rate. |
Definition at line 116 of file uart_18xx_43xx.c.
void Chip_UART_TxCmd | ( | LPC_USART_Type * | UARTx, |
FunctionalState | NewState | ||
) |
Enable/Disable transmission on UART TxD pin.
UARTx | : Pointer to selected UARTx peripheral |
NewState | : New State of Tx transmission function, should be ENABLE or DISABLE |
Definition at line 127 of file uart_18xx_43xx.c.