| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
CHIP: LPC8xx UART Driver
LPC8xx chip specific drivers

## Detailed Description

This driver provides UART support for the device. The driver requires the following IP drivers:
IP: USART2 register block and driver

## Functions
STATIC INLINE void | Chip_UART_ConfigData (LPC_USART_T *pUART, IP_UART_002_DATALEN_T Databits, IP_UART_002_PARITY_T Parity, IP_UART_002_STOPLEN_T Stopbits)
| Configure the UART protocol.
STATIC INLINE void | Chip_UART_IntEnable (LPC_USART_T *pUART, uint32_t UARTIntCfg, FunctionalState NewState)
| Enable/Disable UART Interrupts.
STATIC INLINE uint32_t | Chip_UART_GetIntStatus (LPC_USART_T *pUART)
| Get UART interrupt status.
void | Chip_UART_Init (LPC_USART_T *pUART)
| Initialize the UART peripheral.
void | Chip_UART_SetBaudRate (LPC_USART_T *pUART, uint32_t baudrate)
| Set baud rate for UART.
Status | Chip_UART_SendByte (LPC_USART_T *pUART, uint8_t data)
| Transmit a 8 bits data.
Status | Chip_UART_ReceiveByte (LPC_USART_T *pUART, uint8_t *Data)
| Receive a 8 bits data.

## Function Documentation

STATIC INLINE void Chip_UART_ConfigData | ( | LPC_USART_T * | pUART,
|  | IP_UART_002_DATALEN_T | Databits,
|  | IP_UART_002_PARITY_T | Parity,
|  | IP_UART_002_STOPLEN_T | Stopbits
| ) |  |

Configure the UART protocol.

Parameters

  pUART | : The base of UART peripheral on the chip
  Databits,: | Data size for the USART
  Parity | : Parity to be used by the USART
  Stopbits,: | Number of stop bits appended to transmitted data

Returns
  Nothing

Definition at line 55 of file uart_8xx.h.

STATIC INLINE uint32_t Chip_UART_GetIntStatus | ( | LPC_USART_T * | pUART | ) |

Get UART interrupt status.

Get Interrupt Stream Status.

Parameters

  pUART | : The base of UART peripheral on the chip

Returns
  The Interrupt status register of UART

Definition at line 81 of file uart_8xx.h.

void Chip_UART_Init | ( | LPC_USART_T * | pUART | ) |

Initialize the UART peripheral.

Parameters

  pUART | : The base of UART peripheral on the chip

Returns
  Nothing

Initialize the UART peripheral.

Parameters

  pUART | : Pointer to selected pUART peripheral

Returns
  Nothing

Definition at line 54 of file uart_11xx.c.

STATIC INLINE void Chip_UART_IntEnable | ( | LPC_USART_T * | pUART,
|  | uint32_t | UARTIntCfg,
|  | FunctionalState | NewState
| ) |  |

Enable/Disable UART Interrupts.

Parameters

  pUART | : The base of UART peripheral on the chip
  UARTIntCfg | : Specifies the interrupt flag
  NewState | : New state, ENABLE or DISABLE

Returns
  Nothing

Definition at line 69 of file uart_8xx.h.

Status Chip_UART_ReceiveByte | ( | LPC_USART_T * | pUART,
|  | uint8_t * | Data
| ) |  |

Receive a 8 bits data.

Parameters

  pUART | : The base of UART peripheral on the chip
  Data | : 8 bits data received

Returns
  SUCCESS or ERROR

Receive a 8 bits data.

Parameters

  pUART | : Pointer to selected pUART peripheral
  Data | : Pointer to Data to receive (must be 8-bit long)

Returns
  Status, should be ERROR or (Receive data is ready) or SUCCESS (Receive data is not ready yet)

Receive a 8 bits data.

Parameters

  pUART | : Pointer to selected pUART peripheral
  *Data | : Pointer to Data to receive (must be 8-bit long)

Returns
  Status, should be ERROR or (Receive data is ready) or SUCCESS (Receive data is not ready yet)

Definition at line 205 of file uart_17xx_40xx.h.

Status Chip_UART_SendByte | ( | LPC_USART_T * | pUART,
|  | uint8_t | data
| ) |  |

Transmit a 8 bits data.

Parameters

  pUART | : The base of UART peripheral on the chip
  data | : 8 bits data to be sent

Returns
  SUCCESS or ERROR

Transmit a 8 bits data.

Parameters

  pUART | : Pointer to selected UART peripheral
  data | : Byte to transmit

Returns
  Nothing

Note
  This function attempts to place a byte into the UART transmit FIFO or transmit hold register regard regardless of UART state.

Transmit a 8 bits data.

Parameters

  pUART | : Pointer to selected pUART peripheral
  data | : Data to transmit (must be 8-bit long)

Returns
  Status, should be ERROR (THR is empty, ready to send) or SUCCESS (THR is not empty)

Definition at line 86 of file uart_11xx.h.

void Chip_UART_SetBaudRate | ( | LPC_USART_T * | pUART,
|  | uint32_t | baudrate
| ) |  |

Set baud rate for UART.

Parameters

  pUART | : The base of UART peripheral on the chip
  baudrate,: | Baud rate to be set

Returns
  Nothing

Definition at line 61 of file uart_8xx.c.