W1_SEARCH(9) | W1 API internal to the kernel | W1_SEARCH(9) |
NAME¶
w1_search - Performs a ROM Search & registers any devices found.
SYNOPSIS¶
void w1_search(struct w1_master * dev, u8 search_type, w1_slave_found_callback cb);
ARGUMENTS¶
struct w1_master * dev
u8 search_type
w1_slave_found_callback cb
DESCRIPTION¶
The 1-wire search is a simple binary tree search. For each bit of the address, we read two bits and write one bit. The bit written will put to sleep all devies that don't match that bit. When the two reads differ, the direction choice is obvious. When both bits are 0, we must choose a path to take. When we can scan all 64 bits without having to choose a path, we are done.
See “Application note 187 1-wire search algorithm” at www.maxim-ic.com
AUTHOR¶
David Fries <David@Fries.net>
COPYRIGHT¶
July 2017 | Kernel Hackers Manual 4.12 |