Analog to Digital Converter is able to capture analog signals and transform them into digital format with 10-bit resolution.
#define ADC_MAX_VALUE 0x3FF |
Max value for ADC resolution.
bool adc_check_eoc |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
Check channel conversion status.
- Parameters
-
*adc | Base address of the ADC |
channel | channel to check (0 to 7) |
- Returns
- bool true if conversion not running false if conversion running
References Assert, and NULL.
Referenced by adc_get_value().
bool adc_check_ovr |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
Check channel conversion overrun error.
- Parameters
-
*adc | Base address of the ADC |
channel | channel to check (0 to 7) |
- Returns
- bool FAIL if an error occurred PASS if no error occurred
References Assert, FAIL, NULL, and PASS.
void adc_configure |
( |
volatile avr32_adc_t * |
adc | ) |
|
void adc_disable |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
void adc_enable |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
uint32_t adc_get_latest_value |
( |
volatile avr32_adc_t * |
adc | ) |
|
Wait for the next converted data and return its value.
- Parameters
-
*adc | Base address of the ADC |
- Returns
- The latest converted value (unsigned long)
References Assert, and NULL.
bool adc_get_status |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
Get channel 0 to 7 status.
- Parameters
-
*adc | Base address of the ADC |
channel | channel to handle (0 to 7) |
- Returns
- bool true if channel is enabled false if channel is disabled
References Assert, and NULL.
Referenced by adc_disable().
uint32_t adc_get_value |
( |
volatile avr32_adc_t * |
adc, |
|
|
uint16_t |
channel |
|
) |
| |
void adc_start |
( |
volatile avr32_adc_t * |
adc | ) |
|