Skip to main content

IRtcControllerProvider Interface

Namespace: GHIElectronics.TinyCLR.Devices.Rtc.Provider · Assembly: GHIElectronics.TinyCLR.Devices.Rtc

Provider contract for an RTC controller.

public interface IRtcControllerProvider : IDisposable

Properties

IsValid

bool IsValid { get; }

True when the RTC has been initialized with a valid time at least once.

InternalRC

bool InternalRC { get; }

True when clocked from the internal RC oscillator.

BackupMemorySize

uint BackupMemorySize { get; }

Size in bytes of the battery-backed memory region.

Methods

GetTime()

RtcDateTime GetTime()

Reads the current calendar time.

Returns RtcDateTime

SetTime(RtcDateTime value)

void SetTime(RtcDateTime value)

Sets the RTC time.

ParameterTypeDescription
valueRtcDateTimeCalendar time to write.

WriteBackupMemory(byte[] sourceData, uint sourceOffset, uint destinationOffset, int count)

void WriteBackupMemory(byte[] sourceData, uint sourceOffset, uint destinationOffset, int count)

Writes a slice of bytes to backup memory.

ParameterTypeDescription
sourceDatabyte[]Source buffer.
sourceOffsetuintStarting offset within sourceData.
destinationOffsetuintStarting offset in backup memory.
countintNumber of bytes to write.

ReadBackupMemory(byte[] destinationData, uint destinationOffset, uint sourceOffset, int count)

int ReadBackupMemory(byte[] destinationData, uint destinationOffset, uint sourceOffset, int count)

Reads a slice from backup memory.

ParameterTypeDescription
destinationDatabyte[]Destination buffer.
destinationOffsetuintStarting offset within destinationData.
sourceOffsetuintStarting offset in backup memory.
countintNumber of bytes to read.

Returns int — Number of bytes read.

SetChargeMode(BatteryChargeMode chargeMode)

void SetChargeMode(BatteryChargeMode chargeMode)

Configures the backup-battery trickle charger.

ParameterTypeDescription
chargeModeBatteryChargeModeCharging policy.

Calibrate(int pulse)

void Calibrate(int pulse)

Applies a frequency calibration pulse.

ParameterTypeDescription
pulseintPlatform-specific calibration value.