Driver for the cc2538 ADC controller.
More...
|
file | adc.c |
| Implementation of the cc2538 ADC driver.
|
|
file | adc.h |
| Header file for the cc2538 ADC driver.
|
|
|
void | adc_init (void) |
| Initializes the ADC controller.
|
|
int16_t | adc_get (uint8_t channel, uint8_t ref, uint8_t div) |
| Performs a single conversion on a given ADC channel. More...
|
|
Driver for the cc2538 ADC controller.
◆ adc_get()
int16_t adc_get |
( |
uint8_t |
channel, |
|
|
uint8_t |
ref, |
|
|
uint8_t |
div |
|
) |
| |
Performs a single conversion on a given ADC channel.
- Parameters
-
channel | The channel used for the conversion: SOC_ADC_ADCCON_CH_x |
ref | The reference voltage used for the conversion: SOC_ADC_ADCCON_REF_x |
div | The decimation rate used for the conversion: SOC_ADC_ADCCON_DIV_x |
- Returns
- Signed 16-bit conversion result: 2's complement, ENOBs in MSBs
- Note
- PD[5:4] are not usable when the temperature sensor is selected.
Definition at line 57 of file adc.c.