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

#include <tblock.h>

Inheritance diagram for blocks::TBlock:
Collaboration diagram for blocks::TBlock:

Public Member Functions

 TBlock (TBlockHAL *hardware)
 
 TBlock ()
 
std::array< uint8_t, 8 > get_entity_eui () const override
 
void reset (entities::ResetAction action) override
 
virtual void reset_connections ()
 
status write_to_hardware () override
 returns true in case of success
 
utils::status connect (uint8_t src_sector, uint8_t dst_sector, uint8_t idx)
 
bool is_enabled () const
 
void set_enabled (bool enabled_=true)
 
utils::status config_self_from_json (JsonObjectConst cfg) override
 Deserialize a new configuration for this entity from a JsonObject.
 
void config_self_to_json (JsonObject &cfg) override
 Serialize the configuration of this entity to a JsonObject.
 
virtual ~TBlock ()
 
- 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)
 
virtual bool init ()
 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 TBlockfrom_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address)
 
static constexpr std::array< uint8_t, NUM_OF_INPUTS/4 > SIGNAL_IDX_RANGE ()
 

Static Public Attributes

static constexpr auto CLASS_ = entities::EntityClass::T_BLOCK
 
static constexpr uint8_t TYPE = 1
 
static constexpr uint8_t BLOCK_IDX = bus::U_BLOCK_IDX
 
static constexpr uint8_t NUM_OF_INPUTS = 96
 
static constexpr uint8_t NUM_OF_OUTPUTS = 96
 

Protected Attributes

TBlockHALhardware
 
- Protected Attributes inherited from entities::Entity
std::string entity_id
 
EntityClassifier classifier
 

Additional Inherited Members

- 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.
 

Detailed Description

Definition at line 121 of file tblock.h.

Constructor & Destructor Documentation

◆ TBlock() [1/2]

FLASHMEM TBlock::TBlock ( TBlockHAL * hardware)
explicit

Definition at line 49 of file tblock.cpp.

References CLASS_, and entities::Entity::classifier.

◆ TBlock() [2/2]

FLASHMEM TBlock::TBlock ( )

Definition at line 53 of file tblock.cpp.

Referenced by from_entity_classifier().

◆ ~TBlock()

virtual blocks::TBlock::~TBlock ( )
inlinevirtual

Definition at line 162 of file tblock.h.

Member Function Documentation

◆ config_self_from_json()

FLASHMEM utils::status TBlock::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 68 of file tblock.cpp.

References utils::status::success().

◆ config_self_to_json()

FLASHMEM void TBlock::config_self_to_json ( JsonObject & cfg)
overridevirtual

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 98 of file tblock.cpp.

◆ connect()

FLASHMEM status TBlock::connect ( uint8_t src_sector,
uint8_t dst_sector,
uint8_t idx )

Definition at line 106 of file tblock.cpp.

References blocks::Mux::from(), and utils::status::success().

◆ from_entity_classifier()

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

Definition at line 56 of file tblock.cpp.

References CLASS_, entities::Entity::classifier, TBlock(), and TYPE.

◆ get_entity_eui()

std::array< uint8_t, 8 > blocks::TBlock::get_entity_eui ( ) const
inlineoverridevirtual

Implements entities::Entity.

Definition at line 143 of file tblock.h.

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

◆ is_enabled()

FLASHMEM bool TBlock::is_enabled ( ) const

Definition at line 152 of file tblock.cpp.

◆ reset()

FLASHMEM void TBlock::reset ( entities::ResetAction action)
overridevirtual

◆ reset_connections()

FLASHMEM void TBlock::reset_connections ( )
virtual

Definition at line 127 of file tblock.cpp.

References blocks::Mux::A, blocks::Mux::B, blocks::Mux::C, and blocks::Mux::D.

Referenced by reset().

◆ set_enabled()

FLASHMEM void TBlock::set_enabled ( bool enabled_ = true)

Definition at line 154 of file tblock.cpp.

◆ SIGNAL_IDX_RANGE()

static constexpr std::array< uint8_t, NUM_OF_INPUTS/4 > blocks::TBlock::SIGNAL_IDX_RANGE ( )
inlinestaticconstexpr

Definition at line 135 of file tblock.h.

◆ write_to_hardware()

FLASHMEM status TBlock::write_to_hardware ( )
overridevirtual

Member Data Documentation

◆ BLOCK_IDX

uint8_t blocks::TBlock::BLOCK_IDX = bus::U_BLOCK_IDX
staticconstexpr

Definition at line 130 of file tblock.h.

◆ CLASS_

auto blocks::TBlock::CLASS_ = entities::EntityClass::T_BLOCK
staticconstexpr

Definition at line 124 of file tblock.h.

Referenced by from_entity_classifier(), and TBlock().

◆ hardware

TBlockHAL* blocks::TBlock::hardware
protected

Definition at line 146 of file tblock.h.

Referenced by get_entity_eui(), and write_to_hardware().

◆ NUM_OF_INPUTS

uint8_t blocks::TBlock::NUM_OF_INPUTS = 96
staticconstexpr

Definition at line 132 of file tblock.h.

◆ NUM_OF_OUTPUTS

uint8_t blocks::TBlock::NUM_OF_OUTPUTS = 96
staticconstexpr

Definition at line 133 of file tblock.h.

◆ TYPE

uint8_t blocks::TBlock::TYPE = 1
staticconstexpr

Definition at line 125 of file tblock.h.

Referenced by from_entity_classifier().


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