AvrIO
1.4.5
Bibliothèque C modulaire pour ATMEL AVR
Page principale
Pages associées
Modules
Structures de données
Exemples
rtc_ds1339.h
1
21
#ifndef _AVRIO_RTC_DS1339_H_
22
#define _AVRIO_RTC_DS1339_H_
23
24
#include <avrio/twi.h>
25
26
/* constants ================================================================ */
27
#define DS1339_BASE 0xD0
29
// -------------------------------------
30
#define DS1339_CK_SEC 0x00
31
#define DS1339_CK_MIN 0x01
32
#define DS1339_CK_HOUR 0x02
33
#define DS1339_CK_WDAY 0x03
34
#define DS1339_CK_DATE 0x04
35
#define DS1339_CK_MON 0x05
36
#define DS1339_CK_YEAR 0x06
37
38
// -------------------------------------
39
#define DS1339_A1_SEC 0x07
40
#define DS1339_A1_MIN 0x08
41
#define DS1339_A1_HOUR 0x09
42
#define DS1339_A1_DAY 0x0A
43
44
// -------------------------------------
45
#define DS1339_A2_MIN 0x0B
46
#define DS1339_A2_HOUR 0x0C
47
#define DS1339_A2_DAY 0x0D
48
49
// -------------------------------------
50
// Time/Alarm registers bits
51
#define b12n24 6
52
#define bPMnAM 5
53
#define bDYnDT 6
54
55
// -------------------------------------
56
#define DS1339_CONTROL 0x0E
57
// Control register bits
58
#define bnEOSC 7
59
#define bBBSQI 5
60
#define bRS2 4
61
#define bRS1 3
62
#define bINTCN 2
63
#define bA2IE 1
64
#define bA1IE 0
65
66
// -------------------------------------
67
#define DS1339_STATUS 0x0F
68
// Status register bits
69
#define bOSF 7
70
#define bA2F 1
71
#define bA1F 0
72
73
// -------------------------------------
74
#define DS1339_TCHARG 0x10
75
// Trickle charger register bits
76
#define bTCS3 7
77
#define bTCS2 6
78
#define bTCS1 5
79
#define bTCS0 4
80
#define bDS1 3
81
#define bDS0 2
82
#define bROUT1 1
83
#define bROUT0 0
84
85
86
/* ========================================================================== */
87
#endif
/* _AVRIO_RTC_DS1339_H_ not defined */
src
avrio
rtc_ds1339.h
Généré le Dimanche 14 Mai 2017 22:07:06 pour AvrIO par
1.8.11