REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches

#include <mblock_int.h>

Inheritance diagram for blocks::MIntBlock:
Collaboration diagram for blocks::MIntBlock:

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.
 
- Public Member Functions inherited from blocks::MBlock
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
 
- Public Member Functions inherited from blocks::FunctionBlock
 FunctionBlock (std::string entity_id)
 
std::vector< Entity * > get_child_entities () override
 
Entityget_child_entity (const std::string &child_id) override
 
- Public Member Functions inherited from entities::Entity
 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
 
Entityresolve_child_entity (std::string paths[], size_t len)
 
Entityresolve_child_entity (JsonArrayConstIterator begin, JsonArrayConstIterator end)
 
Entityresolve_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 MIntBlockfrom_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address)
 
static constexpr std::array< uint8_t, NUM_INTEGRATORSINTEGRATORS_INPUT_RANGE ()
 
static constexpr std::array< uint8_t, NUM_INTEGRATORSINTEGRATORS_OUTPUT_RANGE ()
 
- Static Public Member Functions inherited from blocks::MBlock
static MBlockfrom_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 Public Attributes inherited from blocks::MBlock
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.
 
- Protected Member Functions inherited from entities::Entity
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

MIntBlockHALhardware
 
std::array< float, NUM_INTEGRATORSic_values
 
std::array< unsigned int, NUM_INTEGRATORStime_factors
 
- Protected Attributes inherited from entities::Entity
std::string entity_id
 
EntityClassifier classifier
 

Additional Inherited Members

- Public Types inherited from blocks::MBlock
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 Attributes inherited from blocks::MBlock
const SLOT slot
 
MBlockHALhardware
 

Detailed Description

Definition at line 84 of file mblock_int.h.

Constructor & Destructor Documentation

◆ MIntBlock() [1/2]

FLASHMEM blocks::MIntBlock::MIntBlock ( SLOT slot,
MIntBlockHAL * hardware )
explicit

◆ MIntBlock() [2/2]

blocks::MIntBlock::MIntBlock ( SLOT slot)
inlineexplicit

Definition at line 114 of file mblock_int.h.

Member Function Documentation

◆ _config_elements_from_json()

FLASHMEM utils::status blocks::MIntBlock::_config_elements_from_json ( const JsonVariantConst & cfg)
protected

Definition at line 164 of file mblock_int.cpp.

References utils::status::success().

◆ config_self_from_json()

FLASHMEM utils::status blocks::MIntBlock::config_self_from_json ( JsonObjectConst cfg)
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()

FLASHMEM void blocks::MIntBlock::config_self_to_json ( JsonObject & cfg)
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()

FLASHMEM blocks::MIntBlock * blocks::MIntBlock::from_entity_classifier ( entities::EntityClassifier classifier,
bus::addr_t block_address )
static

Definition at line 223 of file mblock_int.cpp.

Referenced by blocks::MBlock::from_entity_classifier().

◆ get_entity_eui()

FLASHMEM metadata::eui_t blocks::MIntBlock::get_entity_eui ( ) const
overridevirtual

Implements entities::Entity.

Definition at line 20 of file mblock_int.cpp.

References blocks::FunctionBlockHAL::get_entity_eui(), and hardware.

◆ get_ic_value()

FLASHMEM float blocks::MIntBlock::get_ic_value ( uint8_t idx) const
nodiscard

Definition at line 43 of file mblock_int.cpp.

◆ get_ic_values()

FLASHMEM const std::array< float, 8 > & blocks::MIntBlock::get_ic_values ( ) const
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()

FLASHMEM const std::array< unsigned int, 8 > & blocks::MIntBlock::get_time_factors ( ) const
nodiscard

Definition at line 74 of file mblock_int.cpp.

◆ init()

FLASHMEM bool blocks::MIntBlock::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()

static constexpr std::array< uint8_t, NUM_INTEGRATORS > blocks::MIntBlock::INTEGRATORS_INPUT_RANGE ( )
inlinestaticconstexpr

Definition at line 95 of file mblock_int.h.

◆ INTEGRATORS_OUTPUT_RANGE()

static constexpr std::array< uint8_t, NUM_INTEGRATORS > blocks::MIntBlock::INTEGRATORS_OUTPUT_RANGE ( )
inlinestaticconstexpr

Definition at line 99 of file mblock_int.h.

◆ 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()

FLASHMEM utils::status blocks::MIntBlock::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

unsigned int blocks::MIntBlock::DEFAULT_TIME_FACTOR = 10000
staticconstexpr

Definition at line 93 of file mblock_int.h.

◆ hardware

MIntBlockHAL* blocks::MIntBlock::hardware
protected

Definition at line 104 of file mblock_int.h.

Referenced by get_entity_eui().

◆ ic_values

std::array<float, NUM_INTEGRATORS> blocks::MIntBlock::ic_values
protected

Definition at line 106 of file mblock_int.h.

◆ NUM_INTEGRATORS

◆ time_factors

std::array<unsigned int, NUM_INTEGRATORS> blocks::MIntBlock::time_factors
protected

Definition at line 107 of file mblock_int.h.

◆ TYPE

auto blocks::MIntBlock::TYPE = MBlock::TYPES::M_INT8_BLOCK
staticconstexpr

Definition at line 87 of file mblock_int.h.

Referenced by MIntBlock().


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