LCOV - code coverage report
Current view: top level - src/Def - Def.hpp (source / functions) Hit Total Coverage
Test: 3a807a259ebe0769dd942f7f612dca5273937539 Lines: 2 2 100.0 %
Date: 2024-03-24 17:16:54 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* ✔ */
       2             : 
       3             : #pragma once
       4             : 
       5             : #include "Cable.hpp"
       6             : #include "Channel.hpp"
       7             : #include <AH/Containers/Array.hpp>
       8             : #include <AH/Hardware/Hardware-Types.hpp>
       9             : #include <AH/STL/limits>
      10             : #include <Settings/NamespaceSettings.hpp>
      11             : #include <stddef.h> // size_t
      12             : #include <stdint.h> // uint8_t
      13             : 
      14             : BEGIN_CS_NAMESPACE
      15             : 
      16             : using AH::analog_t;
      17             : using AH::NO_PIN;
      18             : using AH::pin_t;
      19             : using AH::PinList;
      20             : 
      21             : using MappingFunction = analog_t (*)(analog_t);
      22             : 
      23             : using AH::Array;
      24             : using AH::Array2D;
      25             : 
      26             : /// @todo   This should be an array of type MIDIAddress.
      27             : template <uint8_t NumRows, uint8_t NumCols>
      28             : using AddressMatrix = Array2D<uint8_t, NumRows, NumCols>;
      29             : 
      30             : /// A struct for the pins of a rotary (quadrature) encoder with a switch.
      31             : struct EncoderSwitchPinList {
      32             :     /// Constructor for encoders with a switch.
      33           2 :     EncoderSwitchPinList(uint8_t A, uint8_t B, pin_t switchPin)
      34           2 :         : A(A), B(B), switchPin(switchPin) {}
      35             :     /// Constructor for encoders without a switch.
      36             :     EncoderSwitchPinList(uint8_t A, uint8_t B)
      37             :         : A(A), B(B), switchPin(NO_PIN) {}
      38             : 
      39             :     uint8_t A;       ///< The pin connected to the A pin of the encoder.
      40             :     uint8_t B;       ///< The pin connected to the B pin of the encoder.
      41             :     pin_t switchPin; ///< The pin connected to the switch pin of the encoder.
      42             : };
      43             : 
      44             : /// A struct for the pins of a rotary (quadrature) encoder without a switch.
      45             : struct EncoderPinList {
      46             :     uint8_t A; ///< The pin connected to the A pin of the encoder.
      47             :     uint8_t B; ///< The pin connected to the B pin of the encoder.
      48             : };
      49             : 
      50             : /// The type used for Selector%s.
      51             : using setting_t = uint8_t;
      52             : /// A special setting that indicates an unused or invalid setting.
      53             : constexpr setting_t NoSetting =
      54             :     (std::numeric_limits<setting_t>::max() >> 1) + 1;
      55             : 
      56             : // Updatable types:
      57             : struct Potentiometer {};
      58             : struct MotorFader {};
      59             : struct Display {};
      60             : 
      61             : /// A simple struct representing a pixel with integer coordinates.
      62             : struct PixelLocation {
      63             :     int16_t x;
      64             :     int16_t y;
      65             : };
      66             : 
      67             : END_CS_NAMESPACE

Generated by: LCOV version 1.15