AceTime  1.1
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(UNIX_HOST_DUINO)
10 
11 #include <stdint.h>
12 
13 namespace ace_time {
14 namespace hw {
15 
16 class HardwareDateTime;
17 class HardwareTemperature;
18 
33 class DS3231 {
34  public:
36  explicit DS3231() {}
37 
39  void readDateTime(HardwareDateTime* dateTime) const;
40 
42  void setDateTime(const HardwareDateTime& dateTime) const;
43 
45  void readTemperature(HardwareTemperature* temperature) const;
46 
47  private:
48  static const uint8_t kAddress = 0x68;
49 };
50 
51 }
52 }
53 
54 #endif
55 
56 #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:36
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:33