00001 #include "ds1631.h" 00002 00003 void ds1631_setup() { 00004 i2c_setup(); 00005 } 00006 00007 void ds1631_set_config(uns8 addr, uns8 config) 00008 { 00009 i2c_write_eeprom(0x90 + addr, ds1631_access_config, config); 00010 } 00011 00012 uns8 ds1631_get_config(uns8 addr) 00013 { 00014 return i2c_read_eeprom(0x90 + addr, ds1631_access_config); 00015 } 00016 00017 void ds1631_convert_temp(uns8 addr) { 00018 i2c_start(); 00019 i2c_send_byte(0x90 + addr); 00020 i2c_send_byte(ds1631_start_convert); 00021 i2c_stop(); 00022 } 00023 00024 uns16 ds1631_get_temp(uns8 addr) 00025 { 00026 00027 return i2c_read_eeprom_16bit(0x90 + addr, ds1631_read_temp); 00028 00029 }