| 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
Macros | Functions | Variables
LPC11xx UART example
Peripheral examples

## Detailed Description

Example description
The UART example shows how to use the UART in interrupt mode with transmit and receive ring buffers.

To use the example, connect a serial cable to the board's RS232/UART port and start a terminal program to monitor the port. The terminal program on the host PC should be setup for 115200-8-N-1. Once the example is started, a small message is printed on terminal. Any data received will be returned back to the caller.

Special connection requirements
Need to connect with base board for using RS232/UART port.

Build procedures:
LPC11xx example quickstart for Code Red Xpresso
LPC11xx example quickstart for Keil uVision4
LPC11xx example quickstart for IAR EWARM

Supported boards and board setup:
NXP Xpresso LPC11U14 board
NXP Xpresso LPC11C24 board

Submitting LPCOpen issues:
Community support for LPCOpen

## Macros
#define | UART_RB_SIZE 64

## Functions
void | UART_IRQHandler (void)
| UART interrupt handler using ring buffers.
int | main (void)
| Main UART program body.

## Variables
STATIC RINGBUFF_T | txring
STATIC RINGBUFF_T | rxring
static uint8_t | rxbuff [UART_RB_SIZE]
static uint8_t | txbuff [UART_RB_SIZE]
const char | inst1 [] = "LPC11xx UART example using ring buffers\r\n"
const char | inst2 [] = "Press a key to echo it back or ESC to quit\r\n"

## Macro Definition Documentation

#define UART_RB_SIZE 64

Definition at line 73 of file uart.c.

## Function Documentation

int main | ( | void |  | ) |

Main UART program body.

Main program body.

Returns
  Always returns 1

defined(CHIP_LPC175X_6X)

Definition at line 110 of file uart.c.

void UART_IRQHandler | ( | void |  | ) |

UART interrupt handler using ring buffers.

Returns
  Nothing

Definition at line 97 of file uart.c.

## Variable Documentation

const char inst1[] = "LPC11xx UART example using ring buffers\r\n"

Definition at line 78 of file uart.c.

const char inst2[] = "Press a key to echo it back or ESC to quit\r\n"

Definition at line 79 of file uart.c.

uint8_t rxbuff[UART_RB_SIZE]
| static

Definition at line 76 of file uart.c.

STATIC RINGBUFF_T rxring

Definition at line 70 of file uart.c.

uint8_t txbuff[UART_RB_SIZE]
| static

Definition at line 76 of file uart.c.

STATIC RINGBUFF_T txring

Definition at line 70 of file uart.c.