RTC based on the DS1307 chip connected via I2C and the Wire library.
More...
#include <RTClib.h>
RTC based on the DS1307 chip connected via I2C and the Wire library.
◆ begin()
bool RTC_DS1307::begin |
( |
TwoWire * |
wireInstance = &Wire | ) |
|
Start I2C for the DS1307 and test succesful connection.
- Parameters
-
wireInstance | pointer to the I2C bus |
- Returns
- True if Wire can find DS1307 or false otherwise.
◆ adjust()
void RTC_DS1307::adjust |
( |
const DateTime & |
dt | ) |
|
Set the date and time in the DS1307.
- Parameters
-
dt | DateTime object containing the desired date/time |
◆ isrunning()
uint8_t RTC_DS1307::isrunning |
( |
void |
| ) |
|
Is the DS1307 running? Check the Clock Halt bit in register 0.
- Returns
- 1 if the RTC is running, 0 if not
◆ now()
Get the current date and time from the DS1307.
- Returns
- DateTime object containing the current date and time
◆ readSqwPinMode()
Read the current mode of the SQW pin.
- Returns
- Mode as Ds1307SqwPinMode enum
◆ writeSqwPinMode()
Change the SQW pin mode.
- Parameters
-
◆ readnvram() [1/2]
uint8_t RTC_DS1307::readnvram |
( |
uint8_t |
address | ) |
|
Shortcut to read one byte from NVRAM.
- Parameters
-
address | NVRAM address, 0 to 55 |
- Returns
- The byte read from NVRAM
◆ readnvram() [2/2]
void RTC_DS1307::readnvram |
( |
uint8_t * |
buf, |
|
|
uint8_t |
size, |
|
|
uint8_t |
address |
|
) |
| |
Read data from the DS1307's NVRAM.
- Parameters
-
buf | Pointer to a buffer to store the data - make sure it's large enough to hold size bytes |
size | Number of bytes to read |
address | Starting NVRAM address, from 0 to 55 |
◆ writenvram() [1/2]
void RTC_DS1307::writenvram |
( |
uint8_t |
address, |
|
|
uint8_t |
data |
|
) |
| |
Shortcut to write one byte to NVRAM.
- Parameters
-
address | NVRAM address, 0 to 55 |
data | One byte to write |
◆ writenvram() [2/2]
void RTC_DS1307::writenvram |
( |
uint8_t |
address, |
|
|
const uint8_t * |
buf, |
|
|
uint8_t |
size |
|
) |
| |
Write data to the DS1307 NVRAM.
- Parameters
-
address | Starting NVRAM address, from 0 to 55 |
buf | Pointer to buffer containing the data to write |
size | Number of bytes in buf to write to NVRAM |
The documentation for this class was generated from the following files: