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) { |
| 12 | case ADC0: |
| 13 | adc = MBTK_ADC0; |
| 14 | break; |
| 15 | case ADC1: |
| 16 | adc = MBTK_ADC1; |
| 17 | break; |
r.xiao | f6ec482 | 2024-04-03 02:46:00 -0700 | [diff] [blame^] | 18 | #if defined(MBTK_PROJECT_T108) || defined(MBTK_PROJECT_L508_X6) |
| 19 | case ADC2: |
| 20 | adc = MBTK_ADC2; |
| 21 | #endif |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 22 | default: |
| 23 | LOGE("Unsupport adc : %d", qadc); |
| 24 | return -1; |
| 25 | } |
| 26 | |
| 27 | return mbtk_adc_get(adc); |
| 28 | } |
| 29 | |