blob: 4317e17320e83ed8c93d4ca74f28e1532e5188c9 [file] [log] [blame]
b.liu4e243dc2023-11-27 11:20:00 +08001#include "lynq-adc.h"
2#include "mbtk_type.h"
3#include "mbtk_adc.h"
4#include "mbtk_log.h"
5
6int qser_adc_show(ADC_CHANNEL_E qadc)
7{
8 UNUSED(qadc);
9
10 mbtk_adc_enum adc = MBTK_ADC0;
11 switch(qadc) {
wangyouqiangcc231c22024-04-12 18:51:06 +080012 case QADC_NONE:
13 {
14 return 0;
15 }
b.liu4e243dc2023-11-27 11:20:00 +080016 case ADC0:
17 adc = MBTK_ADC0;
18 break;
19 case ADC1:
20 adc = MBTK_ADC1;
21 break;
r.xiaof6ec4822024-04-03 02:46:00 -070022#if defined(MBTK_PROJECT_T108) || defined(MBTK_PROJECT_L508_X6)
23 case ADC2:
24 adc = MBTK_ADC2;
wangyouqiangcc231c22024-04-12 18:51:06 +080025 break;
r.xiaof6ec4822024-04-03 02:46:00 -070026#endif
b.liu4e243dc2023-11-27 11:20:00 +080027 default:
28 LOGE("Unsupport adc : %d", qadc);
29 return -1;
30 }
31
32 return mbtk_adc_get(adc);
33}
34