Contiki-NG
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

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