/*
 *	Copyright (c) 1986 by D.Friede & D.Konnerth
 */
/* @(#)clock.h	1.0 */
/*
 * Declarations for RTC NM58167
 *
 * Programmer: Dieter Konnerth 7.86
 *
 */

/* counter ports */

#define T_C_1000SEC	0x0200
#define T_C_100SEC	0x0202
#define T_C_SEC		0x0204
#define T_C_MIN		0x0206
#define T_C_HOUR	0x0208
#define T_C_WDAY	0x020A
#define T_C_DAY		0x020C
#define T_C_MONTH	0x020E

/* latch ports */

#define T_L_1000SEC	0x0210
#define T_L_100SEC	0x0212
#define T_L_SEC		0x0214
#define T_L_MIN		0x0216
#define T_L_HOUR	0x0218
#define T_L_WDAY	0x021A
#define T_L_DAY		0x021C
#define T_L_MONTH	0x021E

/* other ports */

#define T_INTSTAT	0x0220
#define T_INTCTRL	0x0222
#define T_CNTRESET	0x0224
#define T_LATCHRESET	0x0226
#define T_STATUS	0x0228
#define T_GOCMD		0x022A
#define T_STDBYINT	0x022C
#define T_TEST		0x023E

/* interupt modes */

#define T_COMPINT	0x01		/* interupt on latch compare */
#define T_NOINT		0x00		/* no interupt from clock    */

/* data values for reset */

#define T_R_1000SEC	0x01	/* thousands of sec */
#define T_R_100SEC	0x02
#define T_R_SEC		0x04
#define T_R_MIN		0x08
#define T_R_HOUR	0x10
#define T_R_WDAY	0x20	/* day of week */
#define T_R_DAY		0x40	/* day of month */
#define T_R_MONTH	0x80

#define	SECHR	(60*60)	/* seconds/hr */
#define	SECDAY	(24*SECHR)	/* seconds/day */
#define	SECYR	(365*SECDAY)	/* seconds/common year */

#define SET_TZONE	01	/* ioctl set time zone system variable	*/
#define GET_TZONE	02	/* ioctl get time zone system variable	*/
