HiDEOS Services Reference Manual

ServiceManager
ClockTime
TickTimer

Reference Manual
User Messages and Classes
Generated Header Files


ServiceManager

This class manages the chip and board level services available. Only one instance of this class is allowed in a running HiDEOS system. That instance in created by the system at boot time. Currently only tick timer services are available to the user.

#include "hideos/services.h"

void CurrentTime(ClockTime&);
Return the time which has elapsed since the system booted.

TickTimer* UseTickTimer();
Return a ticktimer if one is available. This class manages a pool of ticktimers. This is the function used to check one out of the pool.

void ReleaseTickTimer(TickTimer*& t);
Put a ticktimer back into the ticktimer pool.

void AddTickTimer(TickTimer* t);
Low level function used to register a tick timer. This function is used by the chip libraries to add ticktimer to the pool.


ClockTime

#include "hideos/services.h"

unsigned long sec
Seconds which have elapsed since the last boot.

unsigned long sec
Microseconds within the second.


TickTimer

This is a virtual base class. All ticktimers are implemented as subclasses. The user always manipulates the tick timer from this class. Using this method, the user does not need to know the chip level implementation of the tick timer or what chip the tick timer comes from.

#include "hideos/ticktimer.h"

typedef void* (*IRQ_TICK_FUNC)(void*);

virtual unsigned long Resolution()=0;
Implemented by subclass. Return the resolution of the timer in ticks per second.

virtual unsigned long CurrentValue()=0;
Implemented by subclass. Return the current tick count in the tick timer count register.

virtual void CompareValue(unsigned long)=0;
Implemented by subclass. Set the timer comparison value. Many timer allow an interrupt based on a current count match with a value in a compare register.

virtual void Clear()=0;
virtual void Disable()=0;
virtual void Enable()=0;
Implemented by subclass. Clear the timer's count register. Stop the timer from counting. Start the timer counting.

virtual void ResetMode()=0;
Put the counter into a reset on compare register match. The count register will be set to zero each time the count reaches the value in the compare register.

virtual void CycleMode()=0;
Counter will count continually, at overflow, the count just start over at zero.

virtual void EnableInterrupt()=0;
virtual void DisableInterrupt()=0;
Enable and disable the timer interrupt generating facility.

virtual void SetIntLevel(int level)=0;
Set the level at which the timer will generate interrupts. Three is a good level to use.

virtual void PeriodicInterrupt(ulong usec,int level, IRQ_TICK_FUNC func, void* parm)=0;
Set up interrupt handler func to be called with parameter parm when the timer generates an interrupt at level level. The timer will be set up to generate interrupts every usec microseconds. This is a time saving method of registering a periodic interrupt handler.

virtual void SetIntFunction(IRQ_TICK_FUNC func,void* parm)=0;
Set up interrupt handler func to be called with parameter parm when the timer generates an interrupt.


Argonne National Laboratory Copyright Information
Jim Kowalkowski ([email protected])
updated 4/12/95