Home | History | Annotate | Line # | Download | only in dev
      1  1.3  msaitoh /*	$NetBSD: dp8573areg.h,v 1.3 2021/12/05 15:25:56 msaitoh Exp $	*/
      2  1.1   rumble 
      3  1.1   rumble /*
      4  1.1   rumble  * Copyright (c) 2003 Steve Rumble
      5  1.1   rumble  * Copyright (c) 2001 Erik Reid
      6  1.1   rumble  *
      7  1.1   rumble  * Redistribution and use in source and binary forms, with or without
      8  1.1   rumble  * modification, are permitted provided that the following conditions
      9  1.1   rumble  * are met:
     10  1.1   rumble  * 1. Redistributions of source code must retain the above copyright
     11  1.1   rumble  *    notice, this list of conditions and the following disclaimer.
     12  1.1   rumble  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1   rumble  *    notice, this list of conditions and the following disclaimer in the
     14  1.1   rumble  *    documentation and/or other materials provided with the distribution.
     15  1.1   rumble  * 3. The name of the author may not be used to endorse or promote products
     16  1.1   rumble  *    derived from this software without specific prior written permission.
     17  1.1   rumble  *
     18  1.1   rumble  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  1.1   rumble  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.1   rumble  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  1.1   rumble  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  1.1   rumble  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23  1.1   rumble  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24  1.1   rumble  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25  1.1   rumble  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26  1.1   rumble  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27  1.1   rumble  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28  1.1   rumble  */
     29  1.1   rumble 
     30  1.1   rumble #ifndef _DEV_IC_DP8573AREG_H_
     31  1.1   rumble #define _DEV_IC_DP8573AREG_H_
     32  1.1   rumble 
     33  1.1   rumble /*
     34  1.1   rumble  * National Semiconductor DP8573A Real Time Clock
     35  1.1   rumble  */
     36  1.1   rumble 
     37  1.1   rumble /* Control and Status Register Offsets and Masks */
     38  1.1   rumble #define	DP8573A_STATUS		0x00	/* Main Status */
     39  1.1   rumble #define DP8573A_STATUS_INTSTAT	0x01	/* Interrupt Status */
     40  1.1   rumble #define DP8573A_STATUS_PWRFAIL	0x02	/* Power Fail Interrupt */
     41  1.1   rumble #define DP8573A_STATUS_PERINT	0x04	/* Period Interrupt */
     42  1.1   rumble #define DP8573A_STATUS_ALMINT	0x08	/* Alarm Interrupt */
     43  1.1   rumble #define DP8573A_STATUS_REGSEL	0x40	/* Register Select */
     44  1.1   rumble 
     45  1.1   rumble /* Register Select = 0 */
     46  1.1   rumble #define	DP8573A_PFLAG		0x03	/* Periodic Flag */
     47  1.1   rumble #define DP8573A_PFLAG_MIN	0x01	/* Minutes */
     48  1.1   rumble #define DP8573A_PFLAG_10SEC	0x02	/* Ten Second */
     49  1.1   rumble #define DP8573A_PFLAG_SEC	0x04	/* Seconds */
     50  1.1   rumble #define DP8573A_PFLAG_100MIL	0x08	/* 100 Millisecond */
     51  1.1   rumble #define DP8573A_PFLAG_10MIL	0x10	/* 10 Millisecond */
     52  1.1   rumble #define DP8573A_PFLAG_MIL	0x20	/* Milliseconds */
     53  1.1   rumble #define DP8573A_PFLAG_OFSS	0x40	/* Oscillator Fail/Single Supply */
     54  1.1   rumble #define DP8573A_PFLAG_TESTMODE	0x80	/* Test Mode Enable */
     55  1.1   rumble 
     56  1.1   rumble #define	DP8573A_TIMESAVE_CTL	0x04	/* Time Save Control */
     57  1.1   rumble #define DP8573A_TIMESAVE_CTL_EN	0x80	/* Time Save Enable */
     58  1.1   rumble 
     59  1.1   rumble /* Register Select = 1 */
     60  1.1   rumble #define	DP8573A_RT_MODE		0x01	/* Real Time Mode */
     61  1.1   rumble #define DP8573A_RT_MODE_LYLSB	0x01	/* Leap Year LSB */
     62  1.1   rumble #define DP8573A_RT_MODE_LYMSB	0x02	/* Leap Year MSB */
     63  1.1   rumble #define DP8573A_RT_MODE_1224	0x04	/* 12(low)/24(high) Hour Mode */
     64  1.1   rumble #define DP8573A_RT_MODE_CLKSS	0x08	/* Clock Start(low)/Stop(high) */
     65  1.1   rumble #define DP8573A_RT_MODE_INTPFOP	0x10	/* Interrupt PF Operation */
     66  1.1   rumble 
     67  1.1   rumble #define	DP8573A_OUT_MODE	0x02	/* Output Mode */
     68  1.1   rumble #define DP8573A_OUT_MODE_MFOPO	0x80	/* MFO Pin as Oscillator */
     69  1.1   rumble 
     70  1.1   rumble #define	DP8573A_INT0_CTL	0x03	/* Interrupt Control 0 */
     71  1.1   rumble #define DP8573A_INT0_CTL_MIN	0x01	/* Minutes Enable */
     72  1.1   rumble #define DP8573A_INT0_CTL_10SEC	0x02	/* 10 Second Enable */
     73  1.1   rumble #define DP8573A_INT0_CTL_SEC	0x04	/* Seconds Enable */
     74  1.1   rumble #define DP8573A_INT0_CTL_100MIL	0x08	/* 100 Millisecond Enable */
     75  1.1   rumble #define DP8573A_INT0_CTL_10MIL	0x10	/* 10 Millisecond Enable */
     76  1.1   rumble #define DP8573A_INT0_CTL_MIL	0x20	/* Millisecond Enable */
     77  1.1   rumble 
     78  1.1   rumble #define	DP8573A_INT1_CTL	0x04	/* Interrupt Control 1 */
     79  1.1   rumble #define DP8573A_INT1_CTL_SECC	0x01	/* Second Compare Enable */
     80  1.1   rumble #define DP8573A_INT1_CTL_MINC	0x02	/* Minute Compare Enable */
     81  1.1   rumble #define DP8573A_INT1_CTL_HOURC	0x04	/* Hour Compare Enable */
     82  1.1   rumble #define DP8573A_INT1_CTL_DOMC	0x08	/* Day of Month Compare Enable */
     83  1.1   rumble #define DP8573A_INT1_CTL_MONTHC	0x10	/* Month Compare Enable */
     84  1.1   rumble #define DP8573A_INT1_CTL_DOWC	0x20	/* Day of Week Compare Enable */
     85  1.1   rumble #define DP8573A_INT1_CTL_ALMINT	0x40	/* Alarm Interrupt Enable */
     86  1.1   rumble #define DP8573A_INT1_CTL_PWRINT	0x80	/* Power Fail Interrupt Enable */
     87  1.1   rumble 
     88  1.1   rumble /* Clock Counter Offsets */
     89  1.1   rumble #define	DP8573A_COUNTERS	0x05	/* Start of Clock Counters */
     90  1.1   rumble #define DP8573A_SUBSECOND	0x05	/* 1/100 Second */
     91  1.1   rumble #define DP8573A_SECOND		0x06	/* Seconds */
     92  1.1   rumble #define DP8573A_MINUTE		0x07	/* Minutes */
     93  1.1   rumble #define DP8573A_HOUR		0x08	/* Hours */
     94  1.1   rumble #define DP8573A_DOM		0x09	/* Day of Month */
     95  1.1   rumble #define DP8573A_MONTH		0x0a	/* Months */
     96  1.1   rumble #define DP8573A_YEAR		0x0b	/* Years */
     97  1.1   rumble #define DP8573A_DOW		0x0e	/* Day of Week */
     98  1.1   rumble 
     99  1.3  msaitoh /* Comparison Registers */
    100  1.1   rumble #define DP8573A_CMP_SEC		0x13	/* Seconds */
    101  1.1   rumble #define DP8573A_CMP_MIN		0x14	/* Minutes */
    102  1.1   rumble #define DP8573A_CMP_HOUR	0x15	/* Hours */
    103  1.1   rumble #define DP8573A_CMP_DOM		0x16	/* Day of Month */
    104  1.1   rumble #define DP8573A_CMP_MONTH	0x17	/* Months */
    105  1.1   rumble #define DP8573A_CMP_DOW		0x18	/* Day of Week */
    106  1.1   rumble 
    107  1.1   rumble /* Time Save Registers */
    108  1.1   rumble #define DP8573A_SAVE_SEC	0x19	/* Seconds */
    109  1.1   rumble #define DP8573A_SAVE_MIN	0x1a	/* Minutes */
    110  1.1   rumble #define DP8573A_SAVE_HOUR	0x1b	/* Hours */
    111  1.1   rumble #define DP8573A_SAVE_DOM	0x1c	/* Day of Month */
    112  1.1   rumble #define DP8573A_SAVE_MONTH	0x1d	/* Months */
    113  1.1   rumble 
    114  1.1   rumble /* RAM Registers */
    115  1.1   rumble #define DP8573A_RAM_0C		0x0c	/* RAM */
    116  1.1   rumble #define DP8573A_RAM_1E		0x1e	/* RAM */
    117  1.1   rumble #define DP8573A_RAM_1F		0x1f	/* RAM */
    118  1.1   rumble 
    119  1.1   rumble /* 12/24 Hour Masks */
    120  1.1   rumble #define DP8573A_HOUR_12HR_MASK	0x1f
    121  1.1   rumble #define DP8573A_HOUR_24HR_MASK	0x3f
    122  1.1   rumble 
    123  1.1   rumble #endif	/* !_DEV_IC_DP8573AREG_H_ */
    124