GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / arch / mips / board / p5064 / include / i8254.h
blobc5417d66c5cf744e29060ef579b8ebebb81c2e86
1 /*
2 * i8254.h: definitions for i8254 programmable interval timer in P5064
3 * Copyright (c) 1997 Algorithmics Ltd
4 */
6 /* Timer 0 is clock interrupt (irq0)
7 * Timer 1 is refresh clock
8 * Timer 2 is speaker tone
9 */
11 #define PT_CLOCK 0
12 #define PT_REFRESH 1
13 #define PT_SPEAKER 2
14 #define PT_CONTROL 3
16 #ifndef __ASSEMBLER__
17 struct i8254 {
18 unsigned char pt_counter0;
19 unsigned char pt_counter1;
20 unsigned char pt_counter2;
21 unsigned char pt_control;
24 #define pt_clock pt_counter0
25 #define pt_refresh pt_counter1
26 #define pt_speaker pt_counter2
28 #else
30 #define PT_REG(x) (x)
32 #endif
35 * control word definitions
37 #define PTCW_RBCMD (3<<6) /* read-back command */
38 #define PTCW_RB_NCNT 0x20 /* rb: no count */
39 #define PTCW_RB_NSTAT 0x10 /* rb: no status */
40 #define PTCW_RB_SC(x) (0x02<<(x)) /* rb: select counter x */
41 #define PTCW_SC(x) ((x)<<6) /* select counter x */
42 #define PTCW_CLCMD (0<<4) /* counter latch command */
43 #define PTCW_LSB (1<<4) /* r/w least signif. byte only */
44 #define PTCW_MSB (2<<4) /* r/w most signif. byte only */
45 #define PTCW_16B (3<<4) /* r/w 16 bits, lsb then msb */
46 #define PTCW_MODE(x) ((x)<<1) /* set mode to x */
47 #define PTCW_BCD 0x1 /* operate in BCD mode */
50 * Status word definitions
52 #define PTSW_OUTPUT 0x80 /* output pin active */
53 #define PTSW_NULL 0x40 /* null count */
56 * Mode definitions
58 #define MODE_ITC 0 /* interrupt on terminal count */
59 #define MODE_HROS 1 /* hw retriggerable one-shot */
60 #define MODE_RG 2 /* rate generator */
61 #define MODE_SQW 3 /* square wave generator */
62 #define MODE_STS 4 /* software triggered strobe */
63 #define MODE_HTS 5 /* hardware triggered strobe */
65 #define PT_CRYSTAL 14318180 /* timer crystal hz (ticks/sec) */