This library contains RTC functions for the DS1672U, the real time clock included in the TINIm400 reference module.
For detailed information on the DS1672U, please see the Low-Voltage Serial Timekeeping Chip.
Go to the source code of this file.
Defines | |
| #define | DEVICE_ADDRESS 0xD0 |
| #define | COUNTER_ADDRESS 0x00 |
| #define | CONTROL_ADDRESS 0x04 |
| #define | TRICKLECHARGER_ADDRESS 0x05 |
| #define | TRICKLECHARGER_DISABLE 0xF0 |
| #define | START_CLOCK 0x7F |
| #define | STOP_CLOCK 0x80 |
| #define | NODIODE_250OHM 0xA5 |
| #define | ONEDIODE_250OHM 0xA9 |
| #define | NODIODE_2KOHM 0xA6 |
| #define | ONEDIODE_2KOHM 0xAA |
| #define | NODIODE_4KOHM 0xA7 |
| #define | ONEDIODE_4KOHM 0xAB |
| #define | TINI_RTC_VERSION 1 |
Functions | |
| int | rtc_version () |
| Return the library version. | |
| int | rtc_startclock () |
| Start oscillator to count clock by setting MSB of control register to 0. | |
| int | rtc_stopclock () |
| Stop oscillator to pause clock by setting MSB of control register to 1. | |
| int | rtc_setcontrolregister (unsigned char newvalue) |
| Write value to 8 bit control register. | |
| int | rtc_getcontrolregister (unsigned char *) |
| Fetch value of 8 bit control register. | |
| int | rtc_disabletricklecharger () |
| Disable trickle charger register by setting 4 LSB's to 0. | |
| int | rtc_enabletricklecharger0diode250ohm () |
| Set trickle charger register to work no diode and with 250ohm. | |
| int | rtc_enabletricklecharger1diode250ohm () |
| Set trickle charger register to work 1 diode and with 250ohm. | |
| int | rtc_enabletricklecharger0diode2kohm () |
| Set trickle charger register to work no diode and with 2Kohm. | |
| int | rtc_enabletricklecharger1diode2kohm () |
| Set trickle charger register to work 1 diode and with 2Kohm. | |
| int | rtc_enabletricklecharger0diode4kohm () |
| Set trickle charger register to work no diode and with 4Kohm. | |
| int | rtc_enabletricklecharger1diode4kohm () |
| Set trickle charger register to work 1 diode and with 4Kohm. | |
| int | rtc_settricklechargerregister (unsigned char newvalue) |
| Set trickle charger register new value. | |
| int | rtc_gettricklechargerregister (unsigned char *) |
| Fetch 8 bit trickle charger register content. | |
| int | rtc_getclock (long *) |
| Convert char array to long integer after fetch from 32 bit counter of RTC. | |
| int | rtc_setclock (long newvalue) |
| Convert long integer to char array and write to 32 bit counter of RTC. | |
|
|
Address of Control register. |
|
|
Starting address of 32 bits RTC counter.
|
|
|
Device address. |
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via no diode and 250 ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via no diode and 2K ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via no diode and 4K ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via one diode and 250 ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via one diode and 2K ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Trickle Charger register that connects Vcc & Vbackup via one diode and 4K ohm resistor when Trickle Charger is enabled .
|
|
|
Value of Control register that will start oscillator.
|
|
|
Value of Control register that will stop oscillator.
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the rtc_version function.
|
|
|
Address of Trickle Charger register. |
|
|
Value of Trickle Charger register that will disable it.
|
|
|
Disable trickle charger register by setting 4 LSB's to 0.
|
|
|
Set trickle charger register to work no diode and with 250ohm.
|
|
|
Set trickle charger register to work no diode and with 2Kohm.
|
|
|
Set trickle charger register to work no diode and with 4Kohm.
|
|
|
Set trickle charger register to work 1 diode and with 250ohm.
|
|
|
Set trickle charger register to work 1 diode and with 2Kohm.
|
|
|
Set trickle charger register to work 1 diode and with 4Kohm.
|
|
|
Convert char array to long integer after fetch from 32 bit counter of RTC.
|
|
|
Fetch value of 8 bit control register.
|
|
|
Fetch 8 bit trickle charger register content.
|
|
|
Convert long integer to char array and write to 32 bit counter of RTC.
|
|
|
Write value to 8 bit control register.
|
|
|
Set trickle charger register new value.
|
|
|
Start oscillator to count clock by setting MSB of control register to 0.
|
|
|
Stop oscillator to pause clock by setting MSB of control register to 1.
|
|
|
Return the library version.
|
| Copyright 2005 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |