Changeset 12 for ds1337

Show
Ignore:
Timestamp:
10/19/07 01:35:46 (15 months ago)
Author:
mlalondesvn
Message:

DS1624:

ADDED - Support for read/write to the EEPROM
ADDED - DS1624_USE_EEPROM Define in the config to enable eeprom functions
MODIF - Moved the start/stop conversion routine to the start/stopConversion() functions


DS1803 & DS1337:

FIXED - Removed r/w addresses and changed for single address

Location:
ds1337
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ds1337/ds1337.cpp

    r10 r12  
    3939     
    4040    // Check address and returns false is there is an error 
    41     if (Wire.checkAddress(DS1337_WADDR)) { 
     41    if (Wire.checkAddress(DS1337_ADDR)) { 
    4242        // Possibly set the default registers here 
    4343         
     
    5454        } 
    5555         
    56         return DS1337_WADDR; 
     56        return DS1337_ADDR; 
    5757    } else clockExists  = false; 
    5858     
     
    7272    } 
    7373     
    74     return DS1337_WADDR; 
     74    return DS1337_ADDR; 
    7575} 
    7676#endif 
     
    9090    if (!clockExists) return; 
    9191     
    92     Wire.beginTransmission(DS1337_WADDR); 
     92    Wire.beginTransmission(DS1337_ADDR); 
    9393    Wire.send(registerNumber); 
    9494     
     
    102102    if (!clockExists) return 0; 
    103103     
    104     Wire.beginTransmission(DS1337_WADDR); 
     104    Wire.beginTransmission(DS1337_ADDR); 
    105105    Wire.send(registerNumber); 
    106106    Wire.endTransmission(); 
    107107     
    108     Wire.requestFrom(DS1337_WADDR, 1); 
     108    Wire.requestFrom(DS1337_ADDR, 1); 
    109109     
    110110    while (!Wire.available()); 
     
    126126    if (!clockExists) return; 
    127127     
    128     Wire.beginTransmission(DS1337_WADDR); 
     128    Wire.beginTransmission(DS1337_ADDR); 
    129129    Wire.send(0x00); 
    130130    Wire.endTransmission(); 
    131131 
    132     Wire.requestFrom(DS1337_WADDR, 7); 
     132    Wire.requestFrom(DS1337_ADDR, 7); 
    133133    while (!Wire.available()); 
    134134     
     
    147147    clockStop(); 
    148148     
    149     Wire.beginTransmission(DS1337_WADDR); 
     149    Wire.beginTransmission(DS1337_ADDR); 
    150150    Wire.send(0x00); 
    151151     
     
    592592void DS1337::alarmSave(void) 
    593593{ 
    594     Wire.beginTransmission(DS1337_WADDR); 
     594    Wire.beginTransmission(DS1337_ADDR); 
    595595    Wire.send((alarmId == false ? DS1337_ALARM1 : DS1337_ALARM2)); 
    596596     
  • ds1337/ds1337.h

    r11 r12  
    3939 * Define the DS1337 I2C addresses 
    4040**/ 
    41 #ifndef DS1337_WADDR 
    42 #define DS1337_WADDR                    0x68 
    43 #endif 
    44 #define DS1337_RADDR                    DS1337_WADDR | 0x01 
     41#ifndef DS1337_ADDR 
     42#define DS1337_ADDR                 B01101000 
     43#endif 
    4544 
    4645/** 
     
    8887#define DS1337_ALARM_DT                 5 
    8988 
     89/** 
     90 * Match Day of the week or match date 
     91**/ 
    9092#define DS1337_ALARM_DT_DOW             true 
    9193#define DS1337_ALARM_DT_DATE            false