Mercurial > templog
comparison onewire.h @ 9:7da9a3f23592
Import ds18x20 code
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 18 May 2012 23:57:08 +0800 |
parents | 54d369e3d689 |
children |
comparison
equal
deleted
inserted
replaced
8:c55321727d02 | 9:7da9a3f23592 |
---|---|
14 /* Define OW_ONE_BUS if only one 1-Wire-Bus is used | 14 /* Define OW_ONE_BUS if only one 1-Wire-Bus is used |
15 in the application -> shorter code. | 15 in the application -> shorter code. |
16 If not defined make sure to call ow_set_bus() before using | 16 If not defined make sure to call ow_set_bus() before using |
17 a bus. Runtime bus-select increases code size by around 300 | 17 a bus. Runtime bus-select increases code size by around 300 |
18 bytes so use OW_ONE_BUS if possible */ | 18 bytes so use OW_ONE_BUS if possible */ |
19 // #define OW_ONE_BUS | 19 #define OW_ONE_BUS |
20 | 20 |
21 #ifdef OW_ONE_BUS | 21 #ifdef OW_ONE_BUS |
22 | 22 |
23 #define OW_PIN PD6 | 23 #define OW_PIN PB1 |
24 #define OW_IN PIND | 24 #define OW_IN PINB |
25 #define OW_OUT PORTD | 25 #define OW_OUT PORTB |
26 #define OW_DDR DDRD | 26 #define OW_DDR DDRB |
27 #define OW_CONF_DELAYOFFSET 0 | 27 #define OW_CONF_DELAYOFFSET 0 |
28 | 28 |
29 #else | 29 #else |
30 #if ( F_CPU < 1843200 ) | 30 #if ( F_CPU < 1843200 ) |
31 #warning | Experimental multi-bus-mode is not tested for | 31 #warning | Experimental multi-bus-mode is not tested for |