C# Class CyrusBuilt.MonoPi.RTC.DS1302

A Real-Time Clock (RTC) component for interfacing with a Dallas Semiconductor DS1302 RTC. This wraps the ds1302 module in wiringPi, and thus requires the wiringPi.so lib.
Inheritance: IDS1302
Mostra file Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
DS1302 ( IRaspiGpio clockPin, IRaspiGpio dataPin, IRaspiGpio csPin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.RTC.DS1302 class with the clock, data, and chip-select pins.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.RTC.DS1302 object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.RTC.DS1302. The Dispose method leaves the CyrusBuilt.MonoPi.RTC.DS1302 in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.RTC.DS1302 so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.RTC.DS1302 was occupying.

ReadClock ( ) : System.Int32[]

Reads the clock.

ReadRAM ( Int32 address ) : UInt32

Reads data from the specified RTC register.

ReadRTC ( Int32 register ) : UInt32

Reads a value from an RTC register or RAM location.

WriteClock ( Int32 data ) : void

Writes to the clock.

WriteRAM ( Int32 address, UInt32 data ) : void

Writes a value to the specified RAM address.

WriteRTC ( Int32 register, UInt32 data ) : void

Writes a value to an RTC register or RAM location.

Method Details

DS1302() public method

Initializes a new instance of the CyrusBuilt.MonoPi.RTC.DS1302 class with the clock, data, and chip-select pins.
public DS1302 ( IRaspiGpio clockPin, IRaspiGpio dataPin, IRaspiGpio csPin ) : System
clockPin IRaspiGpio /// The GPIO pin to use for the clock. ///
dataPin IRaspiGpio /// The GPIO pin to use for data. ///
csPin IRaspiGpio /// The GPIO pin to use for chip-select. ///
return System

Dispose() public method

Releases all resource used by the CyrusBuilt.MonoPi.RTC.DS1302 object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.RTC.DS1302. The Dispose method leaves the CyrusBuilt.MonoPi.RTC.DS1302 in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.RTC.DS1302 so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.RTC.DS1302 was occupying.
public Dispose ( ) : void
return void

ReadClock() public method

Reads the clock.
/// This instance has been disposed. ///
public ReadClock ( ) : System.Int32[]
return System.Int32[]

ReadRAM() public method

Reads data from the specified RTC register.
/// This instance has been disposed. ///
public ReadRAM ( Int32 address ) : UInt32
address System.Int32 /// The RAM address to read. ///
return System.UInt32

ReadRTC() public method

Reads a value from an RTC register or RAM location.
/// This instance has been disposed. ///
public ReadRTC ( Int32 register ) : UInt32
register System.Int32 /// The register or RAM location to read. ///
return System.UInt32

WriteClock() public method

Writes to the clock.
/// This instance has been disposed. /// /// is not 8 bytes in length. ///
public WriteClock ( Int32 data ) : void
data System.Int32 /// The byte buffer to write to the clock. ///
return void

WriteRAM() public method

Writes a value to the specified RAM address.
/// This instance has been disposed. ///
public WriteRAM ( Int32 address, UInt32 data ) : void
address System.Int32 /// The RAM address to write to. ///
data System.UInt32 /// The value to write. ///
return void

WriteRTC() public method

Writes a value to an RTC register or RAM location.
/// This instance has been disposed. ///
public WriteRTC ( Int32 register, UInt32 data ) : void
register System.Int32 /// The register or RAM location to write to. ///
data System.UInt32 /// The data value to write. ///
return void