81 #ifdef BOARD_NXP_XPRESSO_1769
82 #define _ADC_CHANNLE ADC_CH0
84 #define _ADC_CHANNLE ADC_CH2
86 #define _LPC_ADC_ID LPC_ADC
87 #define _LPC_ADC_IRQ ADC_IRQn
88 #define _GPDMA_CONN_ADC GPDMA_CONN_ADC
89 static char WelcomeMenu[] =
"\r\nHello NXP Semiconductors \r\n"
91 #if defined(CHIP_LPC175X_6X)
92 "Sample rate : 200kHz \r\n"
94 "Sample rate : 400kHz \r\n"
96 "Press \'c\' to continue or \'x\' to quit\r\n"
97 "Press \'o\' or \'p\' to set Sample rate\r\n"
98 "Press \'b\' to ENABLE or DISABLE Burst Mode\r\n";
99 static char SelectMenu[] =
"\r\nPress number 1-3 to choose ADC running mode:\r\n"
100 "\t1: Polling Mode \r\n"
101 "\t2: Interrupt Mode \r\n"
102 "\t3: DMA Mode \r\n";
121 DEBUGOUT(
"ADC value is : 0x%04x\r\n", data);
134 NVIC_DisableIRQ(DMA_IRQn);
135 NVIC_SetPriority(DMA_IRQn, ((0x01 << 3) | 0x01));
136 NVIC_EnableIRQ(DMA_IRQn);
138 NVIC_DisableIRQ(_LPC_ADC_IRQ);
169 NVIC_DisableIRQ(DMA_IRQn);
180 NVIC_EnableIRQ(_LPC_ADC_IRQ);
200 NVIC_DisableIRQ(_LPC_ADC_IRQ);
248 NVIC_DisableIRQ(_LPC_ADC_IRQ);
254 NVIC_EnableIRQ(_LPC_ADC_IRQ);
280 bool end_Flag =
false;
296 if (bufferUART ==
'c') {
299 while (bufferUART == 0xFF) {
301 if ((bufferUART !=
'1') && (bufferUART !=
'2') && (bufferUART !=
'3')) {
305 switch (bufferUART) {
320 else if (bufferUART ==
'x') {
322 DEBUGOUT(
"\r\nADC demo terminated!");
324 else if (bufferUART ==
'o') {
325 _bitRate -= _bitRate > 0 ? 1000 : 0;
327 DEBUGOUT(
"Rate : %d Sample/s\r\n", _bitRate);
329 else if (bufferUART ==
'p') {
330 _bitRate += _bitRate < 400000 ? 1000 : 0;
332 DEBUGOUT(
"Rate : %d Sample/s\r\n", _bitRate);
334 else if (bufferUART ==
'b') {
342 DEBUGOUT(
"Burst Mode DISABLED\r\n");