REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
A REDAC Math block (M-Block) is represented by this class. More...
#include <mblock.h>


Public Types | |
enum class | TYPES : uint8_t { UNKNOWN = 0 , M_INT8_BLOCK = 1 , M_MUL4_BLOCK = 2 } |
enum class | SLOT : uint8_t { M0 = 0 , M1 = 1 } |
Public Member Functions | |
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 |
virtual metadata::eui_t | get_entity_eui () const =0 |
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) |
virtual bool | init () |
returns true in case of success | |
virtual void | reset (ResetAction action) |
virtual utils::status | write_to_hardware () |
returns true in case of success | |
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 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). | |
Public Attributes | |
const SLOT | slot |
MBlockHAL * | hardware |
Static Public Attributes | |
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 |
Additional Inherited Members | |
![]() | |
virtual utils::status | config_self_from_json (JsonObjectConst cfg)=0 |
Deserialize a new configuration for this entity from a JsonObject. | |
utils::status | config_children_from_json (JsonObjectConst &cfg) |
Deserialize a new configuration for all child entities from a JsonObject. | |
virtual void | config_self_to_json (JsonObject &cfg) |
Serialize the configuration of this entity to a JsonObject. | |
void | config_children_to_json (JsonObject &cfg) |
Serialize the configuration of the child entities of this entity to a JsonObject. | |
![]() | |
std::string | entity_id |
EntityClassifier | classifier |
Detailed Description
A REDAC Math block (M-Block) is represented by this class.
All variants of the M-Blocks are represented by instances of this class or a suitable subclass.
This base class provides convenient static functions to compute the correct index (for usage in the U and I block) for M block computing elements.
Member Enumeration Documentation
◆ SLOT
|
strong |
◆ TYPES
|
strong |
Constructor & Destructor Documentation
◆ MBlock()
Definition at line 32 of file mblock.cpp.
References CLASS_, and entities::Entity::classifier.
Member Function Documentation
◆ calibrate()
|
inlinevirtual |
Reimplemented in blocks::MIntBlock_V_1_1_X.
Definition at line 111 of file mblock.h.
Referenced by blocks::MIntBlock_V_1_1_X::calibrate(), blocks::MMulBlock::calibrate(), and carrier::Carrier::calibrate_mblock().
◆ from_entity_classifier()
|
static |
Definition at line 49 of file mblock.cpp.
References blocks::MIntBlock::from_entity_classifier(), blocks::MMulBlock::from_entity_classifier(), and entities::M_BLOCK.
◆ is_entity_type()
|
inline |
Definition at line 52 of file mblock.h.
References entities::Entity::is_entity_type().
◆ M0_INPUT() [1/2]
|
inlinestaticconstexpr |
M0 input signal specifier for hard-coded usage, like MBlock::M0_INPUT<3>().
◆ M0_INPUT() [2/2]
|
inlinestaticconstexpr |
◆ M0_OUTPUT() [1/2]
|
inlinestaticconstexpr |
M0 output signal specifier for hard-coded usage, like MBlock::M0_OUTPUT<3>().
◆ M0_OUTPUT() [2/2]
|
inlinestaticconstexpr |
◆ M1_INPUT() [1/2]
|
inlinestaticconstexpr |
M1 input signal specifier for hard-coded usage, like MBlock::M1_INPUT<3>().
◆ M1_INPUT() [2/2]
|
inlinestaticconstexpr |
◆ M1_OUTPUT() [1/2]
|
inlinestaticconstexpr |
M1 output signal specifier for hard-coded usage, like MBlock::M1_OUTPUT<3>().
◆ M1_OUTPUT() [2/2]
|
inlinestaticconstexpr |
◆ overload_flags_to_json()
FLASHMEM void blocks::MBlock::overload_flags_to_json | ( | JsonArray | msg_out | ) | const |
Definition at line 82 of file mblock.cpp.
Referenced by carrier::Carrier::user_get_overload_status().
◆ SLOT_INPUT_IDX_RANGE()
|
inlinestaticconstexpr |
◆ SLOT_OUTPUT_IDX_RANGE()
|
inlinestaticconstexpr |
Definition at line 62 of file mblock.h.
Referenced by carrier::Carrier::calibrate_mblock().
◆ slot_to_global_io_index()
FLASHMEM uint8_t blocks::MBlock::slot_to_global_io_index | ( | uint8_t | local | ) | const |
Definition at line 37 of file mblock.cpp.
Referenced by carrier::Carrier::calibrate_mblock().
Member Data Documentation
◆ CLASS_
|
staticconstexpr |
Definition at line 46 of file mblock.h.
Referenced by MBlock(), and carrier::Carrier::user_get_overload_status().
◆ hardware
◆ M0_IDX
|
staticconstexpr |
◆ M1_IDX
|
staticconstexpr |
◆ slot
The documentation for this class was generated from the following files:
- lib/platform-lucidac/src/block/mblock.h
- lib/platform-lucidac/src/block/mblock.cpp