Class Ds3231
Realtime Clock DS3231.
public class Ds3231 : RtcBase
- Inheritance
-
Ds3231
- Inherited Members
Constructors
Ds3231(I2cDevice)
Initializes a new instance of the Ds3231 class.
public Ds3231(I2cDevice i2cDevice)
Parameters
i2cDevice
I2cDeviceThe I2C device used for communication.
Fields
DefaultI2cAddress
DS3231 Default I2C Address.
public const byte DefaultI2cAddress = 104
Field Value
Properties
EnabledAlarm
Gets or sets which of the two alarms is enabled.
public Ds3231Alarm EnabledAlarm { get; set; }
Property Value
Temperature
DS3231 Temperature.
public Temperature Temperature { get; }
Property Value
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.
ReadAlarmOne()
Reads the currently set alarm 1.
public Ds3231AlarmOne ReadAlarmOne()
Returns
- Ds3231AlarmOne
Alarm 1.
ReadAlarmTwo()
Reads the currently set alarm 2.
public Ds3231AlarmTwo ReadAlarmTwo()
Returns
- Ds3231AlarmTwo
Alarm 1.
ReadEnabledAlarm()
Reads which alarm is enabled.
protected Ds3231Alarm ReadEnabledAlarm()
Returns
- Ds3231Alarm
The enabled alarm.
ReadTemperature()
Read DS3231 Temperature.
protected double ReadTemperature()
Returns
- double
Temperature.
ReadTime()
Read Time from DS3231.
protected override DateTime ReadTime()
Returns
- DateTime
DS3231 Time.
ResetAlarmTriggeredStates()
Resets the triggered state of both alarms. This must be called after every alarm trigger otherwise the alarm cannot trigger again.
public void ResetAlarmTriggeredStates()
SetAlarmOne(Ds3231AlarmOne)
Sets alarm 1.
public void SetAlarmOne(Ds3231AlarmOne alarm)
Parameters
alarm
Ds3231AlarmOneNew alarm 1.
SetAlarmTwo(Ds3231AlarmTwo)
Sets alarm 2.
public void SetAlarmTwo(Ds3231AlarmTwo alarm)
Parameters
alarm
Ds3231AlarmTwoNew alarm 2.
SetEnabledAlarm(Ds3231Alarm)
Sets which alarm is enabled.
protected void SetEnabledAlarm(Ds3231Alarm alarmMode)
Parameters
alarmMode
Ds3231AlarmAlarm to enable.
SetTime(DateTime)
Set DS3231 Time.
protected override void SetTime(DateTime time)
Parameters
time
DateTimeTime.