Skip to main content

Class Ds1307

Represents a DS1307 real-time clock

Assembly: Ds1307.dll
View Source
public class Ds1307 : II2cPeripheral

Implements:
Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

IsRunning

Stops or starts the clock oscillator Stopping the oscillator decreases power consumption (and stops the clock)

View Source
public bool IsRunning { get; set; }

Methods

GetTime()

Get the time from the real-time clock

View Source
public DateTime GetTime()
Returns

System.DateTime

SetTime(DateTime)

Set the time on the real-time clock

View Source
public void SetTime(DateTime time)
Parameters
TypeNameDescription
System.DateTimetimeThe new time

ReadRAM(int, int)

The DS1307 has 56 bytes of battery-backed RAM. Use this method to Read from that memory.

View Source
public byte[] ReadRAM(int offset, int count)
Returns

System.Byte[]

Parameters
TypeNameDescription
System.Int32offsetOffset to the start of the read (0-55)
System.Int32countThe number of bytes to read

WriteRAM(int, params byte[])

The DS1307 has 56 bytes of battery-backed RAM Use this method to Write to that memory

View Source
public void WriteRAM(int offset, params byte[] data)
Parameters
TypeName
System.Int32offset
System.Byte[]data

SquareWaveOutput(SquareWaveFrequency)

Square wave output

View Source
public void SquareWaveOutput(Ds1307.SquareWaveFrequency freq)
Parameters
TypeNameDescription
Meadow.Foundation.RTCs.Ds1307.SquareWaveFrequencyfreqThe frequency
Exceptions

System.NotSupportedException
Throw if invalid frequency is selected

Implements

  • Meadow.Hardware.II2cPeripheral