/trunk/libraries/ds1307/demo/ds1307__demo.c |
---|
30,9 → 30,9 |
#include "../ds1307.h" |
#include <twi/twi.h> |
#include <useful/datetime.h> |
#include <avr/io.h> |
#include <util/delay.h> |
#include <stdio.h> |
50,6 → 50,9 |
******************************************************************************/ |
int main(void) |
{ |
// Initialize TWI. |
twi__initialize(DS1307__CLOCK_RATE); |
// Initialize RTC. |
ds1307__initialize(); |
/trunk/libraries/ds1307/ds1307.h |
---|
38,6 → 38,16 |
#include <useful/datetime.h> |
/****************************************************************************** |
* Public macro definitions. |
******************************************************************************/ |
/**************************************************************************//** |
* \def DS1307__CLOCK_RATE |
* \brief DS1307 frequency in Hertz. |
******************************************************************************/ |
#define DS1307__CLOCK_RATE 100000 |
/****************************************************************************** |
* Public type definitions. |
******************************************************************************/ |
/trunk/libraries/ds1307/src/ds1307.c |
---|
52,8 → 52,6 |
#define DS1307__REGISTER_ADDRESS__YEAR 0x06 |
#define DS1307__REGISTER_ADDRESS__CONTROL 0x07 |
#define DS1307__CLOCK_RATE 100000 |
/****************************************************************************** |
* Private function prototypes. |
******************************************************************************/ |
84,8 → 82,9 |
( |
void |
){ |
// We don't initialize TWI here: we may have several devices on the bus. |
// Initialize TWI. |
twi__initialize(DS1307__CLOCK_RATE); |
//twi__initialize(DS1307__CLOCK_RATE); |
} |
/**************************************************************************//** |