This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Settings.hpp
Go to the documentation of this file.
1 #ifndef SETTINGSWRAPPER_HPP
2 #error "Do not include this file directly, use the wrapper!"
3 #endif
4 
11 #include <Def/Frequency.hpp>
12 #include <Helpers/ADCConfig.hpp>
13 #include <limits.h> // CHAR_BIT
14 #include <stddef.h>
15 #include <stdint.h>
16 
18 
19 // ----------------------------- Debug Settings ----------------------------- //
20 // ========================================================================== //
21 
23 // #define DEBUG_OUT Serial
24 
25 // #define DEBUG_MIDI_PACKETS
26 
28 #define FATAL_ERRORS
29 
30 // ----------------------------- User Settings ------------------------------ //
31 // ========================================================================== //
32 
34 constexpr unsigned long defaultBaudRate = 115200;
35 
51 constexpr uint8_t ADC_BITS = ADC_RESOLUTION;
52 
62 constexpr uint8_t ANALOG_FILTER_SHIFT_FACTOR = 2;
63 
69 using ANALOG_FILTER_TYPE = uint16_t;
70 
72 constexpr unsigned long BUTTON_DEBOUNCE_TIME = 25; // milliseconds
73 
75 constexpr unsigned long LONG_PRESS_DELAY = 450; // milliseconds
76 
78 constexpr unsigned long LONG_PRESS_REPEAT_DELAY = 200; // milliseconds
79 
81 constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL = 1000; // microseconds
82 
85 constexpr unsigned long VU_PEAK_DECAY_TIME = 300; // milliseconds
86 
89 constexpr unsigned long VU_PEAK_HOLD_TIME = 400; // milliseconds
90 
93 constexpr bool VU_PEAK_SMOOTH_DECAY = true;
94 
96 constexpr uint8_t NOTE_VELOCITY_THRESHOLD = 1;
97 
99 #define IGNORE_SYSEX 0
100 
105 constexpr size_t SYSEX_BUFFER_SIZE = 128;
106 
108 constexpr unsigned long HAIRLESS_BAUD = 115200;
109 
111 constexpr uint8_t MAX_FPS = 60;
112 
113 constexpr static Frequency SPI_MAX_SPEED = 8_MHz;
114 
117 #define INDIVIDUAL_BUTTON_INVERT
118 
119 // ========================================================================== //
120 
NOTE_VELOCITY_THRESHOLD
constexpr uint8_t NOTE_VELOCITY_THRESHOLD
Determines when a note input should be interpreted as 'on'.
Definition: Settings.hpp:96
VU_PEAK_HOLD_TIME
constexpr unsigned long VU_PEAK_HOLD_TIME
The time in milliseconds that a VU meter display peak bar stays at the peak before decaying.
Definition: Settings.hpp:89
ANALOG_FILTER_TYPE
uint16_t ANALOG_FILTER_TYPE
The unsigned integer type to use for analog inputs during filtering.
Definition: Settings.hpp:69
ADC_BITS
constexpr uint8_t ADC_BITS
The bit depth to use for the ADC (Analog to Digital Converter).
Definition: Settings.hpp:51
FILTERED_INPUT_UPDATE_INTERVAL
constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL
The interval between updating filtered analog inputs, in microseconds.
Definition: Settings.hpp:81
ADC_RESOLUTION
#define ADC_RESOLUTION
The actual maximum resolution of the built-in ADC.
Definition: ADCConfig.hpp:64
BUTTON_DEBOUNCE_TIME
constexpr unsigned long BUTTON_DEBOUNCE_TIME
The debounce time for momentary push buttons in milliseconds.
Definition: Settings.hpp:72
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
Frequency.hpp
defaultBaudRate
constexpr unsigned long defaultBaudRate
The default baud rate for debug MIDI interfaces.
Definition: Settings.hpp:34
LONG_PRESS_REPEAT_DELAY
constexpr unsigned long LONG_PRESS_REPEAT_DELAY
The time between increments/decremnets during a long press.
Definition: Settings.hpp:78
ANALOG_FILTER_SHIFT_FACTOR
constexpr uint8_t ANALOG_FILTER_SHIFT_FACTOR
The factor for the analog filter: Difference equation: where .
Definition: Settings.hpp:62
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
SPI_MAX_SPEED
constexpr static Frequency SPI_MAX_SPEED
Definition: Settings.hpp:113
VU_PEAK_DECAY_TIME
constexpr unsigned long VU_PEAK_DECAY_TIME
The time in milliseconds it takes for the VU meter display peak bar to drop one unit (i....
Definition: Settings.hpp:85
MAX_FPS
constexpr uint8_t MAX_FPS
The maximum frame rate of the displays.
Definition: Settings.hpp:111
Frequency
Type-safe class for frequency values.
Definition: Frequency.hpp:8
SYSEX_BUFFER_SIZE
constexpr size_t SYSEX_BUFFER_SIZE
The length of the maximum System Exclusive message that can be received.
Definition: Settings.hpp:105
VU_PEAK_SMOOTH_DECAY
constexpr bool VU_PEAK_SMOOTH_DECAY
If set to true, the VU meter display peak bars will decay smoothly (i.e.
Definition: Settings.hpp:93
HAIRLESS_BAUD
constexpr unsigned long HAIRLESS_BAUD
The baud rate to use for Hairless MIDI.
Definition: Settings.hpp:108
LONG_PRESS_DELAY
constexpr unsigned long LONG_PRESS_DELAY
The time in milliseconds before a press is registered as a long press.
Definition: Settings.hpp:75
ADCConfig.hpp
This file contains the platform-specific ADC resolutions. By default, the library automatically selec...