Fixed programming errors in the AVRISP-MKII project when the programming packet is...
[pub/USBasp.git] / Projects / TempDataLogger / Lib / DS1307.h
index 212cdfe..5181c3e 100644 (file)
 
                                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
                        {
                                } Fields;
 
                                uint8_t IntVal;
-                       } Byte3;
-               } DS1307_DateRegs_t;
+                       } Byte7;
+               } DS1307_DateTimeRegs_t;
 
        /* Macros: */
-               #define DS1307_ADDRESS_READ   (0xD0 | TWI_ADDRESS_READ)
-               #define DS1307_ADDRESS_WRITE  (0xD0 | TWI_ADDRESS_WRITE)
+               #define DS1307_ADDRESS       0xD0
 
        /* Function Prototypes: */
-               void DS1307_SetTimeDate(const TimeDate_t* NewTimeDate);
-               void DS1307_GetTimeDate(TimeDate_t* const TimeDate);
+               bool DS1307_SetTimeDate(const TimeDate_t* NewTimeDate);
+               bool DS1307_GetTimeDate(TimeDate_t* const TimeDate);
 
 #endif