| 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: LPC11xx UART Driver interrupt transfer functions
CHIP: LPC11xx UART Driver

## Detailed Description

These functions provide data transmit/receive and support functions for the UART for use with a ring buffer.

## Functions
void | Chip_UART_RXIntHandlerRB (LPC_USART_T *pUART, RINGBUFF_T *pRB)
| UART receive-only interrupt handler for ring buffers.
void | Chip_UART_TXIntHandlerRB (LPC_USART_T *pUART, RINGBUFF_T *pRB)
| UART transmit-only interrupt handler for ring buffers.
uint32_t | Chip_UART_SendRB (LPC_USART_T *pUART, RINGBUFF_T *pRB, const void *data, int bytes)
| Populate a transmit ring buffer and start UART transmit.
int | Chip_UART_ReadRB (LPC_USART_T *pUART, RINGBUFF_T *pRB, void *data, int bytes)
| Copy data from a receive ring buffer.
void | Chip_UART_IRQRBHandler (LPC_USART_T *pUART, RINGBUFF_T *pRXRB, RINGBUFF_T *pTXRB)
| UART receive/transmit interrupt handler for ring buffers.

## Function Documentation

void Chip_UART_IRQRBHandler | ( | LPC_USART_T * | pUART,
|  | RINGBUFF_T * | pRXRB,
|  | RINGBUFF_T * | pTXRB
| ) |  |

UART receive/transmit interrupt handler for ring buffers.

Parameters

  pUART | : Pointer to selected UART peripheral
  pRXRB | : Pointer to transmit ring buffer
  pTXRB | : Pointer to receive ring buffer

Returns
  Nothing

Note
  This provides a basic implementation of the UART IRQ handler for support of a ring buffer implementation for transmit and receive.

Definition at line 228 of file uart_11xx.c.

int Chip_UART_ReadRB | ( | LPC_USART_T * | pUART,
|  | RINGBUFF_T * | pRB,
|  | void * | data,
|  | int | bytes
| ) |  |

Copy data from a receive ring buffer.

Parameters

  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

Returns
  The number of bytes placed into the ring buffer

Note
  Will move the data from the RX ring buffer up to the the maximum passed buffer size. Returns 0 if there is no data in the ring buffer.

Definition at line 220 of file uart_11xx.c.

void Chip_UART_RXIntHandlerRB | ( | LPC_USART_T * | pUART,
|  | RINGBUFF_T * | pRB
| ) |  |

UART receive-only interrupt handler for ring buffers.

Parameters

  pUART | : Pointer to selected UART peripheral
  pRB | : Pointer to ring buffer structure to use

Returns
  Nothing

Note
  If ring buffer support is desired for the receive side of data transfer, the UART interrupt should call this function for a receive based interrupt status.

Definition at line 161 of file uart_11xx.c.

uint32_t Chip_UART_SendRB | ( | LPC_USART_T * | pUART,
|  | RINGBUFF_T * | pRB,
|  | const void * | data,
|  | int | bytes
| ) |  |

Populate a transmit ring buffer and start UART transmit.

Parameters

  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

Returns
  The number of bytes placed into the ring buffer

Note
  Will move the data into the TX ring buffer and start the transfer. If the number of bytes returned is less than the number of bytes to send, the ring buffer is considered full.

Definition at line 191 of file uart_11xx.c.

void Chip_UART_TXIntHandlerRB | ( | LPC_USART_T * | pUART,
|  | RINGBUFF_T * | pRB
| ) |  |

UART transmit-only interrupt handler for ring buffers.

Parameters

  pUART | : Pointer to selected UART peripheral
  pRB | : Pointer to ring buffer structure to use

Returns
  Nothing

Note
  If ring buffer support is desired for the transmit side of data transfer, the UART interrupt should call this function for a transmit based interrupt status.

Definition at line 171 of file uart_11xx.c.