ADC
8.0
|
#include <Arduino.h>
#include <atomic.h>
Go to the source code of this file.
Classes | |
class | ADC_Module |
struct | ADC_Module::ADC_NLIST |
Dictionary with the differential pins as keys and the SC1A number as values. More... | |
struct | ADC_Module::ADC_Config |
Store the config of the adc. More... | |
Functions | |
constexpr ADC_ERROR | operator| (ADC_ERROR lhs, ADC_ERROR rhs) |
OR operator for ADC_ERRORs. | |
constexpr ADC_ERROR | operator& (ADC_ERROR lhs, ADC_ERROR rhs) |
AND operator for ADC_ERRORs. | |
ADC_ERROR | operator|= (volatile ADC_ERROR &lhs, ADC_ERROR rhs) |
|= operator for ADC_ERRORs, it changes the left hand side ADC_ERROR. | |
ADC_ERROR | operator&= (volatile ADC_ERROR &lhs, ADC_ERROR rhs) |
&= operator for ADC_ERRORs, it changes the left hand side ADC_ERROR. | |
#define ADC_PDB_CONFIG |
|
strong |
ADC conversion speed. Common set of options to select the ADC clock speed F_ADCK, which depends on F_BUS, except for the ADACK_X_Y options that are independent. This selection affects the sampling speed too. Note: the F_ADCK speed is not equal to the conversion speed; any measurement takes several F_ADCK cycles to complete including the sampling and conversion steps.
Enumerator | |
---|---|
VERY_LOW_SPEED |
is guaranteed to be the lowest possible speed within specs for resolutions less than 16 bits (higher than 1 MHz). |
LOW_SPEED |
is guaranteed to be the lowest possible speed within specs for all resolutions (higher than 2 MHz). |
MED_SPEED |
is always >= LOW_SPEED and <= HIGH_SPEED. |
HIGH_SPEED_16BITS |
is guaranteed to be the highest possible speed within specs for all resolutions (lower than or equal to 12 MHz). |
HIGH_SPEED |
is guaranteed to be the highest possible speed within specs for resolutions less than 16 bits (lower than or equal to 18 MHz), except for Teensy 3.6 (NOT 3.5), for which the maximum is 24 MHz. |
VERY_HIGH_SPEED |
may be out of specs |
ADACK_2_4 |
2.4 MHz asynchronous ADC clock (independent of the global clocks F_CPU or F_BUS) |
ADACK_4_0 |
4.0 MHz asynchronous ADC clock (independent of the global clocks F_CPU or F_BUS) |
ADACK_5_2 |
5.2 MHz asynchronous ADC clock (independent of the global clocks F_CPU or F_BUS) |
ADACK_6_2 |
6.2 MHz asynchronous ADC clock (independent of the global clocks F_CPU or F_BUS) |
|
strong |
ADC errors.
Use adc->printError() to print the errors (if any) in a human-readable form. Use adc->resetError() to reset them.
Enumerator | |
---|---|
OTHER |
Other error not considered below. |
CALIB |
Calibration error. |
WRONG_PIN |
A pin was selected that cannot be read by this ADC module. |
ANALOG_READ |
Error inside the analogRead method. |
ANALOG_DIFF_READ |
Error inside the analogReadDifferential method. |
CONT |
Continuous single-ended measurement error. |
CONT_DIFF |
Continuous differential measurement error. |
COMPARISON |
Error during the comparison. |
WRONG_ADC |
A non-existent ADC module was selected. |
SYNCH |
Error during a synchronized measurement. |
CLEAR |
No error. |
|
strong |
|
strong |
|
strong |
ADC sampling speed. It selects how many ADCK clock cycles to add.