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