x12rtc.h
Go to the documentation of this file.00001 #ifndef _DEV_X12RTC_H_
00002 #define _DEV_X12RTC_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #include <dev/rtc.h>
00060
00061 #include <compiler.h>
00062
00065 #define X12RTC_SCA0 0x00
00066 #define X12RTC_SCA1 0x08
00067 #define X12RTC_SCA_ESC 0x80
00069 #define X12RTC_MNA0 0x01
00070 #define X12RTC_MNA1 0x09
00071 #define X12RTC_MNA_EMN 0x80
00073 #define X12RTC_HRA0 0x02
00074 #define X12RTC_HRA1 0x0A
00075 #define X12RTC_HRA_EHR 0x80
00077 #define X12RTC_DTA0 0x03
00078 #define X12RTC_DTA1 0x0B
00079 #define X12RTC_DTA_EDT 0x80
00081 #define X12RTC_MOA0 0x04
00082 #define X12RTC_MOA1 0x0C
00083 #define X12RTC_MOA_EMO 0x80
00085 #define X12RTC_YRA0 0x05
00086 #define X12RTC_YRA1 0x0D
00088 #define X12RTC_DWA0 0x06
00089 #define X12RTC_DWA1 0x0E
00090 #define X12RTC_DWA_EDW 0x80
00092 #define X12RTC_Y2K0 0x07
00093 #define X12RTC_Y2K1 0x0F
00095
00096
00098 #define X12RTC_BL 0x10
00100 #define X12RTC_BL_WD 0x18
00101 #define X12RTC_BL_WD_1750 0x00
00102 #define X12RTC_BL_WD_750 0x08
00103 #define X12RTC_BL_WD_250 0x10
00104 #define X12RTC_BL_WD_OFF 0x18
00106 #define X12RTC_BL_BP 0xE0
00107 #define X12RTC_BL_BP_NONE 0x00
00108 #define X12RTC_BL_BP_UQUAD 0x20
00109 #define X12RTC_BL_BP_UHALF 0x40
00110 #define X12RTC_BL_BP_FULL 0x60
00111 #define X12RTC_BL_BP_FIRST1 0x80
00112 #define X12RTC_BL_BP_FIRST2 0xA0
00113 #define X12RTC_BL_BP_FIRST3 0xC0
00114 #define X12RTC_BL_BP_FIRST8 0xE0
00116 #define X12RTC_INT 0x11
00118 #define X12RTC_INT_FO 0x14
00119 #define X12RTC_INT_FO_IRQ 0x00
00120 #define X12RTC_INT_FO_32KHZ 0x04
00121 #define X12RTC_INT_FO_100HZ 0x10
00122 #define X12RTC_INT_FO_1HZ 0x14
00124 #define X12RTC_INT_AL0E 0x20
00125 #define X12RTC_INT_AL1E 0x40
00126 #define X12RTC_INT_IM 0x80
00128 #define X12RTC_ATR 0x12
00130 #define X12RTC_DTR 0x13
00131 #define X12RTC_DTR_NONE 0x00
00132 #define X12RTC_DTR_PLUS10 0x02
00133 #define X12RTC_DTR_PLUS20 0x01
00134 #define X12RTC_DTR_PLUS30 0x03
00135 #define X12RTC_DTR_MINUS10 0x06
00136 #define X12RTC_DTR_MINUS20 0x05
00137 #define X12RTC_DTR_MINUS30 0x07
00139
00140
00142 #define X12RTC_SC 0x30
00143 #define X12RTC_MN 0x31
00144 #define X12RTC_HR 0x32
00145 #define X12RTC_HR_MIL 0x80
00146 #define X12RTC_DT 0x33
00147 #define X12RTC_MO 0x34
00148 #define X12RTC_YR 0x35
00149 #define X12RTC_DW 0x36
00150 #define X128xRTC_SSEC 0x37
00151 #define X122xRTC_Y2K 0x37
00153
00154
00156 #define X12RTC_SR 0x3F
00157 #define X12RTC_SR_RTCF 0x01
00158 #define X12RTC_SR_WEL 0x02
00159 #define X12RTC_SR_RWEL 0x04
00160 #define X12RTC_SR_AL0 0x20
00161 #define X12RTC_SR_AL1 0x40
00162 #define X12RTC_SR_BAT 0x80
00164
00165 extern NUTRTC rtcX12x6;
00166
00167 __BEGIN_DECLS
00168
00169 extern int X12Init(void) NUT_DEPRECATED;
00170
00171 extern int X12RtcGetClock(struct _tm *tm) NUT_DEPRECATED;
00172 extern int X12RtcSetClock(CONST struct _tm *tm) NUT_DEPRECATED;
00173 extern int X12RtcGetAlarm(int idx, struct _tm *tm, int *aflgs) NUT_DEPRECATED;
00174 extern int X12RtcSetAlarm(int idx, CONST struct _tm *tm, int aflgs) NUT_DEPRECATED;
00175 extern int X12RtcGetStatus(uint32_t *sflgs) NUT_DEPRECATED;
00176 extern int X12RtcClearStatus(uint32_t sflgs) NUT_DEPRECATED;
00177 extern int X12RtcReadRegs(uint8_t addr, uint8_t *buff, size_t len);
00178 extern int X12RtcWrite(int nv, CONST uint8_t *buff, size_t len);
00179
00180 extern int X12EepromRead(unsigned int addr, void *buff, size_t len);
00181 extern int X12EepromWrite(unsigned int addr, CONST void *buff, size_t len);
00182
00183 __END_DECLS
00184
00185 #endif