summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-04-03 22:39:02 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-04-03 22:39:02 +0200
commit71db59f69602e54c33ba707c8e4a7a66f6c9ca0b (patch)
treeaebcd29addd854bd3b0784b0ed8719f61fdf7afe
parentcd8e18ad94933f927ef7c453f7a1102f4e60fa8a (diff)
pit: Add more macros
* i386/i386/pit.h (PITAUX_VAL, PIT_C2): New macros. (PIT_RATEMODE): Fix macro value.
-rw-r--r--i386/i386/pit.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/i386/i386/pit.h b/i386/i386/pit.h
index e004c37c..cf0b74cc 100644
--- a/i386/i386/pit.h
+++ b/i386/i386/pit.h
@@ -58,6 +58,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* bits used in auxiliary control port for timer 2 */
#define PITAUX_GATE2 0x01 /* aux port, PIT gate 2 input */
#define PITAUX_OUT2 0x02 /* aux port, PIT clock out 2 enable */
+#define PITAUX_VAL 0x20 /* aux port, output */
#endif /* defined(AT386) */
/* Following are used for Timer 0 */
@@ -65,13 +66,17 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define PIT_LOADMODE 0x30 /* load least significant byte followed
* by most significant byte */
#define PIT_NDIVMODE 0x04 /*divide by N counter */
-#define PIT_SQUAREMODE 0x06 /* square-wave mode */
/* Used for Timer 1. Used for delay calculations in countdown mode */
#define PIT_C1 0x40 /* select counter 1 */
#define PIT_READMODE 0x30 /* read or load least significant byte
* followed by most significant byte */
-#define PIT_RATEMODE 0x06 /* square-wave mode for USART */
+
+#define PIT_SQUAREMODE 0x06 /* square-wave mode */
+#define PIT_RATEMODE 0x02 /* rate generator mode */
+
+/* Used for Timer 2. */
+#define PIT_C2 0x80 /* select counter 2 */
/*
* Clock speed for the timer in hz divided by the constant HZ