The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
pit.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

Macros

#define PIT_FREQUENCY_HZ   100u

Functions

void pit_initialize (uint32_t frequency)
 initializes the PIT timer.
uint64_t pit_get_ticks (void)
 returns the number of PIT interrupts since initialization.
void pit_delay_us (uint32_t us)
 wait for a time with PIT channel 2, without interrupts.

Macro Definition Documentation

◆ PIT_FREQUENCY_HZ

#define PIT_FREQUENCY_HZ   100u

Function Documentation

◆ pit_initialize()

void pit_initialize ( uint32_t frequency)

initializes the PIT timer.

Parameters
frequencydesired interrupt frequency in Hz.

◆ pit_get_ticks()

uint64_t pit_get_ticks ( void )

returns the number of PIT interrupts since initialization.

Returns
number of timer ticks since PIT initialization.

◆ pit_delay_us()

void pit_delay_us ( uint32_t us)

wait for a time with PIT channel 2, without interrupts.

the wait is a busy loop, for short waits in boot code (the start of the other cores). only one core may use channel 2 at a time; the APIC timer calibration at boot also uses it.

Parameters
usthe time to wait, in microseconds.