diff options
author | Florian Jung <flo@windfisch.org> | 2015-11-29 00:30:43 +0100 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-11-29 00:30:43 +0100 |
commit | 84b980994934d54b3dad6dd2184830f4464b9933 (patch) | |
tree | 9e5eb6fb283e791ff50f85c6d97d28ccc7dca6b6 /avr/1wire.h | |
parent | 1923a8c9121788804a4e307688b6c45993f58205 (diff) |
usb hello world \o/
Diffstat (limited to 'avr/1wire.h')
-rw-r--r-- | avr/1wire.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/avr/1wire.h b/avr/1wire.h new file mode 100644 index 0000000..d5657ad --- /dev/null +++ b/avr/1wire.h @@ -0,0 +1,27 @@ +#ifndef _1wire_h_ +#define _1wire_h_ +#define MATCH_ROM 0x55 +#define SKIP_ROM 0xCC +#define SEARCH_ROM 0xF0 + +#define CONVERT_T 0x44 // DS1820 commands +#define READ 0xBE +#define WRITE 0x4E +#define EE_WRITE 0x48 +#define EE_RECALL 0xB8 + +#define SEARCH_FIRST 0xFF // start new search +#define PRESENCE_ERR 0xFF +#define DATA_ERR 0xFE +#define LAST_DEVICE 0x00 // last device found +// 0x01 ... 0x40: continue searching + +uint8_t w1_reset(void); + +uint8_t w1_byte_wr( uint8_t b ); +uint8_t w1_byte_rd( void ); + +uint8_t w1_rom_search( uint8_t diff, uint8_t idata *id ); + +void w1_command( uint8_t command, uint8_t idata *id ); +#endif |