b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 1 | #include <stdio.h> |
2 | #include "ql_adc.h" | ||||
3 | |||||
4 | int main(int argc, char *argv[]) | ||||
5 | { | ||||
6 | if(argc != 2) { | ||||
7 | printf("ql_adc_test <0/1/2>\n"); | ||||
8 | return -1; | ||||
9 | } | ||||
10 | |||||
11 | int adc = atoi(argv[1]); | ||||
12 | if(adc != 0 && adc != 1 && adc != 2) { | ||||
13 | printf("ql_adc_test <0/1/2>\n"); | ||||
14 | return -1; | ||||
15 | } | ||||
16 | |||||
17 | int result = ql_adc_show((ADC_CHANNEL_E)(adc + 1)); | ||||
18 | |||||
19 | printf("ADC : %d\n", result); | ||||
20 | |||||
21 | return 0; | ||||
22 | } | ||||
23 |