Unit DS1307

From Ultibo.org
Revision as of 02:18, 18 January 2017 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Maxim DS1307 Real Time Clock Driver unit

The Maxim DS1307 is an I2C interface, battery backed real time clock chip with full BCD clock and calendar and 56 bytes of software accessible NVRAM. The chip supports 12 or 24 hour format and is widely used in low cost RTC devices available from a range of suppliers.

This driver extends the real time clock API to include functions for directly reading and writing the NVRAM which could be used for storing device specific information and configuration or for non volatile storage of keys, passwords or tokens.

Constants



[Expand]
DS1307 specific constants DS1307_*


[Expand]
DS1307 chip constants DS1307_CHIP_*


[Expand]
DS1307 RTC register constants DS1307_REG_*


[Expand]
DS1307 control and status register constants DS1307_REG_*


[Expand]
DS1307 seconds register constants DS1307_REG_SECONDS_*


[Expand]
DS1307 hour register constants DS1307_REG_HOUR_*


[Expand]
MCP794XX weekday register constants MCP794XX_REG_WEEKDAY_*


[Expand]
DS1337 month register constants DS1337_REG_MONTH_*


[Expand]
DS1307 control register constants DS1307_REG_CONTROL_*


[Expand]
DS1337 control register constants DS1337_REG_CONTROL_*


[Expand]
DS1340 control register constants DS1340_REG_CONTROL_*


[Expand]
DS1340 flag register constants DS1340_REG_FLAG_*


[Expand]
DS1337 status register constants DS1337_REG_STATUS_*


[Expand]
RX8025 control1 register constants RX8025_REG_CONTROL1_*


[Expand]
RX8025 control2 register constants RX8025_REG_CONTROL2_*


Type definitions



DS1307 RTC time

[Expand]

PDS1307RTCTime = ^TDS1307RTCTime;

TDS1307RTCTime = array[0..6] of Byte;

DS1307 RTC device

[Expand]

PDS1307RTCDevice = ^TDS1307RTCDevice;

TDS1307RTCDevice = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure DS1307Init;
Description: To be documented


DS1307 RTC functions

[Expand]
function DS1307RTCStart(RTC:PRTCDevice):LongWord;
Description: To be documented


[Expand]
function DS1307RTCStop(RTC:PRTCDevice):LongWord;
Description: To be documented


[Expand]
function DS1307RTCGetTime(RTC:PRTCDevice):Int64;
Description: To be documented


[Expand]
function DS1307RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
Description: To be documented


DS1307 helper functions

[Expand]
function DS1307ReadRTC(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):LongWord;
Description: To be documented


[Expand]
function DS1307WriteRTC(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):LongWord;
Description: To be documented


[Expand]
function DS1307ReadNVRAM(RTC:PRTCDevice; Offset:Byte; Buffer:Pointer; Size:LongWord):LongWord;
Description: To be documented


[Expand]
function DS1307WriteNVRAM(RTC:PRTCDevice; Offset:Byte; Buffer:Pointer; Size:LongWord):LongWord;
Description: To be documented


[Expand]
function DS1307ReadControl(RTC:PRTCDevice; var Control:Byte):LongWord;
Description: To be documented


[Expand]
function DS1307WriteControl(RTC:PRTCDevice; Control:Byte):LongWord;
Description: To be documented


[Expand]
function DS1307DefaultRTCTime(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):Boolean;
Description: To be documented


[Expand]
function DS1307FileTimeToRTCTime(RTC:PRTCDevice; const FileTime:Int64; Buffer:Pointer; Size:LongWord):Boolean;
Description: To be documented


[Expand]
function DS1307RTCTimeToFileTime(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord; var FileTime:Int64):Boolean;
Description: To be documented


Return to Unit Reference