REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
#include <mblock_int.h>


Public Member Functions | |
MIntBlock (SLOT slot, MIntBlockHAL *hardware) | |
MIntBlock (SLOT slot) | |
metadata::eui_t | get_entity_eui () const override |
bool | init () override |
returns true in case of success | |
void | reset (entities::ResetAction action) override |
const std::array< float, 8 > & | get_ic_values () const |
float | get_ic_value (uint8_t idx) const |
bool | set_ic_values (float value) |
bool | set_ic_values (const std::array< float, 8 > &ic_values_) |
bool | set_ic_value (uint8_t idx, float value) |
void | reset_ic_values () |
const std::array< unsigned int, 8 > & | get_time_factors () const |
unsigned int | get_time_factor (uint8_t idx) const |
bool | set_time_factors (unsigned int k) |
bool | set_time_factors (const std::array< unsigned int, 8 > &time_factors_) |
bool | set_time_factor (uint8_t int_idx, unsigned int k) |
void | reset_time_factors () |
utils::status | write_to_hardware () override |
returns true in case of success | |
utils::status | config_self_from_json (JsonObjectConst cfg) override |
Deserialize a new configuration for this entity from a JsonObject. | |
![]() | |
bool | is_entity_type (TYPES type_) |
MBlock (SLOT slot, MBlockHAL *hardware) | |
uint8_t | slot_to_global_io_index (uint8_t local) const |
virtual bool | calibrate (platform::Cluster *cluster, carrier::Carrier *carrier) |
void | overload_flags_to_json (JsonArray msg_out) const |
![]() | |
FunctionBlock (std::string entity_id) | |
std::vector< Entity * > | get_child_entities () override |
Entity * | get_child_entity (const std::string &child_id) override |
![]() | |
Entity ()=default | |
Entity (std::string entityId) | |
const std::string & | get_entity_id () const |
void | rename_entity (const std::string entityId) |
EntityClassifier | get_entity_classifier () const |
EntityClass | get_entity_class () const |
uint8_t | get_entity_type () const |
Version | get_entity_version () const |
uint8_t | get_entity_variant () const |
bool | is_entity_class (EntityClass class_) const |
bool | is_entity_type (uint8_t type_) const |
bool | is_entity_version (Version version_) const |
bool | is_entity_variant (uint8_t variant_) const |
Entity * | resolve_child_entity (std::string paths[], size_t len) |
Entity * | resolve_child_entity (JsonArrayConstIterator begin, JsonArrayConstIterator end) |
Entity * | resolve_child_entity (JsonArrayConst path) |
utils::status | config_from_json (JsonObjectConst cfg) |
Deserialize a new configuration for this entity and all its children from a JsonObject. | |
void | config_to_json (JsonObject &cfg, bool recursive=true) |
Serialize the configuration for this entity to a JsonObject. | |
utils::status | user_set_config (JsonObjectConst msg_in, JsonObject &msg_out) |
utils::status | user_get_config (JsonObjectConst msg_in, JsonObject &msg_out) |
utils::status | user_reset_config (JsonObjectConst msg_in, JsonObject &msg_out) |
void | classifier_to_json (JsonObject &out) |
Provide recursive entity information in a tree. | |
Static Public Member Functions | |
static MIntBlock * | from_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address) |
static constexpr std::array< uint8_t, NUM_INTEGRATORS > | INTEGRATORS_INPUT_RANGE () |
static constexpr std::array< uint8_t, NUM_INTEGRATORS > | INTEGRATORS_OUTPUT_RANGE () |
![]() | |
static MBlock * | from_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address) |
static constexpr std::array< uint8_t, 8 > | SLOT_INPUT_IDX_RANGE () |
static constexpr std::array< uint8_t, 8 > | SLOT_OUTPUT_IDX_RANGE () |
template<int n> | |
static constexpr uint8_t | M0_INPUT () |
M0 input signal specifier for hard-coded usage, like MBlock::M0_INPUT<3>(). | |
static constexpr uint8_t | M0_INPUT (uint8_t idx) |
M0 input signal specifier for dynamic usage, like MBlock::M0_INPUT(variable). | |
template<int n> | |
static constexpr uint8_t | M0_OUTPUT () |
M0 output signal specifier for hard-coded usage, like MBlock::M0_OUTPUT<3>(). | |
static constexpr uint8_t | M0_OUTPUT (uint8_t idx) |
M0 output signal specifier for dynamic usage, like MBlock::M0_OUTPUT(variable). | |
template<int n> | |
static constexpr uint8_t | M1_INPUT () |
M1 input signal specifier for hard-coded usage, like MBlock::M1_INPUT<3>(). | |
static constexpr uint8_t | M1_INPUT (uint8_t idx) |
M1 input signal specifier for dynamic usage, like MBlock::M1_INPUT(variable). | |
template<int n> | |
static constexpr uint8_t | M1_OUTPUT () |
M1 output signal specifier for hard-coded usage, like MBlock::M1_OUTPUT<3>(). | |
static constexpr uint8_t | M1_OUTPUT (uint8_t idx) |
M1 output signal specifier for dynamic usage, like MBlock::M1_OUTPUT(variable). | |
Static Public Attributes | |
static constexpr auto | TYPE = MBlock::TYPES::M_INT8_BLOCK |
static constexpr uint8_t | NUM_INTEGRATORS = 8 |
static constexpr unsigned int | DEFAULT_TIME_FACTOR = 10000 |
![]() | |
static constexpr auto | CLASS_ = entities::EntityClass::M_BLOCK |
static constexpr uint8_t | M0_IDX = bus::M0_BLOCK_IDX |
static constexpr uint8_t | M1_IDX = bus::M1_BLOCK_IDX |
Protected Member Functions | |
utils::status | _config_elements_from_json (const JsonVariantConst &cfg) |
void | config_self_to_json (JsonObject &cfg) override |
Serialize the configuration of this entity to a JsonObject. | |
![]() | |
utils::status | config_children_from_json (JsonObjectConst &cfg) |
Deserialize a new configuration for all child entities from a JsonObject. | |
void | config_children_to_json (JsonObject &cfg) |
Serialize the configuration of the child entities of this entity to a JsonObject. | |
Protected Attributes | |
MIntBlockHAL * | hardware |
std::array< float, NUM_INTEGRATORS > | ic_values |
std::array< unsigned int, NUM_INTEGRATORS > | time_factors |
![]() | |
std::string | entity_id |
EntityClassifier | classifier |
Additional Inherited Members | |
![]() | |
enum class | TYPES : uint8_t { UNKNOWN = 0 , M_INT8_BLOCK = 1 , M_MUL4_BLOCK = 2 } |
enum class | SLOT : uint8_t { M0 = 0 , M1 = 1 } |
![]() | |
const SLOT | slot |
MBlockHAL * | hardware |
Detailed Description
Definition at line 84 of file mblock_int.h.
Constructor & Destructor Documentation
◆ MIntBlock() [1/2]
|
explicit |
Definition at line 26 of file mblock_int.cpp.
References entities::Entity::classifier, reset_ic_values(), reset_time_factors(), and TYPE.
◆ MIntBlock() [2/2]
|
inlineexplicit |
Definition at line 114 of file mblock_int.h.
Member Function Documentation
◆ _config_elements_from_json()
|
protected |
Definition at line 164 of file mblock_int.cpp.
References utils::status::success().
◆ config_self_from_json()
|
overridevirtual |
Deserialize a new configuration for this entity from a JsonObject.
Implementations shall not traverse to children,
- See also
- config_children_from_json() instead.
- Returns
- true in case of success, else false
Implements entities::Entity.
Definition at line 148 of file mblock_int.cpp.
References utils::status::success().
◆ config_self_to_json()
|
overrideprotectedvirtual |
Serialize the configuration of this entity to a JsonObject.
Implementations shall not traverse to children,
- See also
- config_children_to_json() instead.
Reimplemented from entities::Entity.
Definition at line 213 of file mblock_int.cpp.
◆ from_entity_classifier()
|
static |
Definition at line 223 of file mblock_int.cpp.
Referenced by blocks::MBlock::from_entity_classifier().
◆ get_entity_eui()
|
overridevirtual |
Implements entities::Entity.
Definition at line 20 of file mblock_int.cpp.
References blocks::FunctionBlockHAL::get_entity_eui(), and hardware.
◆ get_ic_value()
|
nodiscard |
Definition at line 43 of file mblock_int.cpp.
◆ get_ic_values()
|
nodiscard |
Definition at line 41 of file mblock_int.cpp.
◆ get_time_factor()
FLASHMEM unsigned int blocks::MIntBlock::get_time_factor | ( | uint8_t | idx | ) | const |
Definition at line 78 of file mblock_int.cpp.
◆ get_time_factors()
|
nodiscard |
Definition at line 74 of file mblock_int.cpp.
◆ init()
|
overridevirtual |
returns true in case of success
Reimplemented from entities::Entity.
Definition at line 33 of file mblock_int.cpp.
References entities::Entity::init().
◆ INTEGRATORS_INPUT_RANGE()
|
inlinestaticconstexpr |
Definition at line 95 of file mblock_int.h.
◆ INTEGRATORS_OUTPUT_RANGE()
|
inlinestaticconstexpr |
Definition at line 99 of file mblock_int.h.
◆ reset()
|
overridevirtual |
Reimplemented from entities::Entity.
Reimplemented in blocks::MIntBlock_V_1_1_X.
Definition at line 132 of file mblock_int.cpp.
References entities::ResetAction::CIRCUIT_RESET, mode::RealManualControl::enable(), entities::ResetAction::has(), entities::ResetAction::OVERLOAD_RESET, entities::Entity::reset(), and mode::RealManualControl::to_ic().
Referenced by blocks::MIntBlock_V_1_1_X::reset().
◆ reset_ic_values()
FLASHMEM void blocks::MIntBlock::reset_ic_values | ( | ) |
Definition at line 72 of file mblock_int.cpp.
Referenced by MIntBlock().
◆ reset_time_factors()
FLASHMEM void blocks::MIntBlock::reset_time_factors | ( | ) |
Definition at line 107 of file mblock_int.cpp.
Referenced by MIntBlock().
◆ set_ic_value()
FLASHMEM bool blocks::MIntBlock::set_ic_value | ( | uint8_t | idx, |
float | value ) |
Definition at line 63 of file mblock_int.cpp.
◆ set_ic_values() [1/2]
FLASHMEM bool blocks::MIntBlock::set_ic_values | ( | const std::array< float, 8 > & | ic_values_ | ) |
Definition at line 49 of file mblock_int.cpp.
◆ set_ic_values() [2/2]
FLASHMEM bool blocks::MIntBlock::set_ic_values | ( | float | value | ) |
Definition at line 56 of file mblock_int.cpp.
◆ set_time_factor()
FLASHMEM bool blocks::MIntBlock::set_time_factor | ( | uint8_t | int_idx, |
unsigned int | k ) |
Definition at line 98 of file mblock_int.cpp.
◆ set_time_factors() [1/2]
FLASHMEM bool blocks::MIntBlock::set_time_factors | ( | const std::array< unsigned int, 8 > & | time_factors_ | ) |
Definition at line 84 of file mblock_int.cpp.
◆ set_time_factors() [2/2]
FLASHMEM bool blocks::MIntBlock::set_time_factors | ( | unsigned int | k | ) |
Definition at line 91 of file mblock_int.cpp.
◆ write_to_hardware()
|
nodiscardoverridevirtual |
returns true in case of success
Reimplemented from entities::Entity.
Reimplemented in blocks::MIntBlock_V_1_1_X.
Definition at line 113 of file mblock_int.cpp.
References LOG, and utils::status::success().
Referenced by blocks::MIntBlock_V_1_1_X::write_to_hardware().
Member Data Documentation
◆ DEFAULT_TIME_FACTOR
|
staticconstexpr |
Definition at line 93 of file mblock_int.h.
◆ hardware
|
protected |
Definition at line 104 of file mblock_int.h.
Referenced by get_entity_eui().
◆ ic_values
|
protected |
Definition at line 106 of file mblock_int.h.
◆ NUM_INTEGRATORS
|
staticconstexpr |
Definition at line 92 of file mblock_int.h.
Referenced by blocks::MIntBlock_V_1_1_X::reset(), blocks::MIntBlockHAL_V_1_0_X::write_ic(), blocks::MIntBlockHAL_V_1_1_X::write_ic(), and blocks::MIntBlockHAL_V_1_1_X::write_time_factor_gain().
◆ time_factors
|
protected |
Definition at line 107 of file mblock_int.h.
◆ TYPE
|
staticconstexpr |
Definition at line 87 of file mblock_int.h.
Referenced by MIntBlock().
The documentation for this class was generated from the following files:
- lib/platform-lucidac/src/block/mblock_int.h
- lib/platform-lucidac/src/block/mblock_int.cpp