REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
The Lucidac Front Panel is represented by this class. More...
#include <front_panel.h>


Classes | |
class | LEDs |
class | SignalGenerator |
Public Member Functions | |
std::array< uint8_t, 8 > | get_entity_eui () const override |
utils::status | config_self_from_json (JsonObjectConst cfg) override |
Deserialize a new configuration for this entity from a JsonObject. | |
Entity * | get_child_entity (const std::string &child_id) override |
std::vector< Entity * > | get_child_entities () override |
LUCIDACFrontPanel () | |
bool | init () |
Initializes the front panel and puts the signal generator to sleep. | |
void | reset (entities::ResetAction action) |
Resets the front panel to default state e.g. all LEDs off and signal generator sleeping. | |
utils::status | write_to_hardware () override |
Writes the hardware state of the LEDs and the signal generator. | |
![]() | |
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 |
Entity * | resolve_child_entity (std::string paths[], size_t len) |
Entity * | resolve_child_entity (JsonArrayConstIterator begin, JsonArrayConstIterator end) |
Entity * | resolve_child_entity (JsonArrayConst path) |
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 LUCIDACFrontPanel * | from_entity_classifier (entities::EntityClassifier classifier, __attribute__((__unused__)) bus::addr_t block_address) |
Public Attributes | |
class platform::LUCIDACFrontPanel::LEDs | leds |
class platform::LUCIDACFrontPanel::SignalGenerator | signal_generator |
Static Public Attributes | |
static constexpr auto | CLASS_ = entities::EntityClass::FRONT_PANEL |
static constexpr uint8_t | FUNCTION_GENERATOR_IDX = 2 |
static constexpr uint8_t | DAC_IDX = 3 |
static constexpr uint8_t | LED_REGISTER_IDX = 4 |
static constexpr uint8_t | LED_REGISTER_STORE_IDX = 5 |
static constexpr uint8_t | LED_REGISTER_RESET_IDX = 6 |
static constexpr uint8_t | DAC_AMPLITUDE_CH = 0 |
static constexpr uint8_t | DAC_SQUARE_HIGH_CH = 1 |
static constexpr uint8_t | DAC_SQUARE_LOW_CH = 2 |
static constexpr uint8_t | DAC_OFFSET_CH = 3 |
static constexpr uint8_t | DAC_OUT0_CH = 4 |
static constexpr uint8_t | DAC_OUT1_CH = 5 |
Protected Member Functions | |
utils::status | _config_leds_from_json (const JsonVariantConst &cfg) |
utils::status | _config_signal_generator_from_json (const JsonVariantConst &cfg) |
void | config_self_to_json (JsonObject &cfg) override |
Serialize the configuration of this entity to a JsonObject. | |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
std::string | entity_id |
EntityClassifier | classifier |
Detailed Description
The Lucidac Front Panel is represented by this class.
This class provides a interface for all the functions available on the Lucidac Front Panel.
A Lucidac can only have a single front panel. Typical usage happens via the Lucidac class.
Definition at line 26 of file front_panel.h.
Constructor & Destructor Documentation
◆ LUCIDACFrontPanel()
platform::LUCIDACFrontPanel::LUCIDACFrontPanel | ( | ) |
Definition at line 8 of file front_panel.cpp.
References CLASS_, and entities::Entity::classifier.
Referenced by from_entity_classifier().
Member Function Documentation
◆ _config_leds_from_json()
|
protected |
Definition at line 240 of file front_panel.cpp.
References utils::status::success().
Referenced by config_self_from_json().
◆ _config_signal_generator_from_json()
|
protected |
Definition at line 248 of file front_panel.cpp.
References platform::LUCIDACFrontPanel::SignalGenerator::awake(), platform::LUCIDACFrontPanel::SignalGenerator::set_amplitude(), platform::LUCIDACFrontPanel::SignalGenerator::set_dac_out0(), platform::LUCIDACFrontPanel::SignalGenerator::set_dac_out1(), platform::LUCIDACFrontPanel::SignalGenerator::set_frequency(), platform::LUCIDACFrontPanel::SignalGenerator::set_offset(), platform::LUCIDACFrontPanel::SignalGenerator::set_phase(), platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_high(), platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_low(), platform::LUCIDACFrontPanel::SignalGenerator::set_wave_form(), signal_generator, functions::AD9834::SINE, functions::AD9834::SINE_AND_SQUARE, platform::LUCIDACFrontPanel::SignalGenerator::sleep(), utils::status::success(), and functions::AD9834::TRIANGLE.
Referenced by config_self_from_json().
◆ config_self_from_json()
|
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 222 of file front_panel.cpp.
References _config_leds_from_json(), _config_signal_generator_from_json(), and utils::status::success().
◆ config_self_to_json()
|
overrideprotectedvirtual |
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 338 of file front_panel.cpp.
References platform::LUCIDACFrontPanel::SignalGenerator::get_amplitude(), platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out0(), platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out1(), platform::LUCIDACFrontPanel::SignalGenerator::get_frequency(), platform::LUCIDACFrontPanel::SignalGenerator::get_offset(), platform::LUCIDACFrontPanel::SignalGenerator::get_phase(), platform::LUCIDACFrontPanel::SignalGenerator::get_sleep(), platform::LUCIDACFrontPanel::SignalGenerator::get_square_voltage_high(), platform::LUCIDACFrontPanel::SignalGenerator::get_square_voltage_low(), platform::LUCIDACFrontPanel::SignalGenerator::get_wave_form(), signal_generator, functions::AD9834::SINE, functions::AD9834::SINE_AND_SQUARE, and functions::AD9834::TRIANGLE.
◆ from_entity_classifier()
|
static |
Definition at line 199 of file front_panel.cpp.
References CLASS_, entities::Entity::classifier, and LUCIDACFrontPanel().
◆ get_child_entities()
|
inlineoverridevirtual |
Implements entities::Entity.
Definition at line 40 of file front_panel.h.
◆ get_child_entity()
|
inlineoverridevirtual |
Implements entities::Entity.
Definition at line 38 of file front_panel.h.
◆ get_entity_eui()
|
overridevirtual |
Implements entities::Entity.
Definition at line 218 of file front_panel.cpp.
References bus::address_from_tuple(), and metadata::MetadataEditor::read_eui().
◆ init()
|
virtual |
Initializes the front panel and puts the signal generator to sleep.
Reimplemented from entities::Entity.
Definition at line 10 of file front_panel.cpp.
Referenced by platform::LUCIDAC::init().
◆ reset()
|
virtual |
Resets the front panel to default state e.g. all LEDs off and signal generator sleeping.
Reimplemented from entities::Entity.
Definition at line 16 of file front_panel.cpp.
References entities::ResetAction::CIRCUIT_RESET, and entities::ResetAction::has().
Referenced by platform::LUCIDAC::reset().
◆ write_to_hardware()
|
overridevirtual |
Writes the hardware state of the LEDs and the signal generator.
Reimplemented from entities::Entity.
Definition at line 23 of file front_panel.cpp.
References utils::status::attach().
Referenced by platform::LUCIDAC::write_to_hardware().
Member Data Documentation
◆ CLASS_
|
staticconstexpr |
Definition at line 29 of file front_panel.h.
Referenced by from_entity_classifier(), and LUCIDACFrontPanel().
◆ DAC_AMPLITUDE_CH
|
staticconstexpr |
Definition at line 54 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ DAC_IDX
|
staticconstexpr |
Definition at line 49 of file front_panel.h.
◆ DAC_OFFSET_CH
|
staticconstexpr |
Definition at line 57 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ DAC_OUT0_CH
|
staticconstexpr |
Definition at line 58 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ DAC_OUT1_CH
|
staticconstexpr |
Definition at line 59 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ DAC_SQUARE_HIGH_CH
|
staticconstexpr |
Definition at line 55 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ DAC_SQUARE_LOW_CH
|
staticconstexpr |
Definition at line 56 of file front_panel.h.
Referenced by platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware().
◆ FUNCTION_GENERATOR_IDX
|
staticconstexpr |
Definition at line 48 of file front_panel.h.
◆ LED_REGISTER_IDX
|
staticconstexpr |
Definition at line 50 of file front_panel.h.
◆ LED_REGISTER_RESET_IDX
|
staticconstexpr |
Definition at line 52 of file front_panel.h.
◆ LED_REGISTER_STORE_IDX
|
staticconstexpr |
Definition at line 51 of file front_panel.h.
◆ leds
class platform::LUCIDACFrontPanel::LEDs platform::LUCIDACFrontPanel::leds |
◆ signal_generator
class platform::LUCIDACFrontPanel::SignalGenerator platform::LUCIDACFrontPanel::signal_generator |
Referenced by _config_signal_generator_from_json(), and config_self_to_json().
The documentation for this class was generated from the following files:
- lib/platform-lucidac/src/lucidac/front_panel.h
- lib/platform-lucidac/src/lucidac/front_panel.cpp