LCOV - code coverage report
Current view: top level - src/Def - Def.hpp (source / functions) Hit Total Coverage
Test: 90a1b9beff85a60dc6ebcea034a947a845e56960 Lines: 2 2 100.0 %
Date: 2019-11-30 15:53:32 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14-5-g4ff2ed6