This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
ADCConfig.hpp
Go to the documentation of this file.
1 #pragma once
2 
11 #include <Arduino.h>
12 
13 #if defined(ADC_RESOLUTION)
14 #define HAS_ANALOG_READ_RESOLUTION 1
15 
16 // Teensy
17 //------------------------------------------------------------------------------
18 #elif defined(TEENSYDUINO) && !defined(DOXYGEN)
19 
20 #if defined(__AVR__) // Teensy 2.x
21 #define ADC_RESOLUTION 10
22 #define HAS_ANALOG_READ_RESOLUTION 0
23 
24 #elif defined(__MK20DX128__) // Teensy 3.0
25 #define ADC_RESOLUTION 13
26 #define HAS_ANALOG_READ_RESOLUTION 1
27 
28 #elif defined(__MK20DX256__) // Teensy 3.1/3.2
29 #define ADC_RESOLUTION 13
30 #define HAS_ANALOG_READ_RESOLUTION 1
31 
32 #elif defined(__MKL26Z64__) // Teensy LC
33 #define ADC_RESOLUTION 12
34 #define HAS_ANALOG_READ_RESOLUTION 1
35 
36 #elif defined(__MK64FX512__) // Teensy 3.5
37 #define ADC_RESOLUTION 13
38 #define HAS_ANALOG_READ_RESOLUTION 1
39 
40 #elif defined(__MK66FX1M0__) // Teensy 3.6
41 #define ADC_RESOLUTION 13
42 #define HAS_ANALOG_READ_RESOLUTION 1
43 
44 #elif defined(__IMXRT1062__) || defined(__IMXRT1052__) // Teensy 4.0
45 #define ADC_RESOLUTION 12
46 #define HAS_ANALOG_READ_RESOLUTION 1
47 
48 #else
49 #warning "Unknown Teensy board, please open an issue on GitHub" \
50  "https://github.com/tttapa/Control-Surface"
51 #endif
52 
53 // ESP32
54 //------------------------------------------------------------------------------
55 #elif defined(ESP32)
56 
57 #define ADC_RESOLUTION 12
58 #define HAS_ANALOG_READ_RESOLUTION 1
59 
60 // Unknown/Default
61 //------------------------------------------------------------------------------
62 #else
63 #define ADC_RESOLUTION 10
65 #define HAS_ANALOG_READ_RESOLUTION 0
67 
68 #endif