Mercurial > ~darius > hgwebdir.cgi > tempctrl
diff 1wire.h @ 41:5898fba6593c
Add temperature control.
- Split out console stuff to cons.[ch]. Set up stdio so we can use printf etc.
- Use \r\n as the line terminator consistently.
- Add OWGetTemp to get temperatures from a device.
- Load/save settings in EEPROM, defaults loaded from flash.
Nearly feature complete except you can't edit ROM IDs without a programming tool :)
(To be fixed)
Needs more testing.
author | darius@inchoate.localdomain |
---|---|
date | Sun, 06 Jul 2008 22:19:53 +0930 |
parents | 0aa6bf4b98ae |
children | efd44dc40934 |
line wrap: on
line diff
--- a/1wire.h Thu Nov 22 16:02:40 2007 +0000 +++ b/1wire.h Sun Jul 06 22:19:53 2008 +0930 @@ -41,6 +41,7 @@ void OWCRC(uint8_t x, uint8_t *crc); void OWSendCmd(uint8_t *ROM, uint8_t cmd); uint8_t OWProgROM(uint8_t *ROM, uint8_t start, uint8_t len, uint8_t *data, uint8_t exact, uint8_t status); +int16_t OWGetTemp(uint8_t *ROM); /* Return codes for OWFirst()/OWNext() */ #define OW_BADWIRE -3 @@ -75,3 +76,9 @@ /* Family codes */ #define OW_FAMILY_ROM 0x09 #define OW_FAMILY_TEMP 0x10 + +/* Return codes for OWGetTemp */ +#define OW_TEMP_BADVAL -1000 +#define OW_TEMP_WRONG_FAM -1000 +#define OW_TEMP_CRC_ERR -1001 +#define OW_TEMP_NO_ROM -1002