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

The Lucidac Front Panel is represented by this class. More...

#include <front_panel.h>

Inheritance diagram for platform::LUCIDACFrontPanel:
Collaboration diagram for platform::LUCIDACFrontPanel:

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.
 
Entityget_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.
 
- 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)
 
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 LUCIDACFrontPanelfrom_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.
 
- 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.
 
void config_children_to_json (JsonObject &cfg)
 Serialize the configuration of the child entities of this entity to a JsonObject.
 

Additional Inherited Members

- Protected Attributes inherited from entities::Entity
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()

FLASHMEM utils::status platform::LUCIDACFrontPanel::_config_leds_from_json ( const JsonVariantConst & cfg)
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()

◆ config_self_from_json()

FLASHMEM utils::status platform::LUCIDACFrontPanel::config_self_from_json ( JsonObjectConst cfg)
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()

◆ from_entity_classifier()

FLASHMEM platform::LUCIDACFrontPanel * platform::LUCIDACFrontPanel::from_entity_classifier ( entities::EntityClassifier classifier,
__attribute__((__unused__)) bus::addr_t block_address )
static

Definition at line 199 of file front_panel.cpp.

References CLASS_, entities::Entity::classifier, and LUCIDACFrontPanel().

◆ get_child_entities()

std::vector< Entity * > platform::LUCIDACFrontPanel::get_child_entities ( )
inlineoverridevirtual

Implements entities::Entity.

Definition at line 40 of file front_panel.h.

◆ get_child_entity()

Entity * platform::LUCIDACFrontPanel::get_child_entity ( const std::string & child_id)
inlineoverridevirtual

Implements entities::Entity.

Definition at line 38 of file front_panel.h.

◆ get_entity_eui()

FLASHMEM std::array< uint8_t, 8 > platform::LUCIDACFrontPanel::get_entity_eui ( ) const
overridevirtual

◆ init()

FLASHMEM bool platform::LUCIDACFrontPanel::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()

FLASHMEM void platform::LUCIDACFrontPanel::reset ( entities::ResetAction action)
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()

FLASHMEM utils::status platform::LUCIDACFrontPanel::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_

auto platform::LUCIDACFrontPanel::CLASS_ = entities::EntityClass::FRONT_PANEL
staticconstexpr

Definition at line 29 of file front_panel.h.

Referenced by from_entity_classifier(), and LUCIDACFrontPanel().

◆ DAC_AMPLITUDE_CH

uint8_t platform::LUCIDACFrontPanel::DAC_AMPLITUDE_CH = 0
staticconstexpr

◆ DAC_IDX

uint8_t platform::LUCIDACFrontPanel::DAC_IDX = 3
staticconstexpr

Definition at line 49 of file front_panel.h.

◆ DAC_OFFSET_CH

uint8_t platform::LUCIDACFrontPanel::DAC_OFFSET_CH = 3
staticconstexpr

◆ DAC_OUT0_CH

uint8_t platform::LUCIDACFrontPanel::DAC_OUT0_CH = 4
staticconstexpr

◆ DAC_OUT1_CH

uint8_t platform::LUCIDACFrontPanel::DAC_OUT1_CH = 5
staticconstexpr

◆ DAC_SQUARE_HIGH_CH

uint8_t platform::LUCIDACFrontPanel::DAC_SQUARE_HIGH_CH = 1
staticconstexpr

◆ DAC_SQUARE_LOW_CH

uint8_t platform::LUCIDACFrontPanel::DAC_SQUARE_LOW_CH = 2
staticconstexpr

◆ FUNCTION_GENERATOR_IDX

uint8_t platform::LUCIDACFrontPanel::FUNCTION_GENERATOR_IDX = 2
staticconstexpr

Definition at line 48 of file front_panel.h.

◆ LED_REGISTER_IDX

uint8_t platform::LUCIDACFrontPanel::LED_REGISTER_IDX = 4
staticconstexpr

Definition at line 50 of file front_panel.h.

◆ LED_REGISTER_RESET_IDX

uint8_t platform::LUCIDACFrontPanel::LED_REGISTER_RESET_IDX = 6
staticconstexpr

Definition at line 52 of file front_panel.h.

◆ LED_REGISTER_STORE_IDX

uint8_t platform::LUCIDACFrontPanel::LED_REGISTER_STORE_IDX = 5
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

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