dos3d

annotate src/pit8254.h @ 2:8c9a63a902d5

added palman to the dos makefile
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 Nov 2011 10:15:37 +0200
parents
children
rev   line source
nuclear@0 1 #ifndef PIT8254_H_
nuclear@0 2 #define PIT8254_H_
nuclear@0 3
nuclear@0 4 /* frequency of the oscillator driving the 8254 timer */
nuclear@0 5 #define OSC_FREQ_HZ 1193182
nuclear@0 6
nuclear@0 7 /* I/O ports connected to the 8254 */
nuclear@0 8 #define PORT_DATA0 0x40
nuclear@0 9 #define PORT_DATA1 0x41
nuclear@0 10 #define PORT_DATA2 0x42
nuclear@0 11 #define PORT_CMD 0x43
nuclear@0 12
nuclear@0 13 /* command bits */
nuclear@0 14 #define CMD_CHAN0 0
nuclear@0 15 #define CMD_CHAN1 (1 << 6)
nuclear@0 16 #define CMD_CHAN2 (2 << 6)
nuclear@0 17 #define CMD_RDBACK (3 << 6)
nuclear@0 18
nuclear@0 19 #define CMD_LATCH 0
nuclear@0 20 #define CMD_ACCESS_LOW (1 << 4)
nuclear@0 21 #define CMD_ACCESS_HIGH (2 << 4)
nuclear@0 22 #define CMD_ACCESS_BOTH (3 << 4)
nuclear@0 23
nuclear@0 24 #define CMD_OP_INT_TERM 0
nuclear@0 25 #define CMD_OP_ONESHOT (1 << 1)
nuclear@0 26 #define CMD_OP_RATE (2 << 1)
nuclear@0 27 #define CMD_OP_SQWAVE (3 << 1)
nuclear@0 28 #define CMD_OP_SW_STROBE (4 << 1)
nuclear@0 29 #define CMD_OP_HW_STROBE (5 << 1)
nuclear@0 30
nuclear@0 31 #define CMD_MODE_BIN 0
nuclear@0 32 #define CMD_MODE_BCD 1
nuclear@0 33
nuclear@0 34 #endif /* PIT8254_H_ */