REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
Multplier Math Block (or: Math Multplier Block, hence MMulBlock). More...
#include <mblock_mul.h>


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 MMulBlock * | from_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_MULTIPLIERS > | MULTIPLIERS_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 | |
MMulBlockHAL * | hardware |
std::array< MultiplierCalibration, NUM_MULTIPLIERS > | calibration {} |
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()
|
protected |
Definition at line 41 of file mblock_mul.cpp.
References NUM_MULTIPLIERS, and utils::status::success().
◆ calibrate()
|
override |
Definition at line 149 of file mblock_mul.cpp.
References abs_clamp(), platform::Cluster::add_constant(), daq::average(), blocks::MBlock::calibrate(), platform::Cluster::calibrate_offsets(), entities::ResetAction::CALIBRATION_RESET, platform::Cluster::cblock, blocks::UBlock::change_b_side_transmission_mode(), entities::ResetAction::CIRCUIT_RESET, blocks::MMulBlockHAL_V_1_0_X::float_to_raw_calibration(), LOG, functions::DAC60508::RAW_MAX, functions::DAC60508::RAW_ZERO, platform::Cluster::reset(), daq::sample(), blocks::CBlock::set_factor(), success, platform::Cluster::ublock, blocks::CBlock::write_to_hardware(), and platform::Cluster::write_to_hardware().
Referenced by blocks::MMulBlock_FullAutoCalibration::calibrate().
◆ config_self_from_json()
|
overrideprotected |
Definition at line 25 of file mblock_mul.cpp.
References utils::status::success().
◆ config_self_to_json()
|
overrideprotected |
Definition at line 82 of file mblock_mul.cpp.
References NUM_MULTIPLIERS.
◆ from_entity_classifier()
|
static |
Definition at line 95 of file mblock_mul.cpp.
Referenced by blocks::MBlock::from_entity_classifier().
◆ get_calibration() [1/2]
|
nodiscard |
Definition at line 306 of file mblock_mul.cpp.
◆ get_calibration() [2/2]
|
nodiscard |
Definition at line 310 of file mblock_mul.cpp.
◆ get_entity_eui()
|
override |
Definition at line 19 of file mblock_mul.cpp.
References blocks::FunctionBlockHAL::get_entity_eui(), and hardware.
◆ init()
|
override |
Definition at line 131 of file mblock_mul.cpp.
References blocks::MMulBlockHAL::init(), and entities::Entity::init().
◆ MBlock()
|
explicit |
Definition at line 105 of file mblock.cpp.
◆ MULTIPLIERS_INPUT_RANGE()
|
inlinestaticconstexpr |
Definition at line 115 of file mblock_mul.h.
◆ MULTIPLIERS_OUTPUT_RANGE()
|
inlinestaticconstexpr |
Definition at line 119 of file mblock_mul.h.
◆ reset()
FLASHMEM void blocks::MMulBlock::reset | ( | entities::ResetAction | action | ) |
Definition at line 136 of file mblock_mul.cpp.
References entities::ResetAction::CALIBRATION_RESET, entities::ResetAction::has(), NUM_MULTIPLIERS, entities::ResetAction::OVERLOAD_RESET, and entities::Entity::reset().
◆ write_calibration_to_hardware()
|
virtual |
Reimplemented in blocks::MMulBlock_FullAutoCalibration.
Definition at line 70 of file mblock_mul.cpp.
References NUM_MULTIPLIERS, and utils::status::success().
Referenced by blocks::MMulBlock_FullAutoCalibration::write_calibration_to_hardware().
◆ write_to_hardware()
|
nodiscardoverride |
Definition at line 68 of file mblock_mul.cpp.
Member Data Documentation
◆ calibration
|
protected |
Definition at line 124 of file mblock_mul.h.
◆ hardware
|
protected |
Definition at line 122 of file mblock_mul.h.
Referenced by get_entity_eui().
◆ NUM_MULTIPLIERS
|
staticconstexpr |
Definition at line 113 of file mblock_mul.h.
Referenced by _config_elements_from_json(), config_self_to_json(), reset(), write_calibration_to_hardware(), and blocks::MMulBlock_FullAutoCalibration::write_calibration_to_hardware().
◆ TYPE
|
staticconstexpr |
Definition at line 108 of file mblock_mul.h.
Referenced by MMulBlock().
The documentation for this class was generated from the following files:
- lib/platform-lucidac/src/block/mblock_mul.h
- lib/platform-lucidac/src/block/mblock_mul.cpp