Class Pcf8523
Represents a PCF8523 real-time clock
Assembly: Pcf8523.dll
View Source
public class Pcf8523 : II2cPeripheral, IRealTimeClock, IBatteryBackedPeripheral
Implements:
Meadow.Hardware.II2cPeripheral, Meadow.Hardware.IRealTimeClock, Meadow.IBatteryBackedPeripheral
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
IsRunning
Stops or starts the clock oscillator
View Source
public bool IsRunning { get; set; }
IsAlarmInterruptEnabled
Gets or sets whether the alarm interrupt is enabled.
View Source
public bool IsAlarmInterruptEnabled { get; set; }
HasTimerAInterruptTriggered
Gets whether timer A is set (indicating a timer event occurred)
View Source
public bool HasTimerAInterruptTriggered { get; }
HasTimerBInterruptTriggered
Gets or sets whether timer B is set (indicating a timer event occurred)
View Source
public bool HasTimerBInterruptTriggered { get; }
IsAlarmInterruptGenerated
Gets or sets whether the alarm flag is set (indicating an alarm occurred)
View Source
public bool IsAlarmInterruptGenerated { get; }
IsTimerAInterruptEnabled
Gets or sets whether the delay timer interrupt is enabled.
View Source
public bool IsTimerAInterruptEnabled { get; set; }
IsTimerBInterruptEnabled
Gets or sets whether the delay timer interrupt is enabled.
View Source
public bool IsTimerBInterruptEnabled { get; set; }
Methods
IsBatteryLow()
Reads the battery low indicator register bit
View Source
public bool IsBatteryLow()
Returns
System.Boolean
GetTime()
Reads the RTC time
View Source
public DateTimeOffset GetTime()
Returns
System.DateTimeOffset
SetTime(DateTimeOffset)
Sets the RTC time
View Source
public void SetTime(DateTimeOffset time)
Parameters
| Type | Name |
|---|---|
System.DateTimeOffset | time |
SetAlarm(DateTimeOffset)
Sets the alarm time.
View Source
public void SetAlarm(DateTimeOffset alarmTime)
Parameters
| Type | Name | Description |
|---|---|---|
System.DateTimeOffset | alarmTime | The DateTimeOffset to trigger the alarm. |
SetTimerA(byte, DelayTimeUnit)
Configures the delay interrupt timer A and enables interrupt
View Source
public void SetTimerA(byte value, DelayTimeUnit unit)
Parameters
| Type | Name | Description |
|---|---|---|
System.Byte | value | The delay duration in seconds or minutes (1 - 255) |
| Meadow.Foundation.RTCs.DelayTimeUnit | unit | The time unit for the delay. |
SetTimerB(byte, DelayTimeUnit)
Configures the delay interrupt timer B enables interrupt
View Source
public void SetTimerB(byte value, DelayTimeUnit unit)
Parameters
| Type | Name | Description |
|---|---|---|
System.Byte | value | The delay duration in seconds or minutes (1 - 255) |
| Meadow.Foundation.RTCs.DelayTimeUnit | unit | The time unit for the delay. |
ClearFlags()
Clears the alarm and delay interrupt flags
View Source
public void ClearFlags()
Implements
Meadow.Hardware.II2cPeripheralMeadow.Hardware.IRealTimeClockMeadow.IBatteryBackedPeripheral