Porrey.Uwp.IoT.Devices.Ds1307.Halt C# (CSharp) Method

Halt() public method

public Halt ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
		public async Task Halt()
		{
			byte[] readBuffer = new byte[1];
			byte[] writeBuffer = new byte[] { RTC_ADDRESS };

			// ***
			// *** Read the seconds
			// ***
			await this.WriteReadAsync(writeBuffer, readBuffer);
			int seconds = Bcd.ToInt((byte)(readBuffer[0] & 0x7f));

			// ***
			// *** Set bit 7
			// ***
			writeBuffer = new byte[] { RTC_ADDRESS, (byte)(seconds | 0x80) };
			await this.WriteAsync(writeBuffer);
		}