LCOV - code coverage report
Current view: top level - src/Hardware/ExtendedInputOutput - StaticSizeExtendedIOElement.hpp (source / functions) Hit Total Coverage
Test: 19d2efc7037c2e176feca44750a12594c76f466f Lines: 2 2 100.0 %
Date: 2019-11-24 14:50:27 Functions: 4 6 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* ✔ */
       2             : 
       3             : #pragma once
       4             : 
       5             : #include "ExtendedIOElement.hpp"
       6             : #include <Helpers/ArrayHelpers.hpp>
       7             : 
       8             : BEGIN_CS_NAMESPACE
       9             : 
      10             : /** 
      11             :  * @brief   A class for ExtendedIOElement%s with a fixed size.
      12             :  * 
      13             :  * This class is to make it easier to get an array of all pins of the element.
      14             :  */
      15             : template <uint16_t N>
      16           6 : class StaticSizeExtendedIOElement : public ExtendedIOElement {
      17             :   protected:
      18           6 :     StaticSizeExtendedIOElement() : ExtendedIOElement{N} {}
      19             : 
      20             :   public:
      21             :     /**
      22             :      * @brief   Get an array containing all pins of the element.
      23             :      */
      24             :     Array<pin_t, N> pins() const {
      25             :         return generateIncrementalArray<pin_t, N>(getStart());
      26             :     }
      27             : 
      28             :     static constexpr uint16_t length() { return N; }
      29             : };
      30             : 
      31             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-5-g4ff2ed6