b.liu | 1c74d69 | 2024-08-14 17:43:59 +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 QADC_NONE: |
| 13 | { |
| 14 | return 0; |
| 15 | } |
| 16 | case ADC0: |
| 17 | adc = MBTK_ADC0; |
| 18 | break; |
| 19 | case ADC1: |
| 20 | adc = MBTK_ADC1; |
| 21 | break; |
| 22 | #if defined(MBTK_PROJECT_T108) || defined(MBTK_PROJECT_L508_X6) |
| 23 | case ADC2: |
| 24 | adc = MBTK_ADC2; |
| 25 | break; |
| 26 | #endif |
| 27 | default: |
| 28 | LOGE("Unsupport adc : %d", qadc); |
| 29 | return -1; |
| 30 | } |
| 31 | |
| 32 | return mbtk_adc_get(adc); |
| 33 | } |
| 34 | |