62 #if defined(BOARD_HITEX_EVA_18504350)
65 #elif defined (BOARD_KEIL_MCB_18574357)
68 #elif defined (BOARD_NGX_XPLORER_18304330)
72 #error No UART selected for undefined board
76 #define LPC_UART LPC_USART0
77 #define UARTx_IRQn USART0_IRQn
78 #define UARTx_IRQHandler UART0_IRQHandler
79 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART0_Tx
80 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART0_Rx
82 #define LPC_UART LPC_UART1
83 #define UARTx_IRQn UART1_IRQn
84 #define UARTx_IRQHandler UART1_IRQHandler
85 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART1_Tx
86 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART1_Rx
88 #define LPC_UART LPC_USART2
89 #define UARTx_IRQn USART2_IRQn
90 #define UARTx_IRQHandler UART2_IRQHandler
91 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART2_Tx
92 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART2_Rx
94 #define LPC_UART LPC_USART3
95 #define UARTx_IRQn USART3_IRQn
96 #define UARTx_IRQHandler UART3_IRQHandler
97 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART3_Tx
98 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART3_Rx
106 "\t 1: Polling Mode \n\r"
107 "\t 2: Interrupt Mode \n\r"
108 "\t 3: DMA Mode \n\r";
109 static uint8_t
uartPolling_menu5[] =
"\n\rPolling mode is running now! Please press \'c\' and choose another mode \n\r";
113 "UART Interrupt mode demo ! \n\rPress '1' to '4' to display 4 menus \n\rPress 'x'to exist uart interrupt mode \n\r";
120 #define DMA_TIMEOUT 0xA000000
124 static uint8_t
uartDMA_menu[] =
"Hello NXP Semiconductors (DMA mode)\n\r"
125 "UART DMA mode demo ! Please type 'hello NXP' to return\n\r";
145 NVIC_DisableIRQ(DMA_IRQn);
146 NVIC_SetPriority(DMA_IRQn, ((0x01 << 3) | 0x01));
147 NVIC_EnableIRQ(DMA_IRQn);
155 NVIC_DisableIRQ(DMA_IRQn);
161 uint8_t receiveBuffer[16];
172 sizeof(uartDMA_menu));
247 uint8_t isExit = 0, userInput;
259 if (userInput ==
'1') {
262 else if (userInput ==
'2') {
265 else if (userInput ==
'3') {
268 else if (userInput ==
'4') {
271 else if (( userInput ==
'x') || ( userInput ==
'X') ) {
339 #if !((defined(CHIP_LPC43XX) && defined(BOARD_KEIL_MCB_18574357) && UARTNum==3) || ((!(defined(CHIP_LPC43XX) && defined(BOARD_KEIL_MCB_18574357))) && UARTNum==0))
360 while (exitflag ==
RESET) {
365 if (buffer[0] == 27) {
371 else if (buffer[0] ==
'c') {
376 if ((buffer[0] !=
'1') && (buffer[0] !=
'2') && (buffer[0] !=
'3')) {