Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Diff: OneWire_Switches/DS2413/ds2413.cpp
- Revision:
- 23:e8e403d61359
- Parent:
- 22:686273e55cdc
- Child:
- 54:08985bf69691
diff -r 686273e55cdc -r e8e403d61359 OneWire_Switches/DS2413/ds2413.cpp --- a/OneWire_Switches/DS2413/ds2413.cpp Mon Mar 21 21:41:36 2016 +0000 +++ b/OneWire_Switches/DS2413/ds2413.cpp Mon Mar 21 23:18:45 2016 +0000 @@ -123,17 +123,17 @@ { Ds2413::CmdResult result = Ds2413::OpFailure; - OneWireInterface::CmdResult ow_result = _owm.OWMatchROM(romId); + OneWireMaster::CmdResult ow_result = _owm.OWMatchROM(romId); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { ow_result = _owm.OWWriteByte(Ds2413::PIO_ACCESS_READ); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { ow_result = _owm.OWReadByte(val); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { result = Ds2413::Success; } @@ -157,14 +157,14 @@ { Ds2413::CmdResult result = Ds2413::OpFailure; - OneWireInterface::CmdResult ow_result = _owm.OWMatchROM(romId); + OneWireMaster::CmdResult ow_result = _owm.OWMatchROM(romId); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { uint8_t send_block[] = {Ds2413::PIO_ACCESS_WRITE, val, ~val}; ow_result = _owm.OWWriteBlock(send_block, 3); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { uint8_t expected_status = ((0x01 & val) | ((0x01 & val) << 1) | ((0x02 & val) << 1) | ((0x02 & val) << 2)); @@ -173,7 +173,7 @@ uint8_t rcv_block[2]; ow_result = _owm.OWReadBlock(rcv_block, 2); - if(ow_result == OneWireInterface::Success) + if(ow_result == OneWireMaster::Success) { if((rcv_block[0] == 0xAA) && (rcv_block[1] == expected_status)) {