See Quickstart guide for SAM ADC driver.
Driver for the Analog-to-digital Converter. This driver provides access to the main features of the ADC controller.
void adc_disable_all_channel |
( |
Adc * |
p_adc | ) |
|
Disable all ADC channel.
- Parameters
-
p_adc | Pointer to an ADC instance. |
Disable the specified ADC channel.
- Parameters
-
p_adc | Pointer to an ADC instance. |
adc_ch | ADC channel number. |
void adc_disable_interrupt |
( |
Adc * |
p_adc, |
|
|
const uint32_t |
ul_source |
|
) |
| |
Disable ADC interrupts.
- Parameters
-
p_adc | Pointer to an ADC instance. |
ul_source | Interrupts to be disabled. |
void adc_enable_all_channel |
( |
Adc * |
p_adc | ) |
|
Enable all ADC channels.
- Parameters
-
p_adc | Pointer to an ADC instance. |
Enable the specified ADC channel.
- Parameters
-
p_adc | Pointer to an ADC instance. |
adc_ch | ADC channel number. |
Referenced by init_specific_board().
void adc_enable_interrupt |
( |
Adc * |
p_adc, |
|
|
const uint32_t |
ul_source |
|
) |
| |
Enable ADC interrupts.
- Parameters
-
p_adc | Pointer to an ADC instance. |
ul_source | Interrupts to be enabled. |
uint32_t adc_get_actual_adc_clock |
( |
const Adc * |
p_adc, |
|
|
const uint32_t |
ul_mck |
|
) |
| |
Return the actual ADC clock.
- Parameters
-
p_adc | Pointer to an ADC instance. |
ul_mck | Main clock of the device (in Hz). |
- Returns
- The actual ADC clock (in Hz).
uint32_t adc_get_channel_status |
( |
const Adc * |
p_adc, |
|
|
const enum adc_channel_num_t |
adc_ch |
|
) |
| |
Read the ADC channel status.
- Parameters
-
p_adc | Pointer to an ADC instance. |
adc_ch | ADC channel number. |
- Return values
-
1 | if channel is enabled. |
0 | if channel is disabled. |
uint32_t adc_get_channel_value |
( |
const Adc * |
p_adc, |
|
|
const enum adc_channel_num_t |
adc_ch |
|
) |
| |
Read the ADC result data of the specified channel.
- Parameters
-
p_adc | Pointer to an ADC instance. |
adc_ch | ADC channel number. |
- Returns
- ADC value of the specified channel.
uint32_t adc_get_interrupt_mask |
( |
const Adc * |
p_adc | ) |
|
Read ADC interrupt mask.
- Parameters
-
p_adc | Pointer to an ADC instance. |
- Returns
- The interrupt mask value.
uint32_t adc_get_latest_value |
( |
const Adc * |
p_adc | ) |
|
Read the last ADC result data.
- Parameters
-
p_adc | Pointer to an ADC instance. |
- Returns
- ADC latest value.
Pdc* adc_get_pdc_base |
( |
const Adc * |
p_adc | ) |
|
Get PDC registers base address.
- Parameters
-
p_adc | Pointer to an ADC instance. |
- Returns
- ADC PDC register base address.
References UNUSED.
void adc_reset |
( |
Adc * |
p_adc | ) |
|
Reset ADC.
- Parameters
-
p_adc | Pointer to an ADC instance. |
Configure the conversion resolution.
- Parameters
-
p_adc | Pointer to an ADC instance. |
resolution | ADC resolution. |
References ADC_10_BITS, and ADC_12_BITS.
void adc_start |
( |
Adc * |
p_adc | ) |
|
Start analog-to-digital conversion.
- Note
- If one of the hardware event is selected as ADC trigger, this function can NOT start analog to digital conversion.
- Parameters
-
p_adc | Pointer to an ADC instance. |