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

#include <shblock.h>

Inheritance diagram for blocks::SHBlock:
Collaboration diagram for blocks::SHBlock:

Public Member Functions

 SHBlock ()
 
 SHBlock (SHBlockHAL *hardware)
 
metadata::eui_t get_entity_eui () const override
 
void set_state (SHState state_)
 Sets the state the SHBlock currently is in.
 
SHState get_state () const
 
void reset (entities::ResetAction action) override
 Resets all internal states. Block is left in inject mode afterwards. Requires write_to_hardware()
 
utils::status write_to_hardware () override
 Applies current class state to actually hardware.
 
void compensate_hardware_offsets (uint32_t track_time=10000, uint32_t inject_time=5000)
 
- 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 SHBlockfrom_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address)
 

Static Public Attributes

static constexpr auto CLASS_ = entities::EntityClass::SH_BLOCK
 
static constexpr uint8_t BLOCK_IDX = bus::SH_BLOCK_IDX
 

Protected Member Functions

utils::status config_self_from_json (JsonObjectConst cfg) override
 Deserialize a new configuration for this entity from 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.
 
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.
 

Protected Attributes

SHState state = SHState::INJECT
 
SHBlockHALhardware
 
- Protected Attributes inherited from entities::Entity
std::string entity_id
 
EntityClassifier classifier
 

Detailed Description

Definition at line 36 of file shblock.h.

Constructor & Destructor Documentation

◆ SHBlock() [1/2]

blocks::SHBlock::SHBlock ( )

◆ SHBlock() [2/2]

FLASHMEM blocks::SHBlock::SHBlock ( SHBlockHAL * hardware)
explicit

Definition at line 51 of file shblock.cpp.

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

Member Function Documentation

◆ compensate_hardware_offsets()

FLASHMEM void blocks::SHBlock::compensate_hardware_offsets ( uint32_t track_time = 10000,
uint32_t inject_time = 5000 )

Definition at line 69 of file shblock.cpp.

References blocks::INJECT.

◆ config_self_from_json()

FLASHMEM utils::status blocks::SHBlock::config_self_from_json ( JsonObjectConst cfg)
overrideprotectedvirtual

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 74 of file shblock.cpp.

References blocks::GAIN_EIGHT_TO_FIFTEEN, blocks::GAIN_ZERO_TO_SEVEN, blocks::INJECT, blocks::TRACK, and blocks::TRACK_AT_IC.

◆ from_entity_classifier()

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

Definition at line 96 of file shblock.cpp.

◆ get_entity_eui()

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

Implements entities::Entity.

Definition at line 16 of file shblock.cpp.

◆ get_state()

FLASHMEM blocks::SHState blocks::SHBlock::get_state ( ) const

Definition at line 57 of file shblock.cpp.

◆ reset()

FLASHMEM void blocks::SHBlock::reset ( entities::ResetAction action)
overridevirtual

Resets all internal states. Block is left in inject mode afterwards. Requires write_to_hardware()

Reimplemented from entities::Entity.

Definition at line 59 of file shblock.cpp.

References entities::ResetAction::CIRCUIT_RESET, entities::ResetAction::has(), and blocks::INJECT.

◆ set_state()

FLASHMEM void blocks::SHBlock::set_state ( SHState state_)

Sets the state the SHBlock currently is in.

Call write_to_hardware() to actually apply changes to hardware

Definition at line 55 of file shblock.cpp.

◆ write_to_hardware()

FLASHMEM utils::status blocks::SHBlock::write_to_hardware ( )
nodiscardoverridevirtual

Applies current class state to actually hardware.

Reimplemented from entities::Entity.

Definition at line 64 of file shblock.cpp.

References utils::status::success().

Member Data Documentation

◆ BLOCK_IDX

uint8_t blocks::SHBlock::BLOCK_IDX = bus::SH_BLOCK_IDX
staticconstexpr

Definition at line 40 of file shblock.h.

◆ CLASS_

auto blocks::SHBlock::CLASS_ = entities::EntityClass::SH_BLOCK
staticconstexpr

Definition at line 39 of file shblock.h.

Referenced by SHBlock().

◆ hardware

SHBlockHAL* blocks::SHBlock::hardware
protected

Definition at line 69 of file shblock.h.

◆ state

SHState blocks::SHBlock::state = SHState::INJECT
protected

Definition at line 65 of file shblock.h.


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