REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
Loading...
Searching...
No Matches
front_panel.cpp
Go to the documentation of this file.
8platform::LUCIDACFrontPanel::LUCIDACFrontPanel() : entities::Entity("FP") { classifier.class_enum = CLASS_; }
48FLASHMEM void platform::LUCIDACFrontPanel::LEDs::set_all(const uint8_t states) { led_states = states; }
76FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::set_phase(float phase) { _phase = phase; }
90FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_levels(float low, float high) {
101FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_high(float high) {
123FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_frequency() const { return _frequency; }
125FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_phase() const { return _phase; }
131FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_amplitude() const { return _amplitude; }
141FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_offset() const { return _offset; }
145FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out0() const { return _dac_out0; }
147FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out1() const { return _dac_out1; }
240FLASHMEM utils::status platform::LUCIDACFrontPanel::_config_leds_from_json(const JsonVariantConst &cfg) {
@ SINE_AND_SQUARE
@ TRIANGLE
Definition entity.h:32
utils::status write_to_hardware() const
Definition front_panel.cpp:57
bool set(const uint8_t led, bool on)
Sets specified front led to the specified value.
Definition front_panel.cpp:36
float get_dac_out1() const
Definition front_panel.cpp:147
void awake()
Resumes outputs of the function generator to regular operation, according to the previously specified...
Definition front_panel.cpp:151
bool set_dac_out1(float value)
Writes the DACout1 constant voltage output. Possible values are: [-2V, 2V].
Definition front_panel.cpp:160
float get_real_phase() const
Returns the actually set phase of the function generator, containing rounding errors.
Definition front_panel.cpp:119
float get_frequency() const
Definition front_panel.cpp:123
void sleep()
Sets the sine / triangle output of the function generator to zero.
Definition front_panel.cpp:149
void set_frequency(float frequency)
Sets the frequency of the sine / triangle output in Hz.
Definition front_panel.cpp:72
void set_wave_form(functions::AD9834::WaveForm wave_form)
Sets the wave form of the function generator output.
Definition front_panel.cpp:79
float get_square_voltage_high() const
Definition front_panel.cpp:137
float get_offset() const
Definition front_panel.cpp:141
float get_dac_out0() const
Definition front_panel.cpp:145
SignalGenerator()
Definition front_panel.cpp:63
float get_phase() const
Definition front_panel.cpp:125
void set_phase(float phase)
Sets the phase of the frequency outputs synchronised to the reset pin.
Definition front_panel.cpp:76
bool set_square_voltage_high(float high)
Sets the upper value of the square output in machine units.
Definition front_panel.cpp:101
float get_real_frequency() const
Returns the actually set frequency of the function generator, containing rounding errors.
Definition front_panel.cpp:115
float get_amplitude() const
Definition front_panel.cpp:131
bool set_offset(float offset)
Sets the constant offset of the sine or triangle output in machine units.
Definition front_panel.cpp:108
utils::status write_to_hardware()
Definition front_panel.cpp:168
bool set_dac_out0(float value)
Writes the DACout0 constant voltage output. Possible values are: [-2V, 2V].
Definition front_panel.cpp:153
float get_square_voltage_low() const
Definition front_panel.cpp:133
bool set_square_voltage_low(float low)
Sets the lower value of the square output in machine units.
Definition front_panel.cpp:94
bool set_amplitude(float amplitude)
Sets the amplitude of the sine or triangle wave in machine units.
Definition front_panel.cpp:83
functions::AD9834::WaveForm get_wave_form() const
Definition front_panel.cpp:127
bool get_sleep() const
Definition front_panel.cpp:143
bool set_square_voltage_levels(float low, float high)
Sets the lower and upper value of the square output in machine units.
Definition front_panel.cpp:90
The Lucidac Front Panel is represented by this class.
Definition front_panel.h:26
utils::status write_to_hardware() override
Writes the hardware state of the LEDs and the signal generator.
Definition front_panel.cpp:23
utils::status _config_leds_from_json(const JsonVariantConst &cfg)
Definition front_panel.cpp:240
utils::status config_self_from_json(JsonObjectConst cfg) override
Deserialize a new configuration for this entity from a JsonObject.
Definition front_panel.cpp:222
void reset(entities::ResetAction action)
Resets the front panel to default state e.g. all LEDs off and signal generator sleeping.
Definition front_panel.cpp:16
static constexpr uint8_t DAC_OUT0_CH
Definition front_panel.h:58
static constexpr uint8_t DAC_AMPLITUDE_CH
Definition front_panel.h:54
class platform::LUCIDACFrontPanel::SignalGenerator signal_generator
static constexpr uint8_t DAC_SQUARE_LOW_CH
Definition front_panel.h:56
utils::status _config_signal_generator_from_json(const JsonVariantConst &cfg)
Definition front_panel.cpp:248
static constexpr uint8_t FUNCTION_GENERATOR_IDX
Definition front_panel.h:48
void config_self_to_json(JsonObject &cfg) override
Serialize the configuration of this entity to a JsonObject.
Definition front_panel.cpp:338
static constexpr uint8_t DAC_SQUARE_HIGH_CH
Definition front_panel.h:55
bool init()
Initializes the front panel and puts the signal generator to sleep.
Definition front_panel.cpp:10
static constexpr uint8_t DAC_OFFSET_CH
Definition front_panel.h:57
std::array< uint8_t, 8 > get_entity_eui() const override
Definition front_panel.cpp:218
static LUCIDACFrontPanel * from_entity_classifier(entities::EntityClassifier classifier, __attribute__((__unused__)) bus::addr_t block_address)
Definition front_panel.cpp:199
static constexpr uint8_t DAC_OUT1_CH
Definition front_panel.h:59
A recoverable error, inspired from https://abseil.io/docs/cpp/guides/status and https://github....
Definition error.h:35
status & attach(const status &other, const char *description="")
Attach another error message to this one. Is chainable, returns self.
Definition error.h:72
__attribute__((section(".fastrun"), noinline, noclone, optimize("Os"))) int flash_sector_not_erased(uint32_t address)
Definition flasher.cpp:114
constexpr addr_t address_from_tuple(uint8_t baddr, uint8_t faddr)
Definition bus.h:100
Definition front_panel_signaling.h:3
Definition base.h:101