b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 1 | #include "lynq-adc.h" |
| 2 | #include "mbtk_type.h" |
| 3 | #include "mbtk_adc.h" |
| 4 | #include "mbtk_log.h" |
| 5 | |
| 6 | int qser_adc_show(ADC_CHANNEL_E qadc) |
| 7 | { |
| 8 | UNUSED(qadc); |
| 9 | |
| 10 | mbtk_adc_enum adc = MBTK_ADC0; |
| 11 | switch(qadc) { |
wangyouqiang | cc231c2 | 2024-04-12 18:51:06 +0800 | [diff] [blame] | 12 | case QADC_NONE: |
| 13 | { |
| 14 | return 0; |
| 15 | } |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 16 | case ADC0: |
| 17 | adc = MBTK_ADC0; |
| 18 | break; |
| 19 | case ADC1: |
| 20 | adc = MBTK_ADC1; |
| 21 | break; |
r.xiao | f6ec482 | 2024-04-03 02:46:00 -0700 | [diff] [blame] | 22 | #if defined(MBTK_PROJECT_T108) || defined(MBTK_PROJECT_L508_X6) |
| 23 | case ADC2: |
| 24 | adc = MBTK_ADC2; |
wangyouqiang | cc231c2 | 2024-04-12 18:51:06 +0800 | [diff] [blame] | 25 | break; |
r.xiao | f6ec482 | 2024-04-03 02:46:00 -0700 | [diff] [blame] | 26 | #endif |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 27 | default: |
| 28 | LOGE("Unsupport adc : %d", qadc); |
| 29 | return -1; |
| 30 | } |
| 31 | |
| 32 | return mbtk_adc_get(adc); |
| 33 | } |
| 34 | |