3-phase PV router
Loading...
Searching...
No Matches
TargetMap< NL, NR, D > Class Template Reference

What the target codes of config.h stand for, once the load map and the relays are known. More...

#include <utils_override.h>

Collaboration diagram for TargetMap< NL, NR, D >:

Public Member Functions

constexpr TargetMap (const uint8_t(&loadMap)[NL], const RelayEngine< NR, D > &relays, const bool relayDiversion)
 
constexpr uint32_t groupMask (const uint8_t code) const
 The pins of an ALL_...() code: local pins in the lower 16 bits, remote loads from bit 16.
 
template<uint8_t MaxPins>
constexpr uint16_t localBitmask (const PinList< MaxPins > &targets) const
 The local loads and relays that targets force, as a bitmask of pins.
 
constexpr uint8_t pinOf (const uint8_t code) const
 The pin that a single code stands for (any code but ALL_...()).
 
template<uint8_t MaxPins>
constexpr uint8_t remoteBitmask (const PinList< MaxPins > &targets) const
 The remote loads that targets force, as a bitmask (bit 0 = remote load 0).
 

Static Public Member Functions

static constexpr bool isGroup (const uint8_t code)
 Whether code is one of ALL_...(): several pins.
 

Private Member Functions

constexpr uint32_t relaysMask () const
 The pins of the relays, none without relay diversion.
 

Private Attributes

const uint8_t(& loadMap_ )[NL]
 
const bool relayDiversion_
 
const RelayEngine< NR, D > & relays_
 

Detailed Description

template<uint8_t NL, uint8_t NR, uint8_t D>
class TargetMap< NL, NR, D >

What the target codes of config.h stand for, once the load map and the relays are known.

LOAD(n) is the override pin of load n (overridePinOf()), LOCAL_LOAD(n) its local pin, RELAY(n) the pin of relay n, and ALL_...() every pin of their kind. Out of range, or RELAY() without relay diversion, a code gives pin 0, which no load or relay uses: validation.h reports it. Any other value is a pin already.

Template Parameters
NLNumber of loads in the load map.
NRNumber of relays.
DDuration of the sliding average of the relays (unused here).

Definition at line 137 of file utils_override.h.

Constructor & Destructor Documentation

◆ TargetMap()

template<uint8_t NL, uint8_t NR, uint8_t D>
TargetMap< NL, NR, D >::TargetMap ( const uint8_t(&) loadMap[NL],
const RelayEngine< NR, D > & relays,
const bool relayDiversion )
inlineconstexpr
Parameters
loadMapThe load map (physicalLoadPin).
relaysThe relays, as in config.h.
relayDiversionWhether the relays are in use (RELAY_DIVERSION).

Definition at line 145 of file utils_override.h.

Member Function Documentation

◆ groupMask()

template<uint8_t NL, uint8_t NR, uint8_t D>
uint32_t TargetMap< NL, NR, D >::groupMask ( const uint8_t code) const
inlineconstexpr

The pins of an ALL_...() code: local pins in the lower 16 bits, remote loads from bit 16.

Definition at line 178 of file utils_override.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGroup()

template<uint8_t NL, uint8_t NR, uint8_t D>
static constexpr bool TargetMap< NL, NR, D >::isGroup ( const uint8_t code)
inlinestaticconstexpr

Whether code is one of ALL_...(): several pins.

Definition at line 172 of file utils_override.h.

Here is the caller graph for this function:

◆ localBitmask()

template<uint8_t NL, uint8_t NR, uint8_t D>
template<uint8_t MaxPins>
uint16_t TargetMap< NL, NR, D >::localBitmask ( const PinList< MaxPins > & targets) const
inlineconstexpr

The local loads and relays that targets force, as a bitmask of pins.

Definition at line 199 of file utils_override.h.

Here is the call graph for this function:

◆ pinOf()

template<uint8_t NL, uint8_t NR, uint8_t D>
uint8_t TargetMap< NL, NR, D >::pinOf ( const uint8_t code) const
inlineconstexpr

The pin that a single code stands for (any code but ALL_...()).

Definition at line 151 of file utils_override.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relaysMask()

template<uint8_t NL, uint8_t NR, uint8_t D>
uint32_t TargetMap< NL, NR, D >::relaysMask ( ) const
inlineconstexprprivate

The pins of the relays, none without relay diversion.

Definition at line 225 of file utils_override.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remoteBitmask()

template<uint8_t NL, uint8_t NR, uint8_t D>
template<uint8_t MaxPins>
uint8_t TargetMap< NL, NR, D >::remoteBitmask ( const PinList< MaxPins > & targets) const
inlineconstexpr

The remote loads that targets force, as a bitmask (bit 0 = remote load 0).

Definition at line 212 of file utils_override.h.

Here is the call graph for this function:

Member Data Documentation

◆ loadMap_

template<uint8_t NL, uint8_t NR, uint8_t D>
const uint8_t(& TargetMap< NL, NR, D >::loadMap_)[NL]
private

the load map

Definition at line 238 of file utils_override.h.

◆ relayDiversion_

template<uint8_t NL, uint8_t NR, uint8_t D>
const bool TargetMap< NL, NR, D >::relayDiversion_
private

whether the relays are in use

Definition at line 240 of file utils_override.h.

◆ relays_

template<uint8_t NL, uint8_t NR, uint8_t D>
const RelayEngine< NR, D >& TargetMap< NL, NR, D >::relays_
private

the relays

Definition at line 239 of file utils_override.h.


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