/*	$Id: ds1386reg.h,v 1.1 2003/10/06 11:47:53 pefo Exp $ */

/*
 * Copyright (c) 2003 Opsycon AB  (www.opsycon.se / www.opsycon.com)
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Opsycon AB, Sweden.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */
#ifndef _DS_1686REG_H_
#define _DS_1686REG_H_

/*
 *   Register definitions for Dallas Semiconductor DS1686 clock chip.
 */

#define	DS_REG_MSEC	0x00		/* Milliseconds reg */
#define	DS_REG_SEC	0x01		/* Seconds reg */
#define	DS_REG_MIN	0x02		/* Minutes reg */
#define	DS_REG_AMIN	0x03		/* Alarm Minutes reg */
#define	DS_REG_HOUR	0x04		/* Hours reg */
#define	DS_REG_AHOUR	0x05		/* Alarm Hours reg */
#define	DS_REG_WDAY	0x06		/* Day of week reg */
#define	DS_REG_AWDAY	0x07		/* Alarm Day of week reg */
#define	DS_REG_DATE	0x08		/* Day of month reg */
#define	DS_REG_MONTH	0x09		/* Month reg */
#define	DS_REG_YEAR	0x0a		/* Year reg */

#define	DS_REG_CTLB	0x0b		/* Control reg B */
#define	DS_REG_WDMS	0x0c		/* Watchdog milliseconds */
#define	DS_REG_WDS	0x0d		/* Watchdog seconds */


#define	DS_MONTH_E32K	0x40		/* Enable 32Khz out when 0 */
#define	DS_MONTH_EOSC	0x80		/* Enable oscilator when 0 */

#define DS_CTLB_TDF	0x01		/* Time of day alarm status */
#define	DS_CTLB_WAF	0x02		/* Watchdog alarm status */
#define	DS_CTLB_TDM	0x04		/* Time of day alarm mask */
#define	DS_CTLB_WAM	0x08		/* Watchdog alarm mask */
#define	DS_CTLB_PU	0x10		/* Interrupt in PULSE mode */
#define	DS_CTLB_IBH	0x20		/* Interrupt in current source mode */
#define	DS_CTLB_IPSW	0x40		/* Interrupt source switch */
#define	DS_CTLB_TE	0x80		/* Register transfer enable */

#endif /* _DS_1686REG_H_ */
