The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
pit.h
Go to the documentation of this file.
1#pragma once
2
3#include "common/stdint.h"
4
5// default PIT interrupt frequency in Hz (scheduler tick rate).
6#define PIT_FREQUENCY_HZ 100u
7
8/**
9 * initializes the PIT timer.
10 *
11 * @param frequency desired interrupt frequency in Hz.
12 */
13void pit_initialize(uint32_t frequency);
14
15/**
16 * returns the number of PIT interrupts since initialization.
17 *
18 * @return number of timer ticks since PIT initialization.
19 */
21
22/**
23 * wait for a time with PIT channel 2, without interrupts. the wait is a
24 * busy loop, for short waits in boot code (the start of the other cores).
25 * only one core may use channel 2 at a time; the APIC timer calibration at
26 * boot also uses it.
27 *
28 * @param us the time to wait, in microseconds.
29 */
30void pit_delay_us(uint32_t us);
unsigned int uint32_t
Definition fb.h:17
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
uint64_t pit_get_ticks(void)
returns the number of PIT interrupts since initialization.
Definition pit.c:99
void pit_initialize(uint32_t frequency)
initializes the PIT timer.
Definition pit.c:56
void pit_delay_us(uint32_t us)
wait for a time with PIT channel 2, without interrupts.
Definition pit.c:106