Table of Contents

Class Ds1302

Namespace
Iot.Device.Rtc
Assembly
Iot.Device.Ds1302.dll

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 int

Clock pin number.

dataPin int

Data pin number.

communicationEnabledPin int

Communication enabled pin number.

controller GpioController

Gpio controller.

shouldDispose bool

True 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 bool

True 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 DateTime

Date and time.