AceTime  0.8
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.
Public Member Functions | List of all members
ace_time::hw::DS3231 Class Reference

A class that reads and writes HardwareDateTime and HardwareTemperature from a DS3231 RTC chip. More...

#include <DS3231.h>

Public Member Functions

 DS3231 ()
 Constructor. More...
 
void readDateTime (HardwareDateTime *dateTime) const
 Read the time into the HardwareDateTime object. More...
 
void setDateTime (const HardwareDateTime &dateTime) const
 Set the DS3231 with the HardwareDateTime values. More...
 
void readTemperature (HardwareTemperature *temperature) const
 Read the temperature into the HardwareTemperature object. More...
 

Detailed Description

A class that reads and writes HardwareDateTime and HardwareTemperature from a DS3231 RTC chip.

This class is designed to access just enough features of the DS3231 chip to implement the ace_time::DS3231Clock class. It is not meant to provide access to all the features of the DS3231 chip. There are other libraries which are far better for that purpose.

According to https://learn.adafruit.com/i2c-addresses/the-list, the DS3231 is always on I2C address 0x68, so let's hardcode that.

Definition at line 29 of file DS3231.h.

Constructor & Destructor Documentation

◆ DS3231()

ace_time::hw::DS3231::DS3231 ( )
inlineexplicit

Constructor.

Definition at line 32 of file DS3231.h.

Member Function Documentation

◆ readDateTime()

void ace_time::hw::DS3231::readDateTime ( HardwareDateTime dateTime) const

Read the time into the HardwareDateTime object.

Definition at line 22 of file DS3231.cpp.

◆ readTemperature()

void ace_time::hw::DS3231::readTemperature ( HardwareTemperature temperature) const

Read the temperature into the HardwareTemperature object.

Definition at line 38 of file DS3231.cpp.

◆ setDateTime()

void ace_time::hw::DS3231::setDateTime ( const HardwareDateTime dateTime) const

Set the DS3231 with the HardwareDateTime values.

Definition at line 48 of file DS3231.cpp.


The documentation for this class was generated from the following files: