71 #if defined(BOARD_HITEX_EVA_18504350)
74 #elif defined (BOARD_KEIL_MCB_18574357)
77 #elif defined (BOARD_NGX_XPLORER_18304330)
81 #error No UART selected for undefined board
85 #define LPC_UART LPC_USART0
86 #define UARTx_IRQn USART0_IRQn
87 #define UARTx_IRQHandler UART0_IRQHandler
88 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART0_Tx
89 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART0_Rx
91 #define LPC_UART LPC_UART1
92 #define UARTx_IRQn UART1_IRQn
93 #define UARTx_IRQHandler UART1_IRQHandler
94 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART1_Tx
95 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART1_Rx
97 #define LPC_UART LPC_USART2
98 #define UARTx_IRQn USART2_IRQn
99 #define UARTx_IRQHandler UART2_IRQHandler
100 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART2_Tx
101 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART2_Rx
103 #define LPC_UART LPC_USART3
104 #define UARTx_IRQn USART3_IRQn
105 #define UARTx_IRQHandler UART3_IRQHandler
106 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART3_Tx
107 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART3_Rx
117 "\t 1: Polling Mode \r\n"
118 "\t 2: Interrupt Mode \r\n"
119 "\t 3: DMA Mode \r\n";
120 static uint8_t
uartPolling_menu5[] =
"\r\nPolling mode is running now! Please press \'c\' and choose another mode \r\n";
124 "UART Interrupt mode demo ! \r\nPress '1' to '4' to display 4 menus \r\nPress 'x'to exit UART interrupt mode \r\n";
131 #define DMA_TIMEOUT 0xA000000
135 static uint8_t
uartDMA_menu[] =
"Hello NXP Semiconductors (DMA mode)\r\n"
136 "UART DMA mode demo ! Please type 'hello NXP' to return\r\n";
156 NVIC_DisableIRQ(DMA_IRQn);
157 NVIC_SetPriority(DMA_IRQn, ((0x01 << 3) | 0x01));
158 NVIC_EnableIRQ(DMA_IRQn);
166 NVIC_DisableIRQ(DMA_IRQn);
172 uint8_t receiveBuffer[16];
183 sizeof(uartDMA_menu));
258 uint8_t isExit = 0, userInput;
270 if (userInput ==
'1') {
273 else if (userInput ==
'2') {
276 else if (userInput ==
'3') {
279 else if (userInput ==
'4') {
282 else if (( userInput ==
'x') || ( userInput ==
'X') ) {
350 #if !((defined(CHIP_LPC43XX) && defined(BOARD_KEIL_MCB_18574357) && UARTNum==3) || ((!(defined(CHIP_LPC43XX) && defined(BOARD_KEIL_MCB_18574357))) && UARTNum==0))
397 while (exitflag ==
RESET) {
402 if (buffer[0] == 27) {
408 else if (buffer[0] ==
'c') {
413 if ((buffer[0] !=
'1') && (buffer[0] !=
'2') && (buffer[0] !=
'3')) {