Skip to content

Commit ed66fc5

Browse files
committed
include:hw:adc: add API to get adc value in mv
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent f95922c commit ed66fc5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/hw/adc.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ int adc_config(int ch);
2121

2222
/**
2323
* Read ADC Channel
24+
*
25+
* @note 8910 has 12-bit ADC, whereas MT6261 has 10-bit ADC resolution
26+
*
2427
* @param ch [in] ADC Channel to read @ref adcch_e
25-
* @return 12-bit ADC value, If ADC channel is not configured prior to calling this function, return value is unreliable.
28+
* @return ADC raw value, If ADC channel is not configured prior to calling this function, return value is unreliable.
2629
*/
2730
unsigned int adc_read(int ch);
2831

32+
/**
33+
* @brief Read adc channel value in mV
34+
*
35+
* @param ch [in] ADC Channel to read @ref adcch_e
36+
* @return ADC value in millivolts, If ADC channel is not configured prior to calling this function, return value is unreliable.
37+
*/
38+
unsigned int adc_read_mv(int ch);
39+
2940
#ifdef __cplusplus
3041
}
3142
#endif

0 commit comments

Comments
 (0)