#[repr(C)]pub struct Hpet {
pub general_capabilities_and_id: ReadOnly<u64>,
pub general_configuration: Volatile<u64>,
pub general_interrupt_status: Volatile<u64>,
pub main_counter_value: Volatile<u64>,
pub timers: [HpetTimer; 32],
/* private fields */
}
Expand description
A structure that offers access to HPET through its I/O registers, specified by the format here: https://wiki.osdev.org/HPET#HPET_registers.
Fields§
§general_capabilities_and_id: ReadOnly<u64>
The General Capabilities and ID Register, at offset 0x0.
general_configuration: Volatile<u64>
The General Configuration Register, at offset 0x10.
general_interrupt_status: Volatile<u64>
The General Interrupt Status Register, at offset 0x20.
main_counter_value: Volatile<u64>
The Main Counter Value Register, at offset 0xF0.
timers: [HpetTimer; 32]
The timers (comparators) available for separate.
There is a minimum of 3 timers and a maximum of 32 in an HPET-enabled system.
Call num_timers
to get the actual number of HPET timers.
Implementations§
source§impl Hpet
impl Hpet
sourcepub fn get_counter(&self) -> u64
pub fn get_counter(&self) -> u64
Returns the HPET’s main counter value
sourcepub fn enable_counter(&mut self, enable: bool)
pub fn enable_counter(&mut self, enable: bool)
Turns on or off the main counter
sourcepub fn counter_period_femtoseconds(&self) -> u32
pub fn counter_period_femtoseconds(&self) -> u32
Returns the period of the HPET counter in femtoseconds, i.e., the length of time that one HPET tick takes.
Can be used to calculate the frequency of the HPET clock.
Must not be zero, must be less or equal to 0x05F5E100 (100 nanoseconds)