45 }
while (retry-- && !res);
73 if (mix & 1) m_crc ^= 0x8C;
83 uint8_t* bp = (uint8_t*) buf;
85 while (size--) *bp++ =
read();
113 if (mix & 1) m_crc ^= 0x8C;
122 uint8_t* bp = (uint8_t*) buf;
123 while (size--)
write(*bp++);
129 for (
Driver* dev = m_device; dev !=
NULL; dev = dev->m_next) {
130 if (!memcmp(dev->m_rom, rom,
ROM_MAX))
145 }
while (dev !=
NULL);
168 m_pin->m_devices += 1;
170 m_pin->m_device =
this;
186 for (uint8_t i = 0; i < 8; i++) {
188 for (uint8_t j = 0; j < 8; j++) {
197 else if (pos > last) {
201 else if (
m_rom[i] & (1 << j)) {
246 if (
m_rom[0] == 0)
return (
false);
248 if (
m_pin->m_devices > 1)
277 if (last ==
ERROR)
return (
false);
278 if (
m_rom[0] == family) {
280 m_pin->m_devices += 1;
282 m_pin->m_device =
this;
287 }
while (last !=
LAST);
296 outs <<
PSTR(
"OWI::rom(family = ") <<
hex << dev.
m_rom[0]
297 <<
PSTR(
", id = 0x");
299 uint8_t v = dev.
m_rom[i];
300 outs << tohex(v >> 4) <<
tohex(v);
313 }
while ((m_family != 0) && (
m_rom[0] != m_family));
int8_t alarm_search(int8_t last=FIRST)
friend IOStream & operator<<(IOStream &outs, OWI &owi)
void write(uint8_t value, uint8_t bits=CHARBITS, bool power=false)
int8_t search(int8_t last=FIRST)
const class prog_str * str_P
IOStream & endl(IOStream &outs)
char tohex(uint8_t value)
Driver * lookup(uint8_t *rom)
Driver(OWI *pin, const char *name=NULL)
bool connect(uint8_t family, uint8_t index)
uint8_t read(uint8_t bits=CHARBITS)
OutputPin & operator<<(int value)
IOStream & hex(IOStream &outs)
int8_t search_rom(int8_t last=FIRST)
static const uint8_t ROM_MAX