PS_Fgen_FW  4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
Loading...
Searching...
No Matches
DeviceClass Class Reference

Class holding all relevant sub system objects and settings. More...

#include <Device.h>

Public Member Functions

 DeviceClass ()
 Constructor of the DeviceClass.
 
void Init ()
 Initialize all sub systems of the device.
 
void InitDeviceTimer ()
 Initialize the device timer.
 
void DeviceMainLoop ()
 This method is called from the main() loop continuously.
 
void DeviceTimerTickISR ()
 This method is called periodically by the device timer ISR and runs in the ISR context.
 
void SetSettingsChanged (bool settingsChanged)
 Change the value of the _settingsChanged variable and update the settings changed indicator (star in the upper right corner)
 
void SaveSettings ()
 Save all settings (except user waveforms and calibration factors) to the EEPROM.
 
void LoadSettings ()
 Load all settings (except user waveforms and calibration factors) from the EEPROM.
 
void ResetDevice ()
 Reset all settings (except user waveforms and calibration factors) and save them to the EEPROM.
 
void ResetDeviceCalibration ()
 Reset all calibration settings and save them to the EEPROM.
 
void ReportCalibrationFactors ()
 Write all calibration factor values to the serial output.
 
void CoerceCalibrationFactors ()
 Coerce all calibration factors to valid values if neccessary.
 
void SaveSettingsCalibrationFactors ()
 Save the calibration factors from the EEPROM.
 
void LoadSettingsCalibrationFactors ()
 Load the calibration factors from the EEPROM.
 
void SetDeviceControlState (DeviceControlStates_t controlState)
 Set the device control state to the given value.
 
bool IsUserInputLocked ()
 Check if the user input is locked (device control state is not LOC).
 
void UpdateControlStateOnUserInput ()
 Update the device control state after an user input occurs (only changes to LOC if it was REM)
 

Public Attributes

PS_Channel PsChannel
 Power supply channel object.
 
DDS_Channel DdsChannel1
 DDS channel object 1.
 
DDS_Channel DdsChannel2
 DDS channel object 2.
 
DMM_Channel DmmChannel1
 DMM channel object 1.
 
DMM_Channel DmmChannel2
 DMM channel object 2.
 
ChannelChannels [NUM_CHANNELS]
 Array with pointers to all channel objects above.
 
uint8_t SelectedScpiChannelIndex
 Index of the channel selected by the "INSTrument[:SELect]" SCPI command.
 
DevicePowerUpOutputEnabledStates_t PowerOnOutputsState
 Power up output state (state of all outputs on power up)
 
DeviceControlStates_t DeviceControlState
 Control state of the device (LOC, REM, RWL)
 
DeviceVoltages_t DeviceVoltages
 Measured device ATX voltages.
 
DeviceCalibrationFactors_t CalibrationFactors
 Loaded calibration factors used for device operation.
 
UserInputHandlerClass UserInputHandler
 UserInputHandler object used for key and Usart enqueueing and dequeueing.
 
ScreenManagerClass ScreenManager
 Object for all screen drawing related stuff.
 
uint16_t TimeCounter_KeyPolling_ms
 Variable used for measuring the time to the next key polling.
 
uint16_t TimeCounter_AutoSave_ms
 Variable used for measuring the time to the next auto save.
 
uint16_t TimeCounter_PowerSupplyChannelRegulation_ms
 Variable used for measuring the time to the next power supply regulation loop.
 

Private Attributes

bool _settingsChanged
 Variable used to keep track if all settings are changed (true if no unsaved settings exist; otherwise false)
 

Detailed Description

Class holding all relevant sub system objects and settings.

Member Function Documentation

◆ DeviceTimerTickISR()

void DeviceClass::DeviceTimerTickISR ( void )

This method is called periodically by the device timer ISR and runs in the ISR context.

It is used for key polling and forwarding the timer tick to other sub systems.

◆ IsUserInputLocked()

bool DeviceClass::IsUserInputLocked ( )

Check if the user input is locked (device control state is not LOC).

Returns
true if device control state is not LOC; otherwise false.

◆ SetDeviceControlState()

void DeviceClass::SetDeviceControlState ( DeviceControlStates_t controlState)

Set the device control state to the given value.

Parameters
controlStateNew control state of the device (LOC, REM, RWL)

◆ SetSettingsChanged()

void DeviceClass::SetSettingsChanged ( bool settingsChanged)

Change the value of the _settingsChanged variable and update the settings changed indicator (star in the upper right corner)

Parameters
settingsChangedAre all settings changed (true if no unsaved settings exist; otherwise false)

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