3-phase PV router
Loading...
Searching...
No Matches
types.h File Reference

Some basics classes/types. More...

#include <Arduino.h>
#include "type_traits.hpp"
#include "constants.h"
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PayloadTx_struct< N, S >
 container for datalogging More...
 

Enumerations

enum class  LoadStates : uint8_t { LOAD_OFF , LOAD_ON }
 
enum class  OutputModes : uint8_t { ANTI_FLICKER , NORMAL }
 
enum class  Polarities : uint8_t { NEGATIVE , POSITIVE }
 
enum class  RotationModes : uint8_t { OFF , AUTO , PIN }
 
enum class  SerialOutputType { HumanReadable , IoT , EmonCMS }
 

Functions

template<class... Ts>
constexpr uint8_t ival (Ts... Vs)
 
template<char... Vs>
constexpr integral_constant< uint8_t, ival(Vs...) > operator""_i ()
 
template<typename _Tp>
constexpr size_t size (const _Tp(&)[0]) noexcept
 Helper function for the special case of a 0-dimension C-array.
 
template<typename _Tp, size_t _Nm>
constexpr size_t size (const _Tp(&)[_Nm]) noexcept
 Helper function to retrieve the dimension of a C-array.
 

Variables

constexpr uint8_t loadStateMask { 0x7FU }
 
constexpr uint8_t loadStateOnBit { (uint8_t)(~loadStateMask) }
 

Detailed Description

Some basics classes/types.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
0.1
Date
2023-02-09

Definition in file types.h.

Enumeration Type Documentation

◆ LoadStates

enum class LoadStates : uint8_t
strong

Load state (for use if loads are active high (Rev 2 PCB))

Enumerator
LOAD_OFF 

load is OFF

LOAD_ON 

load is ON

Definition at line 48 of file types.h.

◆ OutputModes

enum class OutputModes : uint8_t
strong

Output modes

Enumerator
ANTI_FLICKER 

Anti-flicker mode

NORMAL 

Normal mode

Definition at line 41 of file types.h.

◆ Polarities

enum class Polarities : uint8_t
strong

Polarities

Enumerator
NEGATIVE 

polarity is negative

POSITIVE 

polarity is positive

Definition at line 34 of file types.h.

◆ RotationModes

enum class RotationModes : uint8_t
strong

Rotation modes

Enumerator
OFF 

Off

AUTO 

Once a day

PIN 

Pin triggered

Definition at line 59 of file types.h.

◆ SerialOutputType

enum class SerialOutputType
strong

Enum for serial output types

Enumerator
HumanReadable 

Human-readable output for commissioning

IoT 

Output for HomeAssistant or similar

EmonCMS 

Output in EmonCMS format

Definition at line 26 of file types.h.

Function Documentation

◆ ival()

template<class... Ts>
uint8_t ival ( Ts... Vs)
constexpr

Definition at line 103 of file types.h.

◆ operator""_i()

template<char... Vs>
integral_constant< uint8_t, ival(Vs...) > operator""_i ( )
constexpr

Definition at line 116 of file types.h.

◆ size() [1/2]

template<typename _Tp>
size_t size ( const _Tp(&)[0])
constexprnoexcept

Helper function for the special case of a 0-dimension C-array.

Template Parameters
_Tpelements type

Definition at line 97 of file types.h.

◆ size() [2/2]

template<typename _Tp, size_t _Nm>
size_t size ( const _Tp(&)[_Nm])
constexprnoexcept

Helper function to retrieve the dimension of a C-array.

Template Parameters
_Tpelements type
_Nmdimension

Definition at line 87 of file types.h.

Here is the caller graph for this function:

Variable Documentation

◆ loadStateMask

uint8_t loadStateMask { 0x7FU }
inlineconstexpr

bit mask for masking load state

Definition at line 55 of file types.h.

◆ loadStateOnBit

uint8_t loadStateOnBit { (uint8_t)(~loadStateMask) }
inlineconstexpr

bit mask for load state ON

Definition at line 56 of file types.h.