Difference between revisions of "Unit DS1307"
Line 420: | Line 420: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function DS1307RTCStart(RTC:PRTCDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function DS1307RTCStart(RTC:PRTCDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceStart API for DS1307 RTC</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | Not intended to be called directly by applications, use RTCDeviceStart instead |
|- | |- | ||
|} | |} | ||
Line 432: | Line 432: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function DS1307RTCStop(RTC:PRTCDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function DS1307RTCStop(RTC:PRTCDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceStop API for DS1307 RTC</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | Not intended to be called directly by applications, use RTCDeviceStop instead |
|- | |- | ||
|} | |} | ||
Line 444: | Line 444: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function DS1307RTCGetTime(RTC:PRTCDevice):Int64;</pre> | <pre style="border: 0; padding-bottom:0px;">function DS1307RTCGetTime(RTC:PRTCDevice):Int64;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceGetTime API for DS1307 RTC</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | Not intended to be called directly by applications, use RTCDeviceGetTime instead |
|- | |- | ||
|} | |} | ||
Line 456: | Line 456: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function DS1307RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;</pre> | <pre style="border: 0; padding-bottom:0px;">function DS1307RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of RTCDeviceSetTime API for DS1307 RTC</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | Not intended to be called directly by applications, use RTCDeviceSetTime instead |
|- | |- | ||
|} | |} |
Revision as of 01:35, 20 April 2017
Return to Unit Reference
Contents
[hide]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
DS1307_*
DS1307_CHIP_*
DS1307_REG_*
DS1307_REG_*
DS1307_REG_SECONDS_*
DS1307_REG_HOUR_*
MCP794XX_REG_WEEKDAY_*
DS1337_REG_MONTH_*
DS1307_REG_CONTROL_*
DS1337_REG_CONTROL_*
DS1340_REG_CONTROL_*
DS1340_REG_FLAG_*
DS1337_REG_STATUS_*
RX8025_REG_CONTROL1_*
RX8025_REG_CONTROL2_*
Type definitions
DS1307 RTC time
DS1307 RTC device
Public variables
None defined
Function declarations
Initialization functions
DS1307 RTC functions
function DS1307RTCStart(RTC:PRTCDevice):LongWord;
function DS1307RTCStop(RTC:PRTCDevice):LongWord;
function DS1307RTCGetTime(RTC:PRTCDevice):Int64;
function DS1307RTCSetTime(RTC:PRTCDevice; const Time:Int64):Int64;
DS1307 helper functions
function DS1307ReadRTC(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):LongWord;
function DS1307WriteRTC(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):LongWord;
function DS1307ReadNVRAM(RTC:PRTCDevice; Offset:Byte; Buffer:Pointer; Size:LongWord):LongWord;
function DS1307WriteNVRAM(RTC:PRTCDevice; Offset:Byte; Buffer:Pointer; Size:LongWord):LongWord;
function DS1307ReadControl(RTC:PRTCDevice; var Control:Byte):LongWord;
function DS1307WriteControl(RTC:PRTCDevice; Control:Byte):LongWord;
function DS1307DefaultRTCTime(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord):Boolean;
function DS1307FileTimeToRTCTime(RTC:PRTCDevice; const FileTime:Int64; Buffer:Pointer; Size:LongWord):Boolean;
function DS1307RTCTimeToFileTime(RTC:PRTCDevice; Buffer:Pointer; Size:LongWord; var FileTime:Int64):Boolean;
Return to Unit Reference