ADC
8.0
Analog to Digital Conversor library for the Teensy microprocessor
|
#include <Arduino.h>
Go to the source code of this file.
Classes | |
struct | ADC_REGS_t |
Namespaces | |
ADC_Error | |
Handle ADC errors. | |
Macros | |
#define | ADC_TEENSY_3_6 |
#define | ADC_NUM_ADCS (2) |
#define | ADC_USE_DMA (1) |
#define | ADC_USE_PGA (0) |
#define | ADC_USE_PDB (1) |
#define | ADC_USE_INTERNAL_VREF (1) |
#define | ADC_MAX_PIN (67) |
#define | ADC_DIFF_PAIRS (1) |
#define | ADC0_START (*(ADC_REGS_t *)0x4003B000) |
#define | ADC1_START (*(ADC_REGS_t *)0x400BB000) |
#define | ADC_MHz (1000000) |
#define | ADC_MIN_FREQ (1*ADC_MHz) |
#define | ADC_MAX_FREQ (24*ADC_MHz) |
#define | ADC_MIN_FREQ_16BITS (2*ADC_MHz) |
#define | ADC_MAX_FREQ_16BITS (12*ADC_MHz) |
#define | ADC_LIB_CFG1_ADIV(n) (((n) & 0x03) << 5) |
#define | ADC_LIB_CFG1_ADICLK(n) (((n) & 0x03) << 0) |
#define | ADC_F_BUS F_BUS |
#define | ADC_SC1A_CHANNELS (0x1F) |
#define | ADC_SC1A_PIN_INVALID (0x1F) |
#define | ADC_SC1A_PIN_MUX (0x80) |
#define | ADC_SC1A_PIN_DIFF (0x40) |
#define | ADC_SC1A_PIN_PGA (0x80) |
#define | ADC_ERROR_DIFF_VALUE (-70000) |
#define | ADC_ERROR_VALUE ADC_ERROR_DIFF_VALUE |
Functions | |
constexpr uint32_t | get_CFG_VERY_LOW_SPEED (uint32_t f_adc_clock) |
constexpr uint32_t | get_CFG_LOW_SPEED (uint32_t f_adc_clock) |
constexpr uint32_t | get_CFG_HI_SPEED_16_BITS (uint32_t f_adc_clock) |
constexpr uint32_t | get_CFG_MEDIUM_SPEED (uint32_t f_adc_clock) |
constexpr uint32_t | get_CFG_HIGH_SPEED (uint32_t f_adc_clock) |
constexpr uint32_t | get_CFG_VERY_HIGH_SPEED (uint32_t f_adc_clock) |
constexpr ADC_ERROR | ADC_Error::operator| (ADC_ERROR lhs, ADC_ERROR rhs) |
OR operator for ADC_ERRORs. | |
constexpr ADC_ERROR | ADC_Error::operator& (ADC_ERROR lhs, ADC_ERROR rhs) |
AND operator for ADC_ERRORs. | |
ADC_ERROR | ADC_Error::operator|= (volatile ADC_ERROR &lhs, ADC_ERROR rhs) |
|= operator for ADC_ERRORs, it changes the left hand side ADC_ERROR. | |
ADC_ERROR | ADC_Error::operator&= (volatile ADC_ERROR &lhs, ADC_ERROR rhs) |
&= operator for ADC_ERRORs, it changes the left hand side ADC_ERROR. | |
void | ADC_Error::resetError (volatile ADC_ERROR &fail_flag) |
Resets all errors from the ADC, if any. | |
|
strong |
ADC conversion speed. Common set of options to select the ADC clock speed F_ADCK, which depends on ADC_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. |
LOW_SPEED | is guaranteed to be the lowest possible speed within specs for all resolutions. |
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. |
HIGH_SPEED | is guaranteed to be the highest possible speed within specs for resolutions less than 16 bits. |
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 |
|
strong |
|
strong |
ADC sampling speed. It selects how many ADCK clock cycles to add.