80 #if defined(BOARD_EA_DEVKIT_17884088)
82 #elif defined(BOARD_NXP_XPRESSO_1769)
85 #error No UART selected for undefined board
89 #define LPC_UART LPC_UART0
90 #define UARTx_IRQn UART0_IRQn
91 #define UARTx_IRQHandler UART0_IRQHandler
92 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART0_Tx
93 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART0_Rx
95 #define LPC_UART LPC_UART1
96 #define UARTx_IRQn UART1_IRQn
97 #define UARTx_IRQHandler UART1_IRQHandler
98 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART1_Tx
99 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART1_Rx
101 #define LPC_UART LPC_UART2
102 #define UARTx_IRQn UART2_IRQn
103 #define UARTx_IRQHandler UART2_IRQHandler
104 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART2_Tx
105 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART2_Rx
107 #define LPC_UART LPC_UART3
108 #define UARTx_IRQn UART3_IRQn
109 #define UARTx_IRQHandler UART3_IRQHandler
110 #define _GPDMA_CONN_UART_Tx GPDMA_CONN_UART3_Tx
111 #define _GPDMA_CONN_UART_Rx GPDMA_CONN_UART3_Rx
121 "\t 1: Polling Mode \n\r"
122 "\t 2: Interrupt Mode \n\r"
123 "\t 3: DMA Mode \n\r";
124 static uint8_t
uartPolling_menu5[] =
"\n\rPolling mode is running now! Please press \'c\' and choose another mode \n\r";
128 "UART Interrupt mode demo ! \n\rPress '1' to '4' to display 4 menus \n\rPress 'x'to exist uart interrupt mode \n\r";
135 #define DMA_TIMEOUT 0xA000000
139 static uint8_t
uartDMA_menu[] =
"Hello NXP Semiconductors (DMA mode)\n\r"
140 "UART DMA mode demo ! Please type 'hello NXP' to return\n\r";
160 NVIC_DisableIRQ(DMA_IRQn);
161 NVIC_SetPriority(DMA_IRQn, ((0x01 << 3) | 0x01));
162 NVIC_EnableIRQ(DMA_IRQn);
170 NVIC_DisableIRQ(DMA_IRQn);
176 uint8_t receiveBuffer[16];
187 sizeof(uartDMA_menu));
262 uint8_t isExit = 0, userInput;
274 if (userInput ==
'1') {
277 else if (userInput ==
'2') {
280 else if (userInput ==
'3') {
283 else if (userInput ==
'4') {
286 else if (( userInput ==
'x') || ( userInput ==
'X') ) {
401 while (exitflag ==
RESET) {
406 if (buffer[0] == 27) {
412 else if (buffer[0] ==
'c') {
417 if ((buffer[0] !=
'1') && (buffer[0] !=
'2') && (buffer[0] !=
'3')) {