public Task<DateTimeOffset> GetAsync()
{
DateTimeOffset returnValue = DateTime.MinValue;
byte[] readBuffer = new byte[7];
byte[] writeBuffer = new byte[] { RTC_ADDRESS };
this.WriteReadAsync(writeBuffer, readBuffer);
returnValue = new DateTime
(
Bcd.ToInt(readBuffer[6]) + 2000, // Year
Bcd.ToInt(readBuffer[5]), // Month
Bcd.ToInt(readBuffer[4]), // Day
Bcd.ToInt((byte)(readBuffer[2] & 0x3f)), // Hours over 24 hours (bit 6 is 24/12 hour format; 1 = 12, 0 = 24)
Bcd.ToInt(readBuffer[1]), // Minutes
Bcd.ToInt((byte)(readBuffer[0] & 0x7f)) // Seconds (bit 7 is the clock halt bit; 0 = enabled, 1 = halted)
);
return Task<DateTimeOffset>.FromResult(returnValue);
}