index previous next 

file name: clockirq.hpp, clockirq.cpp
classification: pure simulation
contents: class CClockInterrupt, derived from CInterruptProcess, class CDutyB1Interrupt, derived from CClockInterrupt, class CGpsInterrupt, derived from CClockInterrupt
use: simulate clock (and GPS) interrupts
 

global items used by CClockInterrupt:

member variables of CClockInterrupt:

INT32 *intstat_: This is a pointer to the UTCSU status register that the interrupt will modify when it is raised (it will set the interrupt pending (IP) bit).
default: NULL

INT8 ipBit_: The bit that is set to 1 when the interrupt is raised (before the ISR is called).
default: 32

double scheduleTime_: Contains the clock value (in seconds), at which the interrupt should occur.
default: -1
 

member functions of CClockInterrupt:

CClockInterrupt (unsigned long nodeID): Stores the ID of the process and sets all members to default values.

double GetScheduleTime (): Returns the clock value for which the process waits.

virtual void PreExecution (): if intstat is not NULL and ipBit is less than 32, the bit with number ipBit in register *intstat is set to 1. The other bits stay the same. If one of the above conditions is not fulfilled, *intstat is not changed. In any case, scheduleTime is set back to its default value.

void SetPendingBit (INT8 bitnumber): Store the IP bit (but only if bitnumber is less than 32).

void SetScheduleTime (double time): Stores the time in scheduleTime. This sets the (UTCSU) clock value (in seconds) for which the process waits.

void SetStatusRegister (INT32& statusreg): Sets the status register that will contain the interrupt pending bit.
 

global items used by CDutyB1Interrupt:

member variables of CDutyB1Interrupt:

CSoftwareClock *clock_: the clock whose value is modified at the 1PPS pulse.
 

member functions of CDutyB1Interrupt:

CDutyB1Interrupt (unsigned long nodeID, CSoftwareClock *clock): Stores a pointer to the clock that is automatically amortized.

virtual void PreExecution(): The function is executed prior to calling the ISR. It sets the IP bit and calls clock::SetSTARTAMORT() to start the amortization phase.
 

global items used by CGpsInterrupt:

member variables of CGpsInterrupt:

Note: the implementation of the GPS interrupts consists of two interrupt processes: class CGpsInterrupt is used for the GPS1PPS interrupt and calls the appropriate ISR every full second if it is enabled. But some time after the full second, another ISR is invoked to simulate the interrupt of the GPS receiver which is raised after the GPS time information is available. This ISR is called by an interrupt process of type CInterruptProcess.
 

CSoftwareClock *clock_: the clock whose value is modified at the 1PPS pulse.

CInterruptProcess *gpstime_: the ISR of the GPS receiver.

EGpsUnit gpu_: the GPS unit to which the GPS receiver "creating" the interrupt is connected.
 

member functions of CGpsInterrupt:

CGpsInterrupt (unsigned long nodeID, CSoftwareClock *clock, EGpsUnit gpu): Stores a pointer to the clock that is "connected" to the GPS receiver. gpu is the GPS unit to which the receiver is connected. If gpu is greater or equal to EGpsUnitCount, an assert fails.

~CGpsInterrupt(): Unreference or delete the GPS interrupt process gpstime.

void DisableTime(): The GPS time ISR is not called in PostExecution().

void EnableTime(): The GPS time ISR is called in PostExecution().

virtual void PostExecution(): This function is executed after calling the ISR. It schedules the GPS time interrupt process for activation in GpsDelay seconds, then schedules itself for the next full second.

virtual void PreExecution(): The function is executed prior to calling the ISR. It prompts the clock to capture its value into the GPS registers.

void SetTimeVector (int area): Obtains and sets the interrupt vector of the GPS time receiver.


last modified: Fri Feb 5 18:56:05 1999