Contiki 3.x
Files

Driver for the cc2538 ADC controller. More...

Files

file  adc.c
 Implementation of the cc2538 ADC driver.
 
file  adc.h
 Header file for the cc2538 ADC driver.
 

ADC functions

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...
 

Detailed Description

Driver for the cc2538 ADC controller.

Function Documentation

int16_t adc_get ( uint8_t  channel,
uint8_t  ref,
uint8_t  div 
)

Performs a single conversion on a given ADC channel.

Parameters
channelThe channel used for the conversion: SOC_ADC_ADCCON_CH_x
refThe reference voltage used for the conversion: SOC_ADC_ADCCON_REF_x
divThe 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.

References CCTEST_TR0, CCTEST_TR0_ADCTM, RFCORE_XREG_ATEST, RFCORE_XREG_ATEST_ATEST_CTRL, RFCORE_XREG_ATEST_ATEST_CTRL_TEMP, SOC_ADC_ADCCON1, SOC_ADC_ADCCON1_EOC, SOC_ADC_ADCCON3, SOC_ADC_ADCCON3_ECH, SOC_ADC_ADCCON3_EDIV, SOC_ADC_ADCCON3_EREF, SOC_ADC_ADCCON_CH_TEMP, SOC_ADC_ADCH, and SOC_ADC_ADCL.