Table of Contents
Previous Chapter
The purpose of the System Configuration classes is to manage the suite of software-controllable hardware settings within the instrument.
The following lists the use of the System Configuration Classes:
Figure 142 illustrates the class relationships used by the System Configuration Classes. These class include the SysConfigTable class, which maintains the current list of settings, and the SystemConfiguration class, which is a task which reloads settings into the hardware and monitors the radiation flag.
FIGURE 142. System Configuration Class Relationships
SysConfigTable- This class represents the collection of system configuration parameters within the instrument. It provides a function which modifies an entry in the table (changeEntry), and provides a function which returns the address and length of the table for purposes of dumping the table to telemetry (getTableInfo). This class provides services used by the SystemConfiguration class to get the desired power settings for each of the DEA and FEP boards (getDeaPowerEnable, getFepPowerEnable), to fetch a desired DEA CCD Controller or Interface Controller register setting from the table (getCcdSetting, getCntlSetting, respectively), and to determine the total number of settings for the CCD Controller or Interface Controller (getCcdSettingCount., getCntlSettingCount, respectively).
SystemConfiguration- This class is a subclass of Executive::Task, and is responsible for maintaining the hardware configuration settings and reacting to the radiation monitor. This class provides a main task entry function (goTaskEntry) and a public function used to reload all settings into a CCD Controller (reloadCcdSettings).
Task- This class is supplied by the Executive class category. It represents and controls an active running task. The SystemConfiguration class inherits from this class, and uses the class's functions to relinquish control for a period of time (sleep), and to detect queries from the TaskMonitor (requestEvent).
RadDevice- This class is supplied by the Devices class category. It is responsible for providing access to the radiation monitor flag (isAsserted).
IntrGuard- This class is supplied by the Devices class category and is responsible for disabling and re-enabling interrupts.
TaskMonitor- This class is supplied by the Executive class category, and is responsible for periodically polling each task in the instrument. When polled, the SystemConfiguration task responds using this classes member function (respond).
DeaManager- This class is supplied by the Protocols class category, and is responsible for arbitrating access to the DEA hardware interface. The SystemConfiguration class uses this class to disable power to the DEA boards (powerOff), to query the current power state of the boards (hasPower), to enable power to the boards (powerOn), and to write to the CCD Controller and Interface Controller boards registers (setCcdRegister, setCntlRegister, respectively).
FepManager- This class is supplied by the Protocols class category, and is responsible for managing access to the Front End Processors. The SystemConfiguration class uses this class to query the current power state of each of the FEPs (hasPower), to disable power to a FEP (powerOff), and to power on a FEP and load a default program (loadRunProgram).
ScienceManager- This class is supplied by the Science class category, and is responsible for managing overall science processing. The SystemConfiguration class uses this class to detect when a science run is complete (isIdle), and to abort a run in-progress and inhibit further runs (inhibit).
The SystemConfiguration task consists of a main polling loop, contained within goTaskEntry(), which uses the RadDevice class to determine when the radiation monitor is asserted.
Figure 143 illustrates the main operations performed on each iteration of this loop, and the interactions with the Radiation Monitor interrupt.
FIGURE 143. SystemConfiguration task polling loop
To modify an entry in the system configuration table, the client passes the entry index and value to sysConfigTable.changeEntry(), which then modifies the indexed value and sets the corresponding changed flag to BoolTrue. Later, the systemConfiguration task will pick up the modification, adjust the corresponding DEA hardware setting or power selection as described in the subsequent scenarios and sets the changed flag to BoolFalse.
The final layout of the table is TBD. Table 26 illustrates the current layout:
 TABLE 26. System Configuration Table Layout 
------------------------------------------------------------------------------------------------
Index              Name              Quantity  Description                                        
------------------------------------------------------------------------------------------------
0                  DEA Power         1         This is a bit-field, indicating which CCD-con      
                                               trollers should be powered. Each bit is indexed    
                                               by CCD Id (i.e. bit 0 corresponds to CCD_I0).      
                                               If a bit is `1', then the CCD controller should    
                                               be on, otherwise, it should be off. Unused bits    
                                               in the field should be set to zero.                
                                                                                                  
1                  FEP Power         1         This is a bit-field, indicating which FEPs         
                                               should be powered. Each bit is indexed by          
                                               FEP Id (i.e. bit 0 corresponds to FEP_0). If a     
                                               bit is `1', then the FEP should be on, other       
                                               wise, it should be off. Unused bits in the field   
                                               should be set to zero.                             
2..65              DEA Interface     64        This is an array of interface board settings.      
                   Controller Set              The assignments are TBD.                           
                   tings                                                                          
66+ (64 * ccdId)   DEA CCD Con       10 * 64   This is a set of arrays of CCD Controller set      
+ settingId        troller Settings            tings. The index formula indicates the offset to   
                                               a particular setting, indicated by settingId       
                                               for a particular CCD Controller, indicated by      
                                               ccdId. The register assignments are TBD.           
------------------------------------------------------------------------------------------------
Figure 144 illustrates the case where the SystemConfiguration updates the DEA power settings.
FIGURE 144. Update DEA Power Settings
The scenario for powering FEPs is similar to the above scenario except that the desired power settings are obtained using sysConfigTable.getFepPowerEnable(), and the queries and power control functions (hasPower, powerOff, powerOn) are issued to the fepManager, rather than the deaManager. Since changes in FEP power are driven by power-consumption and thermal concerns, power settings to the FEPs are always updated, regardless of the state of the radiation monitor.
Figure 145 illustrates the steps used by the SystemConfiguration class to update modified register settings in the DEA interface controller board.
FIGURE 145. Load updated DEA settings
Figure 146 illustrates the steps used by the SystemConfiguration class to shutdown the DEA when the radiation monitor has been asserted.
FIGURE 146. DEA shutdown due to radiation monitor assertion
Once the radiation monitor subsides, the systemConfiguration's polling loop calls updateDeaPower() to power on all of the required DEA boards (see Section 30.4.3). Their respective settings are re-loaded at the onset of the next science run. It then enables science by passing BoolFalse to scienceManager.inhibit().
The settings for a given CCD Controller are re-loaded when the CCD is about to be used for a science run. Its settings are loaded as part of the setup for the run. Figure 147 illustrates the steps used by the SystemConfiguration to load the settings for a particular CCD.
FIGURE 147. Re-load CCD Controller Settings
Hierarchy:
Superclasses:
none
Public Interface:
Operations:
SysConfigTable() changeEntry() getCcdSetting() getCcdSettingCount() getCntlSetting() getCntlSettingCount() getDeaPowerEnable() getFepPowerEnable() getTableInfo()
Protected Interface:
Operations:
getSetting()
Private Interface:
Has-A Relationships:
Arguments:
unsigned item
unsigned value
Documentation:
This function modifies the configuration entry, setting the entry indicated by item to the passed value.
Arguments:
CcdId ccdid
unsigned regid
unsigned short& value
Boolean& changed
Documentation:
This function reads the desired setting for the DEA CCD Controller register. The CCD controller is indicated by ccdid, and the register setting is indexed by regid. The function returns the desired setting in value and resets the modification flag corresponding to the entry. If the value has changed since the last call, the function sets changed to BoolTrue. If the value hasn't changed since the last time it was fetched, changed contains BoolFalse. If the register is not used by the DEA hardware, the function returns BoolFalse. If it is a valid hardware register, the function returns BoolTrue. (NOTE: This scheme is to allow for late changes to the DEA register settings without impacting the software design).
Arguments:
unsigned regid unsigned short& value Boolean& changed
Arguments:
DeaBoardId boardid
Documentation:
This function returns whether or not the DEA board, indicated by boardid, is configured to be powered on. If the board should not be powered on, this function returns BoolFalse. If the board should be powered on when the radiation monitor is not active, the function returns BoolTrue.
Arguments:
FepId fepid
Documentation:
This function indicates whether or not the FEP, indicated by fepid, should be powered on. If the function returns BoolFalse, the FEP should be off. If the function returns BoolTrue, the FEP should be on.
Arguments:
unsigned item
unsigned short& value
Boolean& changed
Documentation:
This function reads and resets the changed flag for the indicated item. The fetched item is returned in value. If the value has changed since the last time it was fetched, the function sets changed to BoolTrue, otherwise, changed contains BoolFalse.
Arguments:
const unsigned*& addr
unsigned& wordcnt
Documentation:
This function returns the address and word length of the system configuration table. Upon return, addr points to the start of the system configuration table, and wordcnt contains the number of 32-bit words in the table.
Hierarchy:
Superclasses:
Task
Implementation Uses:
SysConfigTable
RadDevice
TaskMonitor
FepManager
DeaManager
ScienceManager
IntrGuard
Public Interface:
Operations:
SystemConfiguration() goTaskEntry() reloadCcdSettings()
Protected Interface:
Operations:
checkMonitors() enableScience() isRadiationOn() powerOffDea() updateCcdSettings() updateCntlSettings() updateDeaPower() updateFepPower()
Private Interface:
Has-A Relationships:
Boolean radiationAssertFlag: This flag indicates that the radiation monitor has been asserted.
Arguments:
unsigned taskid
Documentation:
This is the constructor of the system configuration class. taskid is the RTX task id to use for the task. This function first initializes the parent Task. It then initializes its instance variables.
Arguments:
CcdId ccdid
Documentation:
This function reloads all settings to the DEA CCD controller board indicated by ccdid. Currently, the function always returns BoolTrue.