-
-
Notifications
You must be signed in to change notification settings - Fork 127
RtcDS1302 object
RtcDS1302 object provides access to all the functions of the DS1302 module. Along with date and time, this also includes retrieving and setting data into the non-volatile memory and defining what the charging settings are set at.
Construct a Rtc object using the provided WIRE method.
T_WIRE_METHOD - the typename of the class to use for the wire method. ThreeWire
is the normal hardware method class.
wire - the instance of the T_WIRE_METHOD to use. You must define an instance of ThreeWire and pass it in here.
Below is an example of how to create an instance of the object using the provided ThreeWire software Wire support. The pins used are arbitrary and defined by the sketch author as there is no hardware support.
#include <ThreeWire.h>
#include <RtcDS1302.h>
ThreeWire myWire(4,5,2); // IO, SCLK, CE
RtcDS1302<ThreeWire> Rtc(myWire);
The normal begin method that should be called within Setup()
<return>, if true the RTC has been write protected and will fail all calls that will write to it.
isWriteProtected - sets the RTC to be either write protected or write enabled.
<return>, the actual clock is running on the RTC.
isRunning - set if the clock is running. If false then the time value will not progress and less power is consumed
dt - the date and time to set the RTC to.
<return>, the current date and time in the RTC.
<return>, the trickle charge settings, a combination of flags from DS1302TcrResistor
, DS1302TcrDiodes
, and DS1302TcrStatus
.
setting - the settings to use for the trickle charge support. A combination of flags from DS1302TcrResistor
, DS1302TcrDiodes
, and DS1302TcrStatus
.
memoryAddress - (0-30) the address within the memory of the RTC to store a value.
value - the 8 bit value to store.
memoryAddress - (0-30) the address within the memory of the RTC to retrieve a value.
<return>, the value of that memory address
This will always use the starting address of zero due to limitations of the hardware API.
pValue - the pointer to a buffer of bytes
countBytes - the number of bytes to copy into the RTC memory
<return>, the number of bytes actually copied. This maybe smaller than countBytes due to reaching the end of the available memory address.
This will always use the starting address of zero due to limitations of the hardware API.
pValue - the pointer to a buffer of bytes to copy into
countBytes - the number of bytes to copy from the RTC memory
<return>, the number of bytes actually copied. This maybe smaller than countBytes due to reaching the end of the available memory address.