Example description
The UART example shows how to use the UART in polling, interrupt, and DMA modes.
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). After a reset condition, press 'a' or 'A' to start Auto-baudrate mode. Once Auto baud rate mode completed, welcome menu is printed on terminal. Change modes by selecting the option from the terminal.
Special connection requirements
- Embedded Artists' LPC1788 Developer's Kit:
- Embedded Artists' LPC4088 Developer's Kit:
If using UART2: Connects UART pins to COM Port (J17)
JP6-1-2: OFF:
JP6-3-4: OFF:
JP6-5-6: ON:
JP12: 2-3
JP13: 2-3
Other jumpers: Default
- LPCXpresso LPC1769:
Need to connect with base board for using RS232/UART port.
Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso
Supported boards and board setup:
Embedded Artists' LPC1788 Developer's Kit
Embedded Artists' LPC4088 Developer's Kit
NXP Xpresso LPC1769 board
Submitting LPCOpen issues:
Community support for LPCOpen
| #define DMA_TIMEOUT 0xA000000 |
| #define UARTx_IRQn UART0_IRQn |
| static void App_DMA_DeInit |
( |
void |
| ) |
|
|
static |
| static void App_DMA_Init |
( |
void |
| ) |
|
|
static |
| static void App_DMA_Test |
( |
void |
| ) |
|
|
static |
| static void App_Interrupt_DeInit |
( |
void |
| ) |
|
|
static |
| static void App_Interrupt_Init |
( |
void |
| ) |
|
|
static |
| static void App_Interrupt_Test |
( |
void |
| ) |
|
|
static |
| void DMA_IRQHandler |
( |
void |
| ) |
|
GPDMA interrupt handler sub-routine.
- Returns
- Nothing
Definition at line 309 of file uart.c.
Main UART program body.
Main program body.
- Returns
- Always returns -1
Definition at line 339 of file uart.c.
| static void Print_Menu_Interrupt |
( |
LPC_USART_T * |
UARTx | ) |
|
|
static |
| static void Print_Menu_Polling |
( |
void |
| ) |
|
|
static |
| void UARTx_IRQHandler |
( |
void |
| ) |
|
UART interrupt handler sub-routine.
- Returns
- Nothing
Definition at line 330 of file uart.c.
| uint8_t uart_interrupt_menu[] |
|
static |
Initial value:=
"UART Interrupt mode demo ! \n\rPress '1' to '4' to display 4 menus \n\rPress 'x'to exist uart interrupt mode \n\r"
Definition at line 127 of file uart.c.
| uint8_t uart_interrupt_menu1[] = "UART interrupt menu 1 \n\r" |
|
static |
| uint8_t uart_interrupt_menu2[] = "UART interrupt menu 2 \n\r" |
|
static |
| uint8_t uart_interrupt_menu3[] = "UART interrupt menu 3 \n\r" |
|
static |
| uint8_t uart_interrupt_menu4[] = "UART interrupt menu 4 \n\r" |
|
static |
| uint8_t uartABComplete[] = "UART Auto-Baurate synchronized! \n\r" |
|
static |
Initial value:= "Hello NXP Semiconductors (DMA mode)\n\r"
"UART DMA mode demo ! Please type 'hello NXP' to return\n\r"
Definition at line 139 of file uart.c.
| uint8_t uartPolling_menu1[] = "Hello NXP Semiconductors \n\r" |
|
static |
| uint8_t uartPolling_menu2[] = "UART polling mode demo \n\r" |
|
static |
| uint8_t uartPolling_menu3[] = "\n\rUART demo terminated!" |
|
static |
| uint8_t uartPolling_menu4[] |
|
static |
Initial value:= "\n\rPress number 1-3 to choose UART running mode:\n\r"
"\t 1: Polling Mode \n\r"
"\t 2: Interrupt Mode \n\r"
"\t 3: DMA Mode \n\r"
Definition at line 120 of file uart.c.
| uint8_t uartPolling_menu5[] = "\n\rPolling mode is running now! Please press \'c\' and choose another mode \n\r" |
|
static |