MAG - CGAZV5N1.ZIP - TIMER.H

 
Output of file : TIMER.H contained in archive : CGAZV5N1.ZIP

/********* Listing 6 **************** TIMER.H **********
* Header for timing functions
* Copyright as per Listing 1
**********************************************************/

#define TIMER_0 0x40 /* 8254 Timer I/O ports */
#define TIMER_1 0x41
#define TIMER_2 0x42
#define TIMER_CWD 0x43 /* 8254 Control Word */
#define CLK_IN 1193182L /* Clock freqency ÷ 1.19 Mhz */

/* combine one item from each list with "OR" for control words */

#define BINARY 0x00 /* count in binary (default) */
#define BCD 0x01 /* count in BCD */

#define LATCH_CNT 0x00 /* latch both for read, MSB first */
#define ADDR_HI 0x20 /* read/write only high byte */
#define ADDR_LO 0x10 /* read/write only low byte */
#define ADDR_BOTH 0x30 /* read/write LSB then MSB */

#define COUNTER_0 0x00 /* channel 0 */
#define COUNTER_1 0x40 /* channel 1 */
#define COUNTER_2 0x80 /* channel 2 */

#define SQUARE_WAVE 0x06 /* Used for channel 2 sound */