GaIA BIOS Library
Loading...
Searching...
No Matches
gwa_adc.h File Reference

ADC Driver. More...

#include <stdint.h>

Macros

#define ADC_INPUT   1
 ADC used for analog inputs and PT1000 input.
#define ADC_VERSION   3
 ADC used for hardware revision detection.
#define ADC_CH_ANALOG0   0
 ADC channel for analog input 0.
#define ADC_CH_ANALOG1   1
 ADC channel for analog input 1.
#define ADC_CH_ANALOG2   2
 ADC channel for analog input 2.
#define ADC_CH_ANALOG3   3
 ADC channel for analog input 3.
#define ADC_CH_PT1000   4
 ADC channel for PT1000 input.
#define ADC_CH_ANALOG4   5
 ADC channel for analog input 4.
#define ADC_CH_ANALOG5   6
 ADC channel for analog input 5.
#define ADC_CH_ANALOG6   7
 ADC channel for analog input 6.
#define ADC_CH_ANALOG7   8
 ADC channel for analog input 7.
#define ADC_CH_VERSION   9
 ADC channel for hardware revision detection.

Functions

void gwa_adc_init (uint8_t adc)
 Initializes the ADC driver.
void gwa_adc_start (uint8_t adc)
 Starts the ADC peripheral.
void gwa_adc_stop (uint8_t adc)
 Stops the ADC peripheral.
uint32_t gwa_adc_read (uint8_t adc, uint8_t ch)
 Reads data from the specified channel of the specified ADC.

Detailed Description

ADC Driver.

Author
Tecnologix, 2016

Function Documentation

◆ gwa_adc_init()

void gwa_adc_init ( uint8_t adc)

Initializes the ADC driver.

Parameters
adcthe ADC to be initialized. Values can be ADC_INPUT or ADC_VERSION.

◆ gwa_adc_read()

uint32_t gwa_adc_read ( uint8_t adc,
uint8_t ch )

Reads data from the specified channel of the specified ADC.

Parameters
adcthe ADC. Values can be ADC_INPUT or ADC_VERSION.
chthe ADC channel. Values can be ADC_CH_ANALOG0, ADC_CH_ANALOG1, ADC_CH_ANALOG2, ADC_CH_ANALOG3, ADC_CH_PT1000, ADC_CH_VERSION.
Returns
the ADC converted value.

◆ gwa_adc_start()

void gwa_adc_start ( uint8_t adc)

Starts the ADC peripheral.

Parameters
adcthe ADC to be started. Values can be ADC_INPUT or ADC_VERSION.

◆ gwa_adc_stop()

void gwa_adc_stop ( uint8_t adc)

Stops the ADC peripheral.

Parameters
adcthe ADC to be stopped. Values can be ADC_INPUT or ADC_VERSION.