celtic / akari

My attempt at bringing light to operating system development.

This URL has Read+Write access

celtic (author)
Sat Jun 13 00:07:58 -0700 2009
commit  24cf1cf9194b91e5b29088b8cb755eb6901e2f20
tree    ed8996f3fb5da5333e8662f570ffb2afa11513a7
parent  8b62939f66e6192c78c7888d9b727cfbe0cffa13
akari / AkariTimerSubsystem.cpp
100644 19 lines (14 sloc) 0.598 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <AkariTimerSubsystem.hpp>
#include <arch.hpp>
 
AkariTimerSubsystem::AkariTimerSubsystem()
{ }
 
u8 AkariTimerSubsystem::VersionMajor() const { return 0; }
u8 AkariTimerSubsystem::VersionMinor() const { return 1; }
const char *AkariTimerSubsystem::VersionManufacturer() const { return "Akari"; }
const char *AkariTimerSubsystem::VersionProduct() const { return "Akari Timer Manager"; }
 
void AkariTimerSubsystem::SetTimer(u16 hz) {
u16 r = 0x1234dc / hz;
AkariOutB(0x43, 0x36); // 0b00110110; not BCD, square, LSB+MSB, c0
AkariOutB(0x40, r & 0xFF);
AkariOutB(0x40, (r >> 8) & 0xFF);
}