Subversion Repositories idreammicro-avr

Compare Revisions

Ignore whitespace Rev 58 → Rev 57

/trunk/libraries/ds1307/src/ds1307.c
40,7 → 40,8
* Private macros.
******************************************************************************/
 
#define DS1307__ADDRESS 0xD0
#define DS1307__ADDRESS 0x68
#define DS1307__SLAVE_ADDRESS (DS1307__ADDRESS << 1)
 
#define DS1307__REGISTER_ADDRESS__SECONDS 0x00
#define DS1307__REGISTER_ADDRESS__MINUTES 0x01
91,12 → 92,12
assert(NULL != p_hour_mode);
 
twi__start();
twi__send_slaw(DS1307__ADDRESS);
twi__send_slaw(DS1307__SLAVE_ADDRESS);
twi__send_data(DS1307__REGISTER_ADDRESS__SECONDS);
twi__stop();
 
twi__start();
twi__send_slar(DS1307__ADDRESS);
twi__send_slar(DS1307__SLAVE_ADDRESS);
uint8_t seconds = 0;
twi__receive_data_ack(&seconds);
uint8_t minutes = 0;
138,7 → 139,7
assert(NULL != p_time);
 
twi__start();
twi__send_slaw(DS1307__ADDRESS);
twi__send_slaw(DS1307__SLAVE_ADDRESS);
twi__send_data(DS1307__REGISTER_ADDRESS__SECONDS);
 
uint8_t seconds = ((p_time->seconds / 10) << 4) + (p_time->seconds % 10);
178,12 → 179,12
assert(NULL != p_date);
 
twi__start();
twi__send_slaw(DS1307__ADDRESS);
twi__send_slaw(DS1307__SLAVE_ADDRESS);
twi__send_data(DS1307__REGISTER_ADDRESS__DAY);
twi__stop();
 
twi__start();
twi__send_slar(DS1307__ADDRESS);
twi__send_slar(DS1307__SLAVE_ADDRESS);
 
uint8_t day = 0;
twi__receive_data_ack(&day);
218,7 → 219,7
assert(NULL != p_date);
 
twi__start();
twi__send_slaw(DS1307__ADDRESS);
twi__send_slaw(DS1307__SLAVE_ADDRESS);
twi__send_data(DS1307__REGISTER_ADDRESS__DAY);
 
uint8_t date = ((p_date->date / 10) << 4) + (p_date->date % 10);
/trunk/libraries/ds1307/demo/ds1307__demo.c
1,6 → 1,6
/**************************************************************************//**
* \brief DS1307 RTC library - Demonstration program
* \author Copyright (C) 2009 Julien Le Sech - www.idreammicro.com
* \author Copyright (C) 2011 Julien Le Sech - www.idreammicro.com
* \version 1.0
* \date 20090501
*
21,7 → 21,7
******************************************************************************/
 
/**************************************************************************//**
* \file ds1307__demo.c
* \file demo_ds1307.c
******************************************************************************/
 
/******************************************************************************