AceTime  1.7.5
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 #include <stdint.h>
10 
11 namespace ace_time {
12 namespace hw {
13 
14 class HardwareDateTime;
15 class HardwareTemperature;
16 
35 class DS3231 {
36  public:
38  explicit DS3231() {}
39 
41  void readDateTime(HardwareDateTime* dateTime) const;
42 
44  void setDateTime(const HardwareDateTime& dateTime) const;
45 
47  void readTemperature(HardwareTemperature* temperature) const;
48 
49  private:
50  static const uint8_t kAddress = 0x68;
51 };
52 
53 } // hw
54 } // ace_time
55 
56 #endif
ace_time::hw::DS3231::DS3231
DS3231()
Constructor.
Definition: DS3231.h:38
ace_time::hw::DS3231::setDateTime
void setDateTime(const HardwareDateTime &dateTime) const
Set the DS3231 with the HardwareDateTime values.
Definition: DS3231.cpp:45
ace_time::hw::HardwareTemperature
The temperature in Celcius as a signed (8.8) fixed-point integer.
Definition: HardwareTemperature.h:22
ace_time::hw::DS3231::readDateTime
void readDateTime(HardwareDateTime *dateTime) const
Read the time into the HardwareDateTime object.
Definition: DS3231.cpp:19
ace_time::hw::DS3231
A class that reads and writes HardwareDateTime and HardwareTemperature from a DS3231 RTC chip.
Definition: DS3231.h:35
ace_time::hw::DS3231::readTemperature
void readTemperature(HardwareTemperature *temperature) const
Read the temperature into the HardwareTemperature object.
Definition: DS3231.cpp:35
ace_time::hw::HardwareDateTime
The date (year, month, day) and time (hour, minute, second) fields supported by the DS3231 RTC chip.
Definition: HardwareDateTime.h:19