Analog to Digital Converter is able to capture analog signals and transform them into digital format with 10-bit resolution.
Macros | |
#define | ADC_MAX_VALUE 0x3FF |
Max value for ADC resolution. More... | |
Functions | |
bool | adc_check_eoc (volatile avr32_adc_t *adc, uint16_t channel) |
Check channel conversion status. More... | |
bool | adc_check_ovr (volatile avr32_adc_t *adc, uint16_t channel) |
Check channel conversion overrun error. More... | |
void | adc_configure (volatile avr32_adc_t *adc) |
Configure ADC. More... | |
void | adc_disable (volatile avr32_adc_t *adc, uint16_t channel) |
Disable channel. More... | |
void | adc_enable (volatile avr32_adc_t *adc, uint16_t channel) |
Enable channel. More... | |
uint32_t | adc_get_latest_value (volatile avr32_adc_t *adc) |
Wait for the next converted data and return its value. More... | |
bool | adc_get_status (volatile avr32_adc_t *adc, uint16_t channel) |
Get channel 0 to 7 status. More... | |
uint32_t | adc_get_value (volatile avr32_adc_t *adc, uint16_t channel) |
Get channel value. More... | |
void | adc_start (volatile avr32_adc_t *adc) |
Start analog to digital conversion. More... | |
#define ADC_MAX_VALUE 0x3FF |
Max value for ADC resolution.
Referenced by b_light_get_value().
bool adc_check_eoc | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
Check channel conversion status.
*adc | Base address of the ADC |
channel | channel to check (0 to 7) |
References Assert.
Referenced by adc_get_value().
bool adc_check_ovr | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
void adc_configure | ( | volatile avr32_adc_t * | adc | ) |
Configure ADC.
Mandatory to call. If not called, ADC channels will have side effects
*adc | Base address of the ADC |
References Assert.
Referenced by accelerometer_init().
void adc_disable | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
Disable channel.
*adc | Base address of the ADC |
channel | channel to disable (0 to 7) |
References adc_get_status(), and Assert.
Referenced by acc_get_value(), b_light_get_value(), and b_temperature_get_value().
void adc_enable | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
Enable channel.
*adc | Base address of the ADC |
channel | channel to enable (0 to 7) |
References Assert.
Referenced by acc_get_value(), b_light_get_value(), and b_temperature_get_value().
uint32_t adc_get_latest_value | ( | volatile avr32_adc_t * | adc | ) |
Wait for the next converted data and return its value.
*adc | Base address of the ADC |
References Assert.
bool adc_get_status | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
Get channel 0 to 7 status.
*adc | Base address of the ADC |
channel | channel to handle (0 to 7) |
References Assert.
Referenced by adc_disable().
uint32_t adc_get_value | ( | volatile avr32_adc_t * | adc, |
uint16_t | channel | ||
) |
Get channel value.
*adc | Base address of the ADC |
channel | channel to handle (0 to 7) |
References adc_check_eoc(), and Assert.
Referenced by acc_get_value(), b_light_get_value(), and b_temperature_get_value().
void adc_start | ( | volatile avr32_adc_t * | adc | ) |
Start analog to digital conversion.
*adc | Base address of the ADC |
References Assert.
Referenced by acc_get_value(), b_light_get_value(), and b_temperature_get_value().