LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC13xx UART example

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 Baudrate-8-N-1 (Baudrate is optional). 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:
LPC13xx example quickstart for Code Red Xpresso
LPC13xx example quickstart for Keil uVision4
LPC13xx example quickstart for IAR EWARM

Supported boards and board setup:
NXP Xpresso LPC1347 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 [] = "LPC13xx 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 72 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 109 of file uart.c.

void UART_IRQHandler ( void  )

UART interrupt handler using ring buffers.

Returns
Nothing

Definition at line 96 of file uart.c.

Variable Documentation

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

Definition at line 77 of file uart.c.

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

Definition at line 78 of file uart.c.

uint8_t rxbuff[UART_RB_SIZE]
static

Definition at line 75 of file uart.c.

Definition at line 69 of file uart.c.

uint8_t txbuff[UART_RB_SIZE]
static

Definition at line 75 of file uart.c.

Definition at line 69 of file uart.c.