Control Surface pin-t-adl
MIDI Control Surface library for Arduino
Def.hpp
Go to the documentation of this file.
1/* ✔ */
2
3#pragma once
4
5#include "Cable.hpp"
6#include "Channel.hpp"
10#include <AH/STL/limits>
11#include <Settings/NamespaceSettings.hpp>
12#include <stddef.h> // size_t
13#include <stdint.h> // uint8_t
14
16
18using AH::analog_t;
19using AH::NO_PIN;
20using AH::pin_t;
21using AH::PinList;
22
24
25using AH::Array;
26using AH::Array2D;
27
29template <uint8_t NumRows, uint8_t NumCols>
30using AddressMatrix = Array2D<uint8_t, NumRows, NumCols>;
31
36 : A(A), B(B), switchPin(switchPin) {}
38 EncoderSwitchPinList(uint8_t A, uint8_t B)
39 : A(A), B(B), switchPin(NO_PIN) {}
40
41 uint8_t A;
42 uint8_t B;
44};
45
48 uint8_t A;
49 uint8_t B;
50};
51
53using setting_t = uint8_t;
57
58// Updatable types:
59struct Potentiometer {};
60struct MotorFader {};
61struct Display {};
62
65 int16_t x;
66 int16_t y;
67};
68
AH::function_traits< decltype(::digitalWrite)>::argument_t< 0 > ArduinoPin_t
constexpr setting_t NO_SETTING
A special setting that indicates an unused or invalid setting.
Definition: Def.hpp:55
uint8_t setting_t
The type used for Selectors.
Definition: Def.hpp:53
uint8_t B
The pin connected to the B pin of the encoder.
Definition: Def.hpp:49
analog_t(*)(analog_t) MappingFunction
Definition: Def.hpp:23
Array2D< uint8_t, NumRows, NumCols > AddressMatrix
Definition: Def.hpp:30
uint8_t A
The pin connected to the A pin of the encoder.
Definition: Def.hpp:48
int16_t x
Definition: Def.hpp:65
int16_t y
Definition: Def.hpp:66
Definition: Def.hpp:61
A struct for the pins of a rotary (quadrature) encoder without a switch.
Definition: Def.hpp:47
A simple struct representing a pixel with integer coordinates.
Definition: Def.hpp:64
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
constexpr auto max(const T &a, const U &b) -> decltype(a< b ? b :a)
Return the larger of two numbers/objects.
Definition: MinMaxFix.hpp:22
uint16_t analog_t
The type returned from analogRead and similar functions.
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
An array wrapper for easy copying, comparing, and iterating.
Definition: Array.hpp:36
Type for storing pin numbers of Extended Input/Output elements.
A struct for the pins of a rotary (quadrature) encoder with a switch.
Definition: Def.hpp:33
pin_t switchPin
The pin connected to the switch pin of the encoder.
Definition: Def.hpp:43
uint8_t B
The pin connected to the B pin of the encoder.
Definition: Def.hpp:42
uint8_t A
The pin connected to the A pin of the encoder.
Definition: Def.hpp:41
EncoderSwitchPinList(uint8_t A, uint8_t B)
Constructor for encoders without a switch.
Definition: Def.hpp:38
EncoderSwitchPinList(uint8_t A, uint8_t B, pin_t switchPin)
Constructor for encoders with a switch.
Definition: Def.hpp:35