Friedrich-Alexander-Universität Erlangen-Nürnberg  /   Technische Fakultät  /   Department Informatik
HPET::Timer Class Reference

Class abstracting a single HPET comparator. More...

#include <machine/hpet_timer.h>

Public Member Functions

 Timer (const Timer &)=delete
 
 Timer (Timer &&)=delete
 
Timeroperator= (const Timer &)=delete
 
Timeroperator= (Timer &&)=delete
 
void enable ()
 Activates interrupts (for the current comparator).
 
void disable ()
 Deactivates interrupts (for the current comparator).
 
bool isEnabled ()
 Checks whether interrupts are enabled for the current comparator.
 
TriggerMode getInterruptMode ()
 
void setInterruptMode (TriggerMode mode)
 
bool isPeriodicCapable ()
 Checks whether this timer is able to handle periodic timers. More...
 
TimerMode getMode ()
 
bool setMode (TimerMode mode)
 Sets the mode of operation. More...
 
uint64_t getValue ()
 
void setValue (uint64_t value)
 
CounterSize getCounterSize ()
 Returns the size of the value register.
 
bool setCounterSize (CounterSize size)
 Sets the size of the value register. More...
 

Detailed Description

Class abstracting a single HPET comparator.

Abstracts the access to comparators. This class does not have any constructor, as it is used to encapsulate hardware structures already residing in memory. Use HPET::GetTimer to obtain an instance for a particular HPET Timer.

Member Function Documentation

◆ isPeriodicCapable()

bool HPET::Timer::isPeriodicCapable ( )

Checks whether this timer is able to handle periodic timers.

Returns
true if able to handle periodic timers, false otherwise.

◆ setMode()

bool HPET::Timer::setMode ( TimerMode  mode)

Sets the mode of operation.

Sets the mode of operation and returns true on success. This is due to some comparators not supporting the periodic mode.

Returns
true if mode change succeeded, false otherwise.

◆ setCounterSize()

bool HPET::Timer::setCounterSize ( CounterSize  size)

Sets the size of the value register.

Sets the size of this comparators' value register and returns whether the operation was successful.

The HPET specification requires that 64-bit implementations support a 32-bit compatibility mode (i.e., it can be configured to function like the 32-bit counterpart). The limitation to 32 bits is needed to properly support architectures that are not able to read 64-bit values atomically.

The other way round, however, a 32-bit implementation does not need to support a 64-bit mode, in which case this function would return false.

Returns
true iff change was successful, false otherwise.

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