RTEMS 6.1-rc4
Loading...
Searching...
No Matches
pcf8563.h
1/*
2 * RTEMS generic MPC5200 BSP
3 *
4 * This file contains declarations for the pcf8563 RTC driver.
5 *
6 * Based on:
7 * This file contains the definitions for Dallas Semiconductor
8 * DS1307/DS1308 serial real-time clock/NVRAM.
9 */
10
11/*
12 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
13 * Author: Victor V. Vengerov <vvv@oktet.ru>
14 * Copyright (c) 2005 embedded brains GmbH & Co. KG
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef __RTC_PCF8563__
22#define __RTC_PCF8563__
23
24#define PCF8563_I2C_ADDRESS (0xA2) /* I2C bus address assigned to PCF8563 */
25
26#define PCF8563_CONTROL1_ADR (0x00)
27#define PCF8563_CONTROL1_TEST1 (0x80) /* EXT_CLK test mode */
28#define PCF8563_CONTROL1_STOP (0x20) /* stop RTC source clock, clear divider*/
29#define PCF8563_CONTROL1_TESTC (0x08) /* enable power-on reset override */
30 /***********/
31#define PCF8563_CONTROL2_ADR (0x01)
32#define PCF8563_CONTROL2_TITP (0x10) /* 0: int output is level */
33#define PCF8563_CONTROL2_AF (0x08) /* alarm flag */
34#define PCF8563_CONTROL2_TF (0x04) /* timer flag */
35#define PCF8563_CONTROL2_AIE (0x02) /* alarm interrupt enable */
36#define PCF8563_CONTROL2_TIE (0x01) /* timer interrupt enable */
37 /***********/
38
39#define PCF8563_SECOND_ADR (0x02)
40#define PCF8563_SECOND_VL (0x80) /* clock integrity no longer guaranteed */
41#define PCF8563_SECOND_MASK (0x7f)
42 /***********/
43
44#define PCF8563_MINUTE_ADR (0x03)
45#define PCF8563_MINUTE_MASK (0x7f)
46 /***********/
47
48#define PCF8563_HOUR_ADR (0x04)
49#define PCF8563_HOUR_MASK (0x3f)
50 /***********/
51
52#define PCF8563_DAY_ADR (0x05)
53#define PCF8563_DAY_MASK (0x3f)
54
55#define PCF8563_DAY_OF_WEEK_ADR (0x06)
56#define PCF8563_DAY_OF_WEEK_MASK (0x07)
57
58#define PCF8563_MONTH_ADR (0x07)
59#define PCF8563_MONTH_MASK (0x1f)
60#define PCF8563_MONTH_CENTURY (0x80)
61 /***********/
62
63#define PCF8563_YEAR_ADR (0x08)
64#define PCF8563_YEAR_MASK (0xff)
65
66#define PCF8563_MINUTE_ALARM_ADR (0x09)
67#define PCF8563_HOUR_ALARM_ADR (0x0A)
68#define PCF8563_DAY_ALARM_ADR (0x0B)
69#define PCF8563_DAY_OF_WEEK_ALARM_ADR (0x0C)
70#define PCF8563_XXX_ALARM_AE (0x80)
71 /***********/
72
73#define PCF8563_CLKOUTCTL_ADR (0x0D)
74#define PCF8563_CLKOUTCTL_FE (0x80) /* */
75#define PCF8563_CLKOUTCTL_FD (0x03) /* */
76 /***********/
77
78#define PCF8563_TIMERCTL_ADR (0x0E)
79#define PCF8563_TIMERCTL_FE (0x80) /* */
80#define PCF8563_TIMERCTL_FD (0x03) /* */
81 /***********/
82
83#define PCF8563_TIMER_ADR (0x0F)
84
85#endif /* __RTC_PCF8563__ */