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"
10#include <AH/STL/limits>
11#include <Settings/NamespaceSettings.hpp>
12#include <stddef.h> // size_t
13#include <stdint.h> // uint8_t
14
16
17using ::ArduinoPin_t;
18using AH::analog_t;
19using AH::NO_PIN;
20using AH::pin_t;
21using AH::PinList;
22
23using MappingFunction = analog_t (*)(analog_t);
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;
56 (std::numeric_limits<setting_t>::max() >> 1) + 1;
57
58// Updatable types:
59struct Potentiometer {};
60struct MotorFader {};
61struct Display {};
62
65 int16_t x;
66 int16_t y;
67};
68
constexpr setting_t NoSetting
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
analog_t(*)(analog_t) MappingFunction
Definition Def.hpp:23
Array2D< uint8_t, NumRows, NumCols > AddressMatrix
Definition Def.hpp:30
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
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:32
Type for storing pin numbers of Extended Input/Output elements.
A struct for the pins of a rotary (quadrature) encoder without a switch.
Definition Def.hpp:47
uint8_t B
The pin connected to the B pin of the encoder.
Definition Def.hpp:49
uint8_t A
The pin connected to the A pin of the encoder.
Definition Def.hpp:48
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
A simple struct representing a pixel with integer coordinates.
Definition Def.hpp:64
int16_t x
Definition Def.hpp:65
int16_t y
Definition Def.hpp:66