#include <types.h>
Go to the source code of this file.
Data Structures | |
struct | HAL_AdcParams_t |
adc structure of parameters More... | |
Defines | |
#define | RESOLUTION_8_BIT 0 |
adc resolution | |
#define | RESOLUTION_10_BIT 1 |
Enumerations | |
enum | HAL_AdcVoltageReference_t { AREF = (0 << 6), AVCC = (1 << 6), INTERNAL_1d1V = (2 << 6), INTERNAL_2d56V = (3 << 6) } |
adc sample rate adc voltage reference More... | |
Functions | |
int | HAL_OpenAdc (HAL_AdcParams_t *param) |
channel number. Note for avr: If 10x gain is used, 8 bit resolution can be expected. If 200x gain is used, 7 bit resolution can be expected. If the user wants to perform a quick polarity check of the result, it is sufficient to read the MSB of the result. If the bit is one, the result is negative, and if this bit is zero, the result is positive. To reach the given accuracy, 10x or 200x Gain should not be used for operating voltage below 2.7V. Opens the ADC to make the measurement on the ADC channel. | |
int | HAL_ReadAdc (HAL_AdcChannelNumber_t channel) |
Starts ADC with the parameters defined in HAL_OpenAdc. | |
int | HAL_CloseAdc (void) |
Closes the ADC. |
Copyright (c) 2008 , Atmel Corporation. All rights reserved. Licensed under Atmel's Limited License Agreement (BitCloudTM).
Definition in file adc.h.
adc sample rate adc voltage reference
int HAL_OpenAdc | ( | HAL_AdcParams_t * | param | ) |
channel number.
Note for avr: If 10x gain is used, 8 bit resolution can be expected.
If 200x gain is used, 7 bit resolution can be expected.
If the user wants to perform a quick polarity check of the result,
it is sufficient to read the MSB of the result. If the bit is one,
the result is negative, and if this bit is zero, the result is positive.
To reach the given accuracy, 10x or 200x Gain should not be used
for operating voltage below 2.7V. Opens the ADC to make the measurement on the ADC channel.
[in] | param | - address of HAL_AdcParams_t structure. fields of structure set by user: resolution - conversion resolution. Must be chosen from: RESOLUTION_8_BIT RESOLUTION_10_BIT sampleRate - sample rate. Must be chosen from: for avr hardware platform ADC_77KSPS ADC_39KSPS ADC_19200SPS ADC_9600SPS ADC_4800SPS for arm hardware platform ADC_533KSPS ADC_429KSPS ADC_369KSPS ADC_250KSPS ADC_136KSPS ADC_68KSPS ADC_34KSPS bufferPointer - pointer to the application data buffer. Buffer cell is one byte for 8-bit resolution. Buffer cell is two bytes for 10-bit resolution. selectionsAmount - amount of samples (buffer cells). callback - pointer to the function that will notify about measurement completion. |
int HAL_ReadAdc | ( | HAL_AdcChannelNumber_t | channel | ) |
Starts ADC with the parameters defined in HAL_OpenAdc.
[in] | channel | - number of ADC channel. Must be chosen from: HAL_ADC_CHANNEL0 HAL_ADC_CHANNEL1 HAL_ADC_CHANNEL2 HAL_ADC_CHANNEL3 next four channels only for arm hardware platform HAL_ADC_CHANNEL4 HAL_ADC_CHANNEL5 HAL_ADC_CHANNEL6 HAL_ADC_CHANNEL7 next eight channels only for avr hardware platform HAL_ADC_DIFF_CHANNEL0 HAL_ADC_DIFF_CHANNEL1 HAL_ADC_DIFF_CHANNEL2 HAL_ADC_DIFF_CHANNEL3 HAL_ADC_DIFF_CHANNEL4 HAL_ADC_DIFF_CHANNEL5 HAL_ADC_DIFF_CHANNEL6 HAL_ADC_DIFF_CHANNEL7 |
int HAL_CloseAdc | ( | void | ) |
Closes the ADC.