📄 adc.lst
字号:
ARM COMPILER V2.53, adc 22/04/07 10:23:46 PAGE 1
ARM COMPILER V2.53, COMPILATION OF MODULE adc
OBJECT MODULE PLACED IN adc.OBJ
COMPILER INVOKED BY: c:\Keil\ARM\BIN\CA.exe adc.c THUMB DEBUG TABS(4)
stmt level source
1 /******************************************************************************/
2 /* This file is part of the uVision/ARM development tools */
3 /* Copyright KEIL ELEKTRONIK GmbH 2002-2004 */
4 /******************************************************************************/
5 /* */
6 /* BLINKY.C: LED Flasher */
7 /* */
8 /******************************************************************************/
9
10 #include <LPC21xx.H> /* LPC21xx definitions */
*** ERROR C318 IN LINE 10 OF adc.c: can't open file 'LPC21xx.H'
11
12 extern void init_serial (void); /* Initialize Serial Interface */
13 extern int putchar (int ch); /* Write character to Serial Port */
14 extern int getchar (void); /* Read character from Serial Port */
15
16
17 void puthex (int hex) { /* Write Hex Digit to Serial Port */
18 1 if (hex > 9) putchar('A' + (hex - 10));
19 1 else putchar('0' + hex);
20 1 }
21
22 void putstr (char *p) { /* Write string */
23 1 while (*p) {
24 2 putchar (*p++);
25 2 }
26 1 }
27
28
29 void delay (void) { /* Delay function */
30 1 unsigned int cnt;
31 1 unsigned int val;
32 1
33 1 ADCR |= 0x01000000; /* Start A/D Conversion */
*** ERROR C67 IN LINE 33 OF ADC.C: 'ADCR': undefined identifier
34 1 do {
35 2 val = ADDR; /* Read A/D Data Register */
*** ERROR C67 IN LINE 35 OF ADC.C: 'ADDR': undefined identifier
36 2 } while ((val & 0x80000000) == 0); /* Wait for end of A/D Conversion */
37 1 ADCR &= ~0x01000000; /* Stop A/D Conversion */
*** ERROR C67 IN LINE 37 OF ADC.C: 'ADCR': undefined identifier
38 1 val = (val >> 6) & 0x03FF; /* Extract AIN0 Value */
39 1
40 1 putstr ("\nAIN0 Result = 0x"); /* Output A/D Conversion Result */
41 1 puthex((val >> 8) & 0x0F); /* Write 1. Hex Digit */
42 1 puthex((val >> 4) & 0x0F); /* Write 2. Hex Digit */
43 1 puthex (val & 0x0F); /* Write 3. Hex Digit */
44 1
45 1 val = (val >> 2) << 12; /* Adjust Delay Value */
46 1 for (cnt = 0; cnt < val; cnt++); /* Delay */
47 1 }
48
49
50 int main (void) {
51 1 unsigned int n;
52 1
53 1 IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */
*** ERROR C67 IN LINE 53 OF ADC.C: 'IODIR1': undefined identifier
54 1 ADCR = 0x002E0401; /* Setup A/D: 10-bit AIN0 @ 3MHz */
ARM COMPILER V2.53, adc 22/04/07 10:23:46 PAGE 2
*** ERROR C67 IN LINE 54 OF ADC.C: 'ADCR': undefined identifier
55 1 init_serial(); /* Initialize Serial Interface */
56 1 IOSET1=0x00ff0000;
*** ERROR C67 IN LINE 56 OF ADC.C: 'IOSET1': undefined identifier
57 1 while (1) { /* Loop forever */
58 2 for (n = 0x00010000; n <= 0x00800000; n <<= 1) {
59 3 /* Blink LED 0, 1, 2, 3, 4, 5, 6, 7 */
60 3 IOCLR1 = n; /* Turn on LED */
*** ERROR C67 IN LINE 60 OF ADC.C: 'IOCLR1': undefined identifier
61 3 delay(); /* Delay */
62 3 IOSET1 = 0x00FF0000; /* Turn off LEDs */
*** ERROR C67 IN LINE 62 OF ADC.C: 'IOSET1': undefined identifier
63 3 }
64 2 }
65 1 }
ARM COMPILATION COMPLETE. 0 WARNING(S), 9 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -