comparison 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
comparison
equal deleted inserted replaced
40:1061fdbdc44f 41:5898fba6593c
39 uint8_t OWFirst(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only); 39 uint8_t OWFirst(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only);
40 uint8_t OWNext(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only); 40 uint8_t OWNext(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only);
41 void OWCRC(uint8_t x, uint8_t *crc); 41 void OWCRC(uint8_t x, uint8_t *crc);
42 void OWSendCmd(uint8_t *ROM, uint8_t cmd); 42 void OWSendCmd(uint8_t *ROM, uint8_t cmd);
43 uint8_t OWProgROM(uint8_t *ROM, uint8_t start, uint8_t len, uint8_t *data, uint8_t exact, uint8_t status); 43 uint8_t OWProgROM(uint8_t *ROM, uint8_t start, uint8_t len, uint8_t *data, uint8_t exact, uint8_t status);
44 int16_t OWGetTemp(uint8_t *ROM);
44 45
45 /* Return codes for OWFirst()/OWNext() */ 46 /* Return codes for OWFirst()/OWNext() */
46 #define OW_BADWIRE -3 47 #define OW_BADWIRE -3
47 #define OW_BADCRC -2 48 #define OW_BADCRC -2
48 #define OW_NOPRESENCE -1 49 #define OW_NOPRESENCE -1
73 #define OW_WRITE_STATUS 0x55 74 #define OW_WRITE_STATUS 0x55
74 75
75 /* Family codes */ 76 /* Family codes */
76 #define OW_FAMILY_ROM 0x09 77 #define OW_FAMILY_ROM 0x09
77 #define OW_FAMILY_TEMP 0x10 78 #define OW_FAMILY_TEMP 0x10
79
80 /* Return codes for OWGetTemp */
81 #define OW_TEMP_BADVAL -1000
82 #define OW_TEMP_WRONG_FAM -1000
83 #define OW_TEMP_CRC_ERR -1001
84 #define OW_TEMP_NO_ROM -1002