Project 7  3-Axis Accelerometer Sensor Module
Neff Site
Macros | Functions
adc.h File Reference

This module provides access to the ADC. More...

Go to the source code of this file.

Macros

#define ADC_PORT   PORTA
 
#define ADC_MODULE   ADCA
 
#define ADC_REFCTRL_gc   ADC_REFSEL_AREFA_gc
 

Functions

void adc_init (void)
 Initializes the ADC module. More...
 
uint16_t adc_read_adc1 (void)
 Read ADC1. More...
 
uint16_t adc_read_adc2 (void)
 Read ADC2. More...
 
uint16_t adc_read_adc3 (void)
 Read ADC3. More...
 
uint16_t adc_read_adc4 (void)
 Read ADC4. More...
 

Detailed Description

This module provides access to the ADC.

This module provides high level access to the Analog-to-Digital Converter. It uses optionally AREFA as external reference and connects ADC1, ADC2, ADC3 and ADC4 with Channel 0, 1, 2 and 3. The module uses single-ended inputs the the resolution of the conversion is 12 bits.

Author
Wolfgang Neff
Version
2.0
Date
2018-07-07
History
Created: 2017-08-04 Modified: 2018-07-07

Macro Definition Documentation

◆ ADC_MODULE

#define ADC_MODULE   ADCA

◆ ADC_PORT

#define ADC_PORT   PORTA

◆ ADC_REFCTRL_gc

#define ADC_REFCTRL_gc   ADC_REFSEL_AREFA_gc

Function Documentation

◆ adc_init()

void adc_init ( void  )

Initializes the ADC module.

◆ adc_read_adc1()

uint16_t adc_read_adc1 ( void  )

Read ADC1.

Start the conversion for line ADC1 and return the result.

Returns
The result of the ADC conversion for line ADC1.

◆ adc_read_adc2()

uint16_t adc_read_adc2 ( void  )

Read ADC2.

Start the conversion for line ADC2 and return the result.

Returns
The result of the ADC conversion for line ADC2.

◆ adc_read_adc3()

uint16_t adc_read_adc3 ( void  )

Read ADC3.

Start the conversion for line ADC3 and return the result.

Returns
The result of the ADC conversion for line ADC3.

◆ adc_read_adc4()

uint16_t adc_read_adc4 ( void  )

Read ADC4.

Start the conversion for line ADC4 and return the result.

Returns
The result of the ADC conversion for line ADC4.
Contact