]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - include/arch/x86/time/i8254.h
6 #include <irq/i8259a.h>
8 /* for setting reload value and reading current count */
9 #define PORT_CHANNEL_0_DATA 0x40
10 #define PORT_CHANNEL_1_DATA 0x41
11 #define PORT_CHANNEL_2_DATA 0x42
13 /* for configuring the channels */
14 #define PORT_MODE_CMD_REG 0x43
17 #define INT_ON_TERM_CNT 0x0
18 #define HW_RETRIGGER_ONESHOT 0x1
19 #define RATE_GENERATOR 0x2
20 #define SQUARE_WAVE_GENERATOR 0x3
21 #define SW_TRIGGERED_STROBE 0x4
22 #define HW_TRIGGERED_STROBE 0x5
25 #define ACMODE_COUNTER_LATCH_CMD 0x0
26 #define ACMODE_LSB_ONLY 0x1
27 #define ACMODE_MSB_ONLY 0x2
28 #define ACMODE_LSB_MSB 0x3
32 unsigned bcd
: 1, /* if set, uses BCD for reload value */
33 opmode
: 3, /* operating mode */
34 acmode
: 2, /* access mode */
35 channel
: 2; /* channel to configure */
40 extern unsigned int ticks
;
41 extern uint16_t reload
;
43 extern void i8254_configure_channel(char channel
, char opmode
, uint16_t new_reload
);
44 extern void i8254_irq_enable();