REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
|
#include <front_panel.h>
Public Member Functions | |
SignalGenerator () | |
bool | init () |
Initializes the signal generator and puts it to sleep. | |
bool | is_installed () const |
Returns wether an signal generator module is actually installed and active. | |
void | set_frequency (float frequency) |
Sets the frequency of the sine / triangle output in Hz. | |
void | set_phase (float phase) |
Sets the phase of the frequency outputs synchronised to the reset pin. | |
void | set_wave_form (functions::AD9834::WaveForm wave_form) |
Sets the wave form of the function generator output. | |
bool | set_amplitude (float amplitude) |
Sets the amplitude of the sine or triangle wave in machine units. | |
bool | set_square_voltage_levels (float low, float high) |
Sets the lower and upper value of the square output in machine units. | |
bool | set_square_voltage_low (float low) |
Sets the lower value of the square output in machine units. | |
bool | set_square_voltage_high (float high) |
Sets the upper value of the square output in machine units. | |
bool | set_offset (float offset) |
Sets the constant offset of the sine or triangle output in machine units. | |
float | get_real_frequency () const |
Returns the actually set frequency of the function generator, containing rounding errors. | |
float | get_real_phase () const |
Returns the actually set phase of the function generator, containing rounding errors. | |
float | get_frequency () const |
float | get_phase () const |
functions::AD9834::WaveForm | get_wave_form () const |
float | get_amplitude () const |
float | get_square_voltage_low () const |
float | get_square_voltage_high () const |
float | get_offset () const |
bool | get_sleep () const |
float | get_dac_out0 () const |
float | get_dac_out1 () const |
void | sleep () |
Sets the sine / triangle output of the function generator to zero. | |
void | awake () |
Resumes outputs of the function generator to regular operation, according to the previously specified frequencies. | |
bool | set_dac_out0 (float value) |
Writes the DACout0 constant voltage output. Possible values are: [-2V, 2V]. | |
bool | set_dac_out1 (float value) |
Writes the DACout1 constant voltage output. Possible values are: [-2V, 2V]. | |
utils::status | write_to_hardware () |
Detailed Description
Definition at line 104 of file front_panel.h.
Constructor & Destructor Documentation
◆ SignalGenerator()
FLASHMEM platform::LUCIDACFrontPanel::SignalGenerator::SignalGenerator | ( | ) |
Definition at line 63 of file front_panel.cpp.
Member Function Documentation
◆ awake()
FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::awake | ( | ) |
Resumes outputs of the function generator to regular operation, according to the previously specified frequencies.
Definition at line 151 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ get_amplitude()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_amplitude | ( | ) | const |
Definition at line 131 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_dac_out0()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out0 | ( | ) | const |
Definition at line 145 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_dac_out1()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_dac_out1 | ( | ) | const |
Definition at line 147 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_frequency()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_frequency | ( | ) | const |
Definition at line 123 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_offset()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_offset | ( | ) | const |
Definition at line 141 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_phase()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_phase | ( | ) | const |
Definition at line 125 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_real_frequency()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_real_frequency | ( | ) | const |
Returns the actually set frequency of the function generator, containing rounding errors.
Definition at line 115 of file front_panel.cpp.
◆ get_real_phase()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_real_phase | ( | ) | const |
Returns the actually set phase of the function generator, containing rounding errors.
Possible values are mapped to [0, 2PI].
Definition at line 119 of file front_panel.cpp.
◆ get_sleep()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::get_sleep | ( | ) | const |
Definition at line 143 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_square_voltage_high()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_square_voltage_high | ( | ) | const |
Definition at line 137 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_square_voltage_low()
FLASHMEM float platform::LUCIDACFrontPanel::SignalGenerator::get_square_voltage_low | ( | ) | const |
Definition at line 133 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ get_wave_form()
FLASHMEM functions::AD9834::WaveForm platform::LUCIDACFrontPanel::SignalGenerator::get_wave_form | ( | ) | const |
Definition at line 127 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::config_self_to_json().
◆ init()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::init | ( | ) |
Initializes the signal generator and puts it to sleep.
Definition at line 67 of file front_panel.cpp.
◆ is_installed()
|
inline |
Returns wether an signal generator module is actually installed and active.
Writing to an uninstalled generator will result in fauilure
Definition at line 112 of file front_panel.h.
◆ set_amplitude()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_amplitude | ( | float | amplitude | ) |
Sets the amplitude of the sine or triangle wave in machine units.
Possible values are: [0, 1]. The amplitude of the square output is not affected by this function.
Definition at line 83 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_dac_out0()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_dac_out0 | ( | float | value | ) |
Writes the DACout0 constant voltage output. Possible values are: [-2V, 2V].
Definition at line 153 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_dac_out1()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_dac_out1 | ( | float | value | ) |
Writes the DACout1 constant voltage output. Possible values are: [-2V, 2V].
Definition at line 160 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_frequency()
FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::set_frequency | ( | float | frequency | ) |
Sets the frequency of the sine / triangle output in Hz.
Note that the square output will always operate on half of the specified frequency. Returns the actually set frequency.
Definition at line 72 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_offset()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_offset | ( | float | offset | ) |
Sets the constant offset of the sine or triangle output in machine units.
The levels of the square output are not affected by this function.
Definition at line 108 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_phase()
FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::set_phase | ( | float | phase | ) |
Sets the phase of the frequency outputs synchronised to the reset pin.
Possible values are [0, 2 PI]. Returns the actually set phase.
Definition at line 76 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_square_voltage_high()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_high | ( | float | high | ) |
Sets the upper value of the square output in machine units.
Possible values are: [-1, 1]. The amplitude of the sine / triangle output is not affected by this function.
Definition at line 101 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_square_voltage_levels()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_levels | ( | float | low, |
float | high ) |
Sets the lower and upper value of the square output in machine units.
Possible values are: [-1, 1]. The amplitude of the sine / triangle output is not affected by this function.
Definition at line 90 of file front_panel.cpp.
◆ set_square_voltage_low()
FLASHMEM bool platform::LUCIDACFrontPanel::SignalGenerator::set_square_voltage_low | ( | float | low | ) |
Sets the lower value of the square output in machine units.
Possible values are: [-1, 1]. The amplitude of the sine / triangle output is not affected by this function.
Definition at line 94 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ set_wave_form()
FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::set_wave_form | ( | functions::AD9834::WaveForm | wave_form | ) |
Sets the wave form of the function generator output.
Definition at line 79 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ sleep()
FLASHMEM void platform::LUCIDACFrontPanel::SignalGenerator::sleep | ( | ) |
Sets the sine / triangle output of the function generator to zero.
The square output will stay at high or low level.
Definition at line 149 of file front_panel.cpp.
Referenced by platform::LUCIDACFrontPanel::_config_signal_generator_from_json().
◆ write_to_hardware()
FLASHMEM utils::status platform::LUCIDACFrontPanel::SignalGenerator::write_to_hardware | ( | ) |
Definition at line 168 of file front_panel.cpp.
References platform::LUCIDACFrontPanel::DAC_AMPLITUDE_CH, platform::LUCIDACFrontPanel::DAC_OFFSET_CH, platform::LUCIDACFrontPanel::DAC_OUT0_CH, platform::LUCIDACFrontPanel::DAC_OUT1_CH, platform::LUCIDACFrontPanel::DAC_SQUARE_HIGH_CH, platform::LUCIDACFrontPanel::DAC_SQUARE_LOW_CH, and utils::status::success().
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