Class Ds1302
Realtime Clock Ds1302.
[Interface("Realtime Clock Ds1302")]
public class Ds1302 : RtcBase
- Inheritance
-
Ds1302
- Inherited Members
Constructors
Ds1302(int, int, int, GpioController?, bool)
Initializes a new instance of the Ds1302 class.
public Ds1302(int clockPin, int dataPin, int communicationEnabledPin, GpioController? controller = null, bool shouldDispose = true)
Parameters
clockPin
intClock pin number.
dataPin
intData pin number.
communicationEnabledPin
intCommunication enabled pin number.
controller
GpioControllerGpio controller.
shouldDispose
boolTrue to dispose the Gpio Controller.
Exceptions
- ArgumentNullException
When pin numbers are not valid.
Methods
Dispose(bool)
Releases the unmanaged resources used by the RtcBase and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposing
boolTrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Halt()
Halts the clock.
public void Halt()
IsHalted()
Checks if the clock is halted.
public bool IsHalted()
Returns
- bool
true when clock is halted, else false
ReadTime()
Read time from the device.
protected override DateTime ReadTime()
Returns
- DateTime
Time from the device.
SetTime(DateTime)
Sets date and time.
protected override void SetTime(DateTime time)
Parameters
time
DateTimeDate and time.