summaryrefslogtreecommitdiff
path: root/asm/asm_pit.h
blob: 785acb3b632ab8478b002b7ca610903de6fd40b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * @file
 *
 * PIT - Programmable Interval Timer
 *
 * config out timer on channel 0 : mode 2 (sys timer)
 * * http://en.wikipedia.org/wiki/Intel_8253#Control_Word_Register
 * * http://www.brokenthorn.com/Resources/OSDevPit.html
 * int0 will be triggered ~25 times a second.
 *
 * The most magic is performed in pit_interrupt_handler which calls 
 * the c function responsible for task switching doing vary bad ass 
 * magic... 
 */

#include <stdint.h>

/** install this interrupt handler to your Interrupt Vector Table */
void asm_pit_tick();

/** get number of ticks */
uint32_t asm_pit_get_ticks();

void asm_pit_sleep_50ms();
void asm_pit_sleep_40ms();
void asm_pit_sleep_10ms();
void asm_pit_sleep_1ms();

void asm_pit_rate_50ms();
void asm_pit_rate_40ms();
void asm_pit_rate_10ms();
void asm_pit_rate_1ms();