summaryrefslogtreecommitdiff
path: root/kc/core/pit8253.c
blob: 75e04679641d2f15c5f507ab641762c59fa9fdb5 (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
33
34
35
36
#include "pit8253.h"
#include "pic8259.h"
#include "port.h"

#define PIT8253_DATA0 0x40
#define PIT8253_CMD 0x43

#define SEL_CHANNEL0 0x0
#define ACC_LOHI 0x30
#define MODE_RATE 0x04
#define BIN_COUNT 0x0

#define CONFIG_CHANNEL_0 (SEL_CHANNEL0|ACC_LOHI|MODE_RATE|BIN_COUNT)

void pit8253_init(void)
{
    outb(PIT8253_CMD, CONFIG_CHANNEL_0);
    outb(PIT8253_DATA0, 0xff);
    outb(PIT8253_DATA0, 0xff);

    pic8259_irq_unmask(0);
}

void pit8253_start(void)
{
}

void pit8253_stop(void)
{
}

void pit8253_set_hz(uint16_t hz)
{
    (void)hz;
}