1 1.3 soren /* $NetBSD: pcf8583reg.h,v 1.3 2013/08/07 19:38:45 soren Exp $ */ 2 1.1 thorpej 3 1.1 thorpej /* 4 1.1 thorpej * Ben Harris, 2000 5 1.1 thorpej * 6 1.1 thorpej * This file is in the public domain 7 1.1 thorpej */ 8 1.1 thorpej 9 1.1 thorpej /* 10 1.1 thorpej * Philips PCF8583 RTC registers 11 1.1 thorpej */ 12 1.1 thorpej 13 1.1 thorpej /* We only have clock mode registers here */ 14 1.1 thorpej 15 1.1 thorpej #ifndef _PCF8583REG_H 16 1.1 thorpej #define _PCF8583REG_H 17 1.1 thorpej 18 1.1 thorpej /* 19 1.1 thorpej * PCF8583 RTC I2C address: 20 1.1 thorpej * 21 1.1 thorpej * 101 0000 22 1.1 thorpej */ 23 1.3 soren #define PCF8583_ADDRMASK 0x3ff 24 1.1 thorpej #define PCF8583_ADDR 0x50 25 1.1 thorpej 26 1.1 thorpej #define PCF8583_REG_CSR 0x00 27 1.1 thorpej #define PCF8583_REG_CENTI 0x01 28 1.1 thorpej #define PCF8583_REG_SEC 0x02 29 1.1 thorpej #define PCF8583_REG_MIN 0x03 30 1.1 thorpej #define PCF8583_REG_HOUR 0x04 31 1.1 thorpej #define PCF8583_REG_YEARDATE 0x05 32 1.1 thorpej #define PCF8583_REG_WKDYMON 0x06 33 1.1 thorpej #define PCF8583_REG_TIMER 0x07 34 1.1 thorpej #define PCF8583_REG_ALMCTL 0x08 35 1.1 thorpej #define PCF8583_REG_ALMCENTI 0x09 36 1.1 thorpej #define PCF8583_REG_ALMSEC 0x0a 37 1.1 thorpej #define PCF8583_REG_ALMMIN 0x0b 38 1.1 thorpej #define PCF8583_REG_ALMHOUR 0x0c 39 1.1 thorpej #define PCF8583_REG_ALMDAY 0x0d 40 1.1 thorpej #define PCF8583_REG_ALMMON 0x0e 41 1.1 thorpej #define PCF8583_REG_ALMTIMER 0x0f 42 1.1 thorpej 43 1.1 thorpej #define PCF8583_NVRAM_START 0x10 44 1.1 thorpej #define PCF8583_NVRAM_SIZE 240 45 1.1 thorpej 46 1.1 thorpej #define PCF8583_CSR_TIMER 0x01 47 1.1 thorpej #define PCF8583_CSR_SECTICK 0x01 48 1.1 thorpej #define PCF8583_CSR_ALARM 0x02 49 1.1 thorpej #define PCF8583_CSR_MINTICK 0x02 50 1.1 thorpej #define PCF8583_CSR_ALARMENABLE 0x04 51 1.1 thorpej #define PCF8583_CSR_MASK 0x08 52 1.1 thorpej #define PCF8583_CSR_FN_MASK 0x30 53 1.1 thorpej #define PCF8583_CSR_FN_32768HZ 0x00 54 1.1 thorpej #define PCF8583_CSR_FN_50HZ 0x10 55 1.1 thorpej #define PCF8583_CSR_FN_EVENT 0x20 56 1.1 thorpej #define PCF8583_CSR_FN_TEST 0x30 57 1.1 thorpej #define PCF8583_CSR_HOLD 0x40 58 1.1 thorpej #define PCF8583_CSR_STOP 0x80 59 1.1 thorpej 60 1.1 thorpej #define PCF8583_HOUR_MASK 0x3f 61 1.1 thorpej #define PCF8583_HOUR_PM 0x40 62 1.1 thorpej #define PCF8583_HOUR_12H 0x80 63 1.1 thorpej 64 1.1 thorpej #define PCF8583_DATE_MASK 0x3f 65 1.1 thorpej #define PCF8583_YEAR_MASK 0xc0 66 1.1 thorpej #define PCF8583_YEAR_SHIFT 6 67 1.1 thorpej 68 1.1 thorpej #define PCF8583_MON_MASK 0x1f 69 1.1 thorpej #define PCF8583_WKDY_MASK 0xe0 70 1.1 thorpej #define PCF8583_WKDY_SHIFT 5 71 1.1 thorpej 72 1.1 thorpej #define PCF8583_ALMCTL_TIMER_MASK 0x07 73 1.1 thorpej #define PCF8583_ALMCTL_TIMER_OFF 0x00 74 1.1 thorpej #define PCF8583_ALMCTL_TIMER_CENTI 0x01 75 1.1 thorpej #define PCF8583_ALMCTL_TIMER_SEC 0x02 76 1.1 thorpej #define PCF8583_ALMCTL_TIMER_MIN 0x03 77 1.1 thorpej #define PCF8583_ALMCTL_TIMER_HOUR 0x04 78 1.1 thorpej #define PCF8583_ALMCTL_TIMER_DAY 0x05 79 1.1 thorpej #define PCF8583_ALMCTL_TIMER_TEST 0x07 80 1.1 thorpej #define PCF8583_ALMCTL_TIMERINT 0x08 81 1.1 thorpej #define PCF8583_ALMCTL_CLKALM_MASK 0x30 82 1.1 thorpej #define PCF8583_ALMCTL_CLKALM_NONE 0x00 83 1.1 thorpej #define PCF8583_ALMCTL_CLKALM_DAILY 0x10 84 1.1 thorpej #define PCF8583_ALMCTL_CLKALM_WKDY 0x20 85 1.1 thorpej #define PCF8583_ALMCTL_CLKALM_DATED 0x30 86 1.1 thorpej #define PCF8583_ALMCTL_TIMERALM 0x40 87 1.1 thorpej #define PCF8583_ALMCTL_ALMINT 0x80 88 1.1 thorpej 89 1.1 thorpej #endif /* _PCF8583REG_H */ 90