GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / arch / mips / board / p6064 / include / i8254.h
blobdb20bd045fbf391dd4b26cd78220f755bf676469
1 /*
2 * i8254.h: definitions for i8254 programmable interval timer in P5064
4 * Copyright (c) 1997-1999, Algorithmics Ltd. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the "Free MIPS" License Agreement, a copy of
8 * which is available at:
10 * http://www.algor.co.uk/ftp/pub/doc/freemips-license.txt
12 * You may not, however, modify or remove any part of this copyright
13 * message if this program is redistributed or reused in whole or in
14 * part.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * "Free MIPS" License for more details.
22 /* Timer 0 is clock interrupt (irq0)
23 * Timer 1 is refresh clock
24 * Timer 2 is speaker tone
27 #define PT_CLOCK 0
28 #define PT_REFRESH 1
29 #define PT_SPEAKER 2
30 #define PT_CONTROL 3
32 #ifndef __ASSEMBLER__
33 struct i8254 {
34 unsigned char pt_counter0;
35 unsigned char pt_counter1;
36 unsigned char pt_counter2;
37 unsigned char pt_control;
40 #define pt_clock pt_counter0
41 #define pt_refresh pt_counter1
42 #define pt_speaker pt_counter2
44 #else
46 #define PT_REG(x) (x)
48 #endif
51 * control word definitions
53 #define PTCW_RBCMD (3<<6) /* read-back command */
54 #define PTCW_RB_NCNT 0x20 /* rb: no count */
55 #define PTCW_RB_NSTAT 0x10 /* rb: no status */
56 #define PTCW_RB_SC(x) (0x02<<(x)) /* rb: select counter x */
57 #define PTCW_SC(x) ((x)<<6) /* select counter x */
58 #define PTCW_CLCMD (0<<4) /* counter latch command */
59 #define PTCW_LSB (1<<4) /* r/w least signif. byte only */
60 #define PTCW_MSB (2<<4) /* r/w most signif. byte only */
61 #define PTCW_16B (3<<4) /* r/w 16 bits, lsb then msb */
62 #define PTCW_MODE(x) ((x)<<1) /* set mode to x */
63 #define PTCW_BCD 0x1 /* operate in BCD mode */
66 * Status word definitions
68 #define PTSW_OUTPUT 0x80 /* output pin active */
69 #define PTSW_NULL 0x40 /* null count */
72 * Mode definitions
74 #define MODE_ITC 0 /* interrupt on terminal count */
75 #define MODE_HROS 1 /* hw retriggerable one-shot */
76 #define MODE_RG 2 /* rate generator */
77 #define MODE_SQW 3 /* square wave generator */
78 #define MODE_STS 4 /* software triggered strobe */
79 #define MODE_HTS 5 /* hardware triggered strobe */
81 #define PT_CRYSTAL 14318180 /* timer crystal hz (ticks/sec) */