@@ -41,12 +41,14 @@ Known family bytes, there are many other 1-Wire devices with unknown family.
4141| byte | device | description |
4242| :------:| :----------:| :--------------|
4343| 0x01 | DS2401 | UID device
44- | 0x26 | DS2438 | Battery monitor
45- | 0x2D | DS2807 | EEPROM
44+ | 0x05 | DS2405 | Switch
45+ | 0x10 | DS18S20 | thermometer
4646| 0x22 | DS1822 | thermometer
47- | 0x3B | DS1825 | thermometer
47+ | 0x26 | DS2438 | Battery monitor
4848| 0x28 | DS18B20 | thermometer
49- | 0x10 | DS18S20 | thermometer
49+ | 0x2D | DS2807 | EEPROM
50+ | 0x38 | DS1825 | thermometer
51+ | 0x3B | MAX31850 | thermometer
5052| 0x42 | DS28EA00 | thermometer
5153
5254
@@ -72,23 +74,42 @@ This DS2401 library supports only one device per pin, and no parasite mode.
7274The class supports getting an UID and compare an UID.
7375
7476- ** DS2401(OneWire \* ow)** constructor needs a reference to OneWire object.
75- - ** bool begin()** resets oneWire and search fot the address.
77+ - ** bool begin()** resets oneWire and search for the device address.
7678Returns true if address / UID of the device is found.
79+ Must be called to read the UID.
7780
7881
7982#### 8 bytes UID
8083
81- - ** void getUID(uint8_t \* buffer)** copies the found UID (64 bits) in ** begin()** to buffer which should be 8 bytes.
82- - ** bool compareUID(uint8_t \* buffer)** compares the buffer (8 bytes) with the internal UID.
83- Returns true if they are identical.
84+ - ** void getUID(uint8_t \* buffer)** copies the found UID (64 bits) in
85+ ** begin()** to a buffer which should be at least 8 bytes.
86+ - ** bool compareUID(uint8_t \* buffer)** compares the buffer (8 bytes)
87+ with the internal UID. Returns true if they are identical.
8488
8589
8690#### 6 bytes UID
8791
8892The 6 bytes interface does not use the family byte and the CRC byte in the UID.
93+ The reason is that these are either constant or can be calculated from the other
94+ bytes, so not unique.
8995
90- - ** void getUID6(uint8_t \* buffer)** copies the found UID (48 bits) in ** begin()** to buffer which should be 6 bytes.
91- - ** bool compareUID6(uint8_t \* buffer)** compares the buffer (6 bytes) with 6 bytes of the internal UID.
96+ - ** void getUID6(uint8_t \* buffer)** copies the found UID (48 bits) in
97+ ** begin()** to a buffer which should be at least 6 bytes.
98+ - ** bool compareUID6(uint8_t \* buffer)** compares the buffer (6 bytes)
99+ with 6 bytes of the internal UID.
100+ Returns true if they are identical.
101+
102+
103+ #### 4 bytes UID
104+
105+ The 4 bytes interface only uses 4 bytes of the unique part of the address.
106+ These functions are added as it allows to copy the number directly into a
107+ uint32_t variable.
108+
109+ - ** void getUID4(uint32_t \* buffer)** copies 4 unique bytes of the found UID
110+ to a uint32_t variable.
111+ - ** bool compareUID4(uint32_t \* buffer)** compares the uint32_t variable
112+ with 4 unique bytes of the internal UID.
92113Returns true if they are identical.
93114
94115
@@ -117,11 +138,12 @@ When the wires are longer this resistor needs to be smaller.
117138#### Must
118139
119140- Improve documentation.
141+ - test with different hardware.
142+ - verify UID4 interface with hardware
143+
120144
121145#### Should
122146
123- - example of compare function.
124- - test with different hardware.
125147
126148#### Could
127149
0 commit comments