AceTime  0.7
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
DS3231.h
1 /*
2  * MIT License
3  * Copyright (c) 2018 Brian T. Park
4  */
5 
6 #ifndef ACE_TIME_HW_DS3231_H
7 #define ACE_TIME_HW_DS3231_H
8 
9 #if defined(ARDUINO) || defined(DOXYGEN)
10 
11 #include <stdint.h>
12 
13 namespace ace_time {
14 namespace hw {
15 
16 class HardwareDateTime;
17 class HardwareTemperature;
18 
29 class DS3231 {
30  public:
32  explicit DS3231() {}
33 
35  void readDateTime(HardwareDateTime* dateTime) const;
36 
38  void setDateTime(const HardwareDateTime& dateTime) const;
39 
41  void readTemperature(HardwareTemperature* temperature) const;
42 
43  private:
44  static const uint8_t kAddress = 0x68;
45 };
46 
47 }
48 }
49 
50 #endif
51 
52 #endif
void readDateTime(HardwareDateTime *dateTime) const
Read the time into the HardwareDateTime object.
Definition: DS3231.cpp:22
void readTemperature(HardwareTemperature *temperature) const
Read the temperature into the HardwareTemperature object.
Definition: DS3231.cpp:38
The temperature in Celcius as a signed (8.8) fixed-point integer.
void setDateTime(const HardwareDateTime &dateTime) const
Set the DS3231 with the HardwareDateTime values.
Definition: DS3231.cpp:48
DS3231()
Constructor.
Definition: DS3231.h:32
The date (year, month, day) and time (hour, minute, second) fields supported by the DS3231 RTC chip...
A class that reads and writes HardwareDateTime and HardwareTemperature from a DS3231 RTC chip...
Definition: DS3231.h:29