The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
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
*/
13
void
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
*/
20
uint64_t
pit_get_ticks
(
void
);
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
*/
30
void
pit_delay_us
(
uint32_t
us);
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
pit_get_ticks
uint64_t pit_get_ticks(void)
returns the number of PIT interrupts since initialization.
Definition
pit.c:99
pit_initialize
void pit_initialize(uint32_t frequency)
initializes the PIT timer.
Definition
pit.c:56
pit_delay_us
void pit_delay_us(uint32_t us)
wait for a time with PIT channel 2, without interrupts.
Definition
pit.c:106
src
drivers
pit
pit.h
Generated by
1.18.0