Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Def.hpp
Go to the documentation of this file.
1/* ✔ */
2
3#pragma once
4
5#include "Cable.hpp"
6#include "Channel.hpp"
9#include <AH/STL/limits>
10#include <Settings/NamespaceSettings.hpp>
11#include <stddef.h> // size_t
12#include <stdint.h> // uint8_t
13
15
16using AH::analog_t;
17using AH::NO_PIN;
18using AH::pin_t;
19using AH::PinList;
20
21using MappingFunction = analog_t (*)(analog_t);
22
23using AH::Array;
24using AH::Array2D;
25
27template <uint8_t NumRows, uint8_t NumCols>
28using AddressMatrix = Array2D<uint8_t, NumRows, NumCols>;
29
33 EncoderSwitchPinList(uint8_t A, uint8_t B, pin_t switchPin)
34 : A(A), B(B), switchPin(switchPin) {}
36 EncoderSwitchPinList(uint8_t A, uint8_t B)
37 : A(A), B(B), switchPin(NO_PIN) {}
38
39 uint8_t A;
40 uint8_t B;
41 pin_t switchPin;
42};
43
46 uint8_t A;
47 uint8_t B;
48};
49
51using setting_t = uint8_t;
54 (std::numeric_limits<setting_t>::max() >> 1) + 1;
55
56// Updatable types:
57struct Potentiometer {};
58struct MotorFader {};
59struct Display {};
60
63 int16_t x;
64 int16_t y;
65};
66
constexpr setting_t NoSetting
A special setting that indicates an unused or invalid setting.
Definition Def.hpp:53
analog_t(*)(analog_t) MappingFunction
Definition Def.hpp:21
Array2D< uint8_t, NumRows, NumCols > AddressMatrix
Definition Def.hpp:28
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class that reads and filters an analog input.
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
A struct for the pins of a rotary (quadrature) encoder without a switch.
Definition Def.hpp:45
uint8_t B
The pin connected to the B pin of the encoder.
Definition Def.hpp:47
uint8_t A
The pin connected to the A pin of the encoder.
Definition Def.hpp:46
A struct for the pins of a rotary (quadrature) encoder with a switch.
Definition Def.hpp:31
pin_t switchPin
The pin connected to the switch pin of the encoder.
Definition Def.hpp:41
uint8_t B
The pin connected to the B pin of the encoder.
Definition Def.hpp:40
uint8_t A
The pin connected to the A pin of the encoder.
Definition Def.hpp:39
EncoderSwitchPinList(uint8_t A, uint8_t B)
Constructor for encoders without a switch.
Definition Def.hpp:36
EncoderSwitchPinList(uint8_t A, uint8_t B, pin_t switchPin)
Constructor for encoders with a switch.
Definition Def.hpp:33
A simple struct representing a pixel with integer coordinates.
Definition Def.hpp:62
int16_t x
Definition Def.hpp:63
int16_t y
Definition Def.hpp:64