aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/TempDataLogger/Lib/DS1307.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-01-13 21:01:05 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-01-13 21:01:05 +0000
commit9c7594e7db5b06b2703a9975f2b250056ee0c212 (patch)
treeb7485a5db611dd1464bebb7a50974017c90f0668 /Projects/TempDataLogger/Lib/DS1307.h
parent7776aa4e2e7430da6fab1712816b887d21032dd9 (diff)
downloadlufa-9c7594e7db5b06b2703a9975f2b250056ee0c212.tar.gz
lufa-9c7594e7db5b06b2703a9975f2b250056ee0c212.tar.bz2
lufa-9c7594e7db5b06b2703a9975f2b250056ee0c212.zip
Oops - The DS1307 contains an unused "DayOfWeek" register that must be accounted for in the new unified DS1307 Time/Day read and write routines.
Diffstat (limited to 'Projects/TempDataLogger/Lib/DS1307.h')
-rw-r--r--Projects/TempDataLogger/Lib/DS1307.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/Projects/TempDataLogger/Lib/DS1307.h b/Projects/TempDataLogger/Lib/DS1307.h
index 212cdfecc..6269bb235 100644
--- a/Projects/TempDataLogger/Lib/DS1307.h
+++ b/Projects/TempDataLogger/Lib/DS1307.h
@@ -62,10 +62,18 @@
uint8_t IntVal;
} Byte3;
- } DS1307_TimeRegs_t;
- typedef struct
- {
+ union
+ {
+ struct
+ {
+ unsigned int DayOfWeek : 3;
+ unsigned int Reserved : 5;
+ } Fields;
+
+ uint8_t IntVal;
+ } Byte4;
+
union
{
struct
@@ -76,7 +84,7 @@
} Fields;
uint8_t IntVal;
- } Byte1;
+ } Byte5;
union
{
@@ -88,7 +96,7 @@
} Fields;
uint8_t IntVal;
- } Byte2;
+ } Byte6;
union
{
@@ -99,8 +107,8 @@
} Fields;
uint8_t IntVal;
- } Byte3;
- } DS1307_DateRegs_t;
+ } Byte7;
+ } DS1307_DateTimeRegs_t;
/* Macros: */
#define DS1307_ADDRESS_READ (0xD0 | TWI_ADDRESS_READ)