REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
cluster.h
Go to the documentation of this file.
1// Copyright (c) 2024 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
4
5#pragma once
6
7#include "block/blocks.h"
8#include "daq/daq.h"
9#include "entity/entity.h"
10
11namespace platform {
12
20class Cluster : public entities::Entity {
21private:
22 uint8_t cluster_idx;
23
24public:
31
32 static constexpr auto CLASS_ = entities::EntityClass::CLUSTER;
33
34 explicit Cluster(uint8_t cluster_idx = 0);
35
36 // TODO: Delete copy and assignment operators
37 // Cluster(Cluster const &) = delete;
38 // Cluster &operator=(Cluster const &) = delete;
39
40 metadata::eui_t get_entity_eui() const override { return {}; }
41
42 bool init();
43 std::array<blocks::FunctionBlock *, 6> get_blocks() const;
44
45 bool calibrate_offsets();
46 bool calibrate_routes();
47
48 [[nodiscard]] utils::status write_to_hardware() override;
49
50 uint8_t get_cluster_idx() const;
51
72 bool route(uint8_t u_in, uint8_t u_out, float c_factor, uint8_t i_out);
73
74 bool add_constant(blocks::UBlock::Transmission_Mode signal_type, uint8_t u_out, float c_factor,
75 uint8_t i_out);
76
78 bool route_in_external(uint8_t input, uint8_t i_out);
81 bool route_out_external(uint8_t u_in, uint8_t output, float c_factor);
82
83 void reset(entities::ResetAction action);
84
85 std::vector<Entity *> get_child_entities() override;
86
87 Entity *get_child_entity(const std::string &child_id) override;
88
89 utils::status config_self_from_json(JsonObjectConst cfg) override;
90};
91
92} // namespace platform
The Lucidac Coefficient Block (C-Block) is represented by this class.
Definition cblock.h:83
The Lucidac I-Block (I for Current; the Implicit Summing Block) is represented by this class.
Definition iblock.h:99
A REDAC Math block (M-Block) is represented by this class.
Definition mblock.h:43
The Lucidac U-Block (U for Voltage) is represented by this class.
Definition ublock.h:123
Entity()=default
The Lucidac class represents a single cluster.
Definition cluster.h:20
Entity * get_child_entity(const std::string &child_id) override
Definition cluster.cpp:286
blocks::MBlock * m0block
Definition cluster.h:25
utils::status config_self_from_json(JsonObjectConst cfg) override
Deserialize a new configuration for this entity from a JsonObject.
Definition cluster.cpp:302
blocks::SHBlock * shblock
Definition cluster.h:30
bool calibrate_routes()
Definition cluster.cpp:95
blocks::IBlock * iblock
Definition cluster.h:29
bool add_constant(blocks::UBlock::Transmission_Mode signal_type, uint8_t u_out, float c_factor, uint8_t i_out)
Definition cluster.cpp:246
bool route_in_external(uint8_t input, uint8_t i_out)
Allows to route in an external signal from the lucidac front panel. input can be between 0 - 7.
Definition cluster.cpp:263
blocks::MBlock * m1block
Definition cluster.h:26
utils::status write_to_hardware() override
returns true in case of success
Definition cluster.cpp:219
static constexpr auto CLASS_
Definition cluster.h:32
bool init()
returns true in case of success
Definition cluster.cpp:19
bool route_out_external(uint8_t u_in, uint8_t output, float c_factor)
Allows to route an signal to the external outputs on the lucidac front panel.
Definition cluster.cpp:270
std::array< blocks::FunctionBlock *, 6 > get_blocks() const
Definition cluster.cpp:15
blocks::UBlock * ublock
Definition cluster.h:27
metadata::eui_t get_entity_eui() const override
Definition cluster.h:40
bool route(uint8_t u_in, uint8_t u_out, float c_factor, uint8_t i_out)
Register a route throught the cluster.
Definition cluster.cpp:230
std::vector< Entity * > get_child_entities() override
Definition cluster.cpp:311
Cluster(uint8_t cluster_idx=0)
Definition cluster.cpp:69
bool calibrate_offsets()
Definition cluster.cpp:74
void reset(entities::ResetAction action)
Definition cluster.cpp:279
blocks::CBlock * cblock
Definition cluster.h:28
uint8_t get_cluster_idx() const
Definition cluster.cpp:318
A recoverable error, inspired from https://abseil.io/docs/cpp/guides/status and https://github....
Definition error.h:35
std::array< uint8_t, 8 > eui_t
Definition base.h:20
This concept of Backpanel / Backplane refers to the address decoder and periphery reachable by every ...
Definition cblock.h:15