3-phase PV router
Loading...
Searching...
No Matches
PinList< MaxPins > Struct Template Reference

Wrapper for a list of pins, constructible from variadic arguments. More...

#include <config_types.h>

Inheritance diagram for PinList< MaxPins >:

Public Member Functions

constexpr PinList ()
 Default constructor. Initializes with zero pins.
 
template<typename... Args>
constexpr PinList (Args... args)
 Variadic constructor. Initializes with provided pins.
 
constexpr PinList (uint16_t bitmask)
 Constructor from local-only bitmask.
 
constexpr PinList (uint32_t bitmask)
 Constructor from combined bitmask. Extracts both local and remote pins.
 
constexpr uint16_t toLocalBitmask () const
 Converts the pin list to a bitmask for local/physical pins only.
 
constexpr uint8_t toRemoteBitmask () const
 Converts the pin list to a bitmask for remote loads only.
 

Public Attributes

uint8_t count
 
uint8_t pins [MaxPins]
 

Detailed Description

template<uint8_t MaxPins>
struct PinList< MaxPins >

Wrapper for a list of pins, constructible from variadic arguments.

Template Parameters
MaxPinsMaximum number of pins supported.

Supports both physical pins (0-127) and virtual pins for remote loads (128+). Virtual pins are created using REMOTE_LOAD(n) which returns REMOTE_PIN_BASE + n.

Definition at line 157 of file config_types.h.

Constructor & Destructor Documentation

◆ PinList() [1/4]

template<uint8_t MaxPins>
PinList< MaxPins >::PinList ( )
inlineconstexpr

Default constructor. Initializes with zero pins.

Definition at line 165 of file config_types.h.

◆ PinList() [2/4]

template<uint8_t MaxPins>
PinList< MaxPins >::PinList ( uint16_t bitmask)
inlineconstexpr

Constructor from local-only bitmask.

Parameters
bitmaskLocal pin bitmask (bits 0-15 correspond to physical pins).

Definition at line 172 of file config_types.h.

◆ PinList() [3/4]

template<uint8_t MaxPins>
PinList< MaxPins >::PinList ( uint32_t bitmask)
inlineconstexpr

Constructor from combined bitmask. Extracts both local and remote pins.

Parameters
bitmaskCombined bitmask value:
  • Lower 16 bits (0-15): local/physical pin bitmask
  • Upper 16 bits (16-31): remote load bitmask (bit 16 = remote 0, etc.)

Definition at line 190 of file config_types.h.

◆ PinList() [4/4]

template<uint8_t MaxPins>
template<typename... Args>
PinList< MaxPins >::PinList ( Args... args)
inlineconstexpr

Variadic constructor. Initializes with provided pins.

Parameters
argsList of pins (can include both physical and virtual pins).

Definition at line 216 of file config_types.h.

Member Function Documentation

◆ toLocalBitmask()

template<uint8_t MaxPins>
uint16_t PinList< MaxPins >::toLocalBitmask ( ) const
inlineconstexpr

Converts the pin list to a bitmask for local/physical pins only.

Returns
Bitmask with bits set for pins < REMOTE_PIN_BASE.

Definition at line 223 of file config_types.h.

Here is the caller graph for this function:

◆ toRemoteBitmask()

template<uint8_t MaxPins>
uint8_t PinList< MaxPins >::toRemoteBitmask ( ) const
inlineconstexpr

Converts the pin list to a bitmask for remote loads only.

Returns
Bitmask where bit n is set if remote load n is in the list. (Pins >= REMOTE_PIN_BASE are converted to indices 0-7)

Definition at line 241 of file config_types.h.

Here is the caller graph for this function:

Member Data Documentation

◆ count

template<uint8_t MaxPins>
uint8_t PinList< MaxPins >::count

Definition at line 160 of file config_types.h.

◆ pins

template<uint8_t MaxPins>
uint8_t PinList< MaxPins >::pins[MaxPins]

Definition at line 159 of file config_types.h.


The documentation for this struct was generated from the following file: