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

Multplier Math Block (or: Math Multplier Block, hence MMulBlock). More...

#include <mblock_mul.h>

Inheritance diagram for blocks::MMulBlock:
Collaboration diagram for blocks::MMulBlock:

Public Member Functions

 MMulBlock (SLOT slot, MMulBlockHAL *hardware)
 
metadata::eui_t get_entity_eui () const override
 
 MMulBlock (bus::addr_t block_address, MMulBlockHAL *hardware)
 
bool init () override
 
utils::status write_to_hardware () override
 
bool calibrate (platform::Cluster *cluster, carrier::Carrier *carrier) override
 
void reset (entities::ResetAction action)
 
const std::array< MultiplierCalibration, NUM_MULTIPLIERS > & get_calibration () const
 
blocks::MultiplierCalibration get_calibration (uint8_t mul_idx) const
 
virtual utils::status write_calibration_to_hardware ()
 
 MBlock (SLOT slot, MBlockHAL *hardware)
 

Static Public Member Functions

static MMulBlockfrom_entity_classifier (entities::EntityClassifier classifier, bus::addr_t block_address)
 
static constexpr std::array< uint8_t, NUM_MULTIPLIERS *2 > MULTIPLIERS_INPUT_RANGE ()
 
static constexpr std::array< uint8_t, NUM_MULTIPLIERSMULTIPLIERS_OUTPUT_RANGE ()
 

Static Public Attributes

static constexpr auto TYPE = MBlock::TYPES::M_MUL4_BLOCK
 
static constexpr uint8_t NUM_MULTIPLIERS = 4
 

Protected Member Functions

utils::status config_self_from_json (JsonObjectConst cfg) override
 
utils::status _config_elements_from_json (const JsonVariantConst &cfg)
 
void config_self_to_json (JsonObject &cfg) override
 

Protected Attributes

MMulBlockHALhardware
 
std::array< MultiplierCalibration, NUM_MULTIPLIERScalibration {}
 

Detailed Description

Multplier Math Block (or: Math Multplier Block, hence MMulBlock).

Holds 4 analog multpliers. Furthermore, the first inputs are always mapped on the last four outputs as identity elements. Therefore this block can "implicitely" serve as a "Math identity block" (something which also exists for 8-to-8 identities, but purely passive). The identity part is not configurable. The multipliers itself are also not user-configurable. They are, however, can be calibrated digitally.

Definition at line 105 of file mblock_mul.h.

Constructor & Destructor Documentation

◆ MMulBlock() [1/2]

FLASHMEM blocks::MMulBlock::MMulBlock ( SLOT slot,
MMulBlockHAL * hardware )

Definition at line 126 of file mblock_mul.cpp.

References TYPE.

◆ MMulBlock() [2/2]

blocks::MMulBlock::MMulBlock ( bus::addr_t block_address,
MMulBlockHAL * hardware )

Member Function Documentation

◆ _config_elements_from_json()

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

Definition at line 41 of file mblock_mul.cpp.

References NUM_MULTIPLIERS, and utils::status::success().

◆ calibrate()

◆ config_self_from_json()

FLASHMEM utils::status blocks::MMulBlock::config_self_from_json ( JsonObjectConst cfg)
overrideprotected

Definition at line 25 of file mblock_mul.cpp.

References utils::status::success().

◆ config_self_to_json()

FLASHMEM void blocks::MMulBlock::config_self_to_json ( JsonObject & cfg)
overrideprotected

Definition at line 82 of file mblock_mul.cpp.

References NUM_MULTIPLIERS.

◆ from_entity_classifier()

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

Definition at line 95 of file mblock_mul.cpp.

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

◆ get_calibration() [1/2]

FLASHMEM const std::array< blocks::MultiplierCalibration, blocks::MMulBlock::NUM_MULTIPLIERS > & blocks::MMulBlock::get_calibration ( ) const
nodiscard

Definition at line 306 of file mblock_mul.cpp.

◆ get_calibration() [2/2]

FLASHMEM blocks::MultiplierCalibration blocks::MMulBlock::get_calibration ( uint8_t mul_idx) const
nodiscard

Definition at line 310 of file mblock_mul.cpp.

◆ get_entity_eui()

FLASHMEM metadata::eui_t blocks::MMulBlock::get_entity_eui ( ) const
override

Definition at line 19 of file mblock_mul.cpp.

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

◆ init()

FLASHMEM bool blocks::MMulBlock::init ( )
override

Definition at line 131 of file mblock_mul.cpp.

References blocks::MMulBlockHAL::init(), and entities::Entity::init().

◆ MBlock()

FLASHMEM blocks::MBlock::MBlock ( SLOT slot,
MBlockHAL * hardware )
explicit

Definition at line 105 of file mblock.cpp.

◆ MULTIPLIERS_INPUT_RANGE()

static constexpr std::array< uint8_t, NUM_MULTIPLIERS *2 > blocks::MMulBlock::MULTIPLIERS_INPUT_RANGE ( )
inlinestaticconstexpr

Definition at line 115 of file mblock_mul.h.

◆ MULTIPLIERS_OUTPUT_RANGE()

static constexpr std::array< uint8_t, NUM_MULTIPLIERS > blocks::MMulBlock::MULTIPLIERS_OUTPUT_RANGE ( )
inlinestaticconstexpr

Definition at line 119 of file mblock_mul.h.

◆ reset()

◆ write_calibration_to_hardware()

FLASHMEM utils::status blocks::MMulBlock::write_calibration_to_hardware ( )
virtual

◆ write_to_hardware()

FLASHMEM utils::status blocks::MMulBlock::write_to_hardware ( )
nodiscardoverride

Definition at line 68 of file mblock_mul.cpp.

Member Data Documentation

◆ calibration

std::array<MultiplierCalibration, NUM_MULTIPLIERS> blocks::MMulBlock::calibration {}
protected

Definition at line 124 of file mblock_mul.h.

◆ hardware

MMulBlockHAL* blocks::MMulBlock::hardware
protected

Definition at line 122 of file mblock_mul.h.

Referenced by get_entity_eui().

◆ NUM_MULTIPLIERS

uint8_t blocks::MMulBlock::NUM_MULTIPLIERS = 4
staticconstexpr

◆ TYPE

auto blocks::MMulBlock::TYPE = MBlock::TYPES::M_MUL4_BLOCK
staticconstexpr

Definition at line 108 of file mblock_mul.h.

Referenced by MMulBlock().


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