Functions | |
void | ds1631_convert_temp (uns8 addr) |
Start temperature conversion on ds1631. | |
uns8 | ds1631_get_config (uns8 addr) |
Get ds1631 config register. | |
uns16 | ds1631_get_temp (uns8 addr) |
Read temperature from ds1631. | |
void | ds1631_set_config (uns8 addr, uns8 config) |
Set ds1631 config register. | |
void | ds1631_setup () |
void ds1631_convert_temp | ( | uns8 | addr | ) |
This routine starts the temperature conversion in the ds1631. Issue this command before actually reading the temperature.
00052 { 00053 i2c_start(); 00054 i2c_send_byte(0x90 + addr); 00055 i2c_send_byte(ds1631_start_convert); 00056 i2c_stop(); 00057 }
uns8 ds1631_get_config | ( | uns8 | addr | ) |
Gets the ds1631 config register (memory location 0x01)
00048 { 00049 return i2c_read_eeprom(0x90 + addr, ds1631_access_config); 00050 }
uns16 ds1631_get_temp | ( | uns8 | addr | ) |
Returns 16bit raw temperature register from ds1631. Note that if you are in one-shot mode (the default) you must have already issued a start_convert and waited until it is complete (to check for completion you can either wait long enough, or query the config register to check).
00060 { 00061 00062 return i2c_read_eeprom_16bit(0x90 + addr, ds1631_read_temp); 00063 00064 }
void ds1631_set_config | ( | uns8 | addr, | |
uns8 | config | |||
) |
Sets the ds1631 config register
00043 { 00044 i2c_write_eeprom(0x90 + addr, ds1631_access_config, config); 00045 }
void ds1631_setup | ( | ) |
00038 { 00039 i2c_setup(); 00040 }