Contiki-Inga 3.x
Functions
adc.h File Reference

    ADC driver definitions
More...

#include <avr/io.h>

Go to the source code of this file.

Macros

ADC modes
#define ADC_SINGLE_CONVERSION   0xFF
 
#define ADC_FREE_RUNNING   0x00
 
#define ADC_ANALOG_COMPARATOR   (1 << ADTS0)
 
#define ADC_EXT_INTERRUPT   (1 << ADTS1)
 
#define ADC_TIMER0_COMP_FLAG   ((1 << ADTS1) | (1 << ADTS0))
 
#define ADC_TIMER0_OVERFLOW   (1 << ADTS2)
 
#define ADC_TIMER1_COMP_FLAG   ((1 << ADTS2) | (1 << ADTS0))
 
#define ADC_TIMER1_OVERFLOW   ((1 << ADTS2) | (1 << ADTS1))
 
#define ADC_TIMER1_CAPTURE   ((1 << ADTS2) | (1 << ADTS1) | (1 << ADTS0))
 
ADC reference voltage sources
#define ADC_REF_AREF   0
 
#define ADC_REF_AVCC   (1 << REFS0)
 
#define ADC_REF_1100MV_INT   (1 << REFS1)
 
#define ADC_REF_2560MV_INT   ((1 << REFS1)| (1 << REFS0))
 
ADMUX - ADC Multiplexer Selection Register
#define ADC_CHANNEL_0   0x00
 
#define ADC_CHANNEL_1   0x01
 
#define ADC_CHANNEL_2   0x02
 
#define ADC_CHANNEL_3   0x03
 
#define ADC_CHANNEL_4   0x04
 
#define ADC_CHANNEL_5   0x05
 
#define ADC_CHANNEL_6   0x06
 
#define ADC_CHANNEL_7   0x07
 
#define ADC_DIFF_ADC0_ADC0_10X   0x08
 
#define ADC_DIFF_ADC1_ADC0_10X   0x09
 
#define ADC_DIFF_ADC0_ADC0_200X   0x0A
 
#define ADC_DIFF_ADC1_ADC0_200X   0x0B
 
#define ADC_DIFF_ADC2_ADC2_10X   0x0C
 
#define ADC_DIFF_ADC3_ADC2_10X   0x0D
 
#define ADC_DIFF_ADC2_ADC2_200X   0x0E
 
#define ADC_DIFF_ADC3_ADC2_200X   0x0F
 
#define ADC_DIFF_ADC0_ADC1_1X   0x10
 
#define ADC_DIFF_ADC1_ADC1_1X   0x11
 
#define ADC_DIFF_ADC2_ADC1_1X   0x12
 
#define ADC_DIFF_ADC3_ADC1_1X   0x13
 
#define ADC_DIFF_ADC4_ADC1_1X   0x14
 
#define ADC_DIFF_ADC5_ADC1_1X   0x15
 
#define ADC_DIFF_ADC6_ADC1_1X   0x16
 
#define ADC_DIFF_ADC7_ADC1_1X   0x17
 
#define ADC_DIFF_ADC0_ADC2_1X   0x18
 
#define ADC_DIFF_ADC1_ADC2_1X   0x19
 
#define ADC_DIFF_ADC2_ADC2_1X   0x1A
 
#define ADC_DIFF_ADC3_ADC2_1X   0x1B
 
#define ADC_DIFF_ADC4_ADC2_1X   0x1C
 

Functions

void adc_init (uint8_t mode, uint8_t ref)
 Initialize the ADC module. More...
 
uint16_t adc_get_value (void)
 This function returns the ADC data register value. More...
 
uint16_t adc_get_value_from (uint8_t chn)
 This function returns the ADC data register value of the given ADC channel. More...
 
void adc_set_mux (uint8_t mux)
 With this function you can set the ADX multiplexer. More...
 
void adc_deinit (void)
 This function stops all running ADC. More...
 

Detailed Description

    ADC driver definitions
Author
Ulf Kulau kulau.nosp@m.@ibr.nosp@m..cs.t.nosp@m.u-bs.nosp@m..de

Definition in file adc.h.