Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Diff: OneWire_Masters/OneWireMaster.cpp
- Revision:
- 26:a361e3f42ba5
- Parent:
- 24:8942d8478d68
- Child:
- 27:d5aaefa252f1
diff -r bdb1c5a53b58 -r a361e3f42ba5 OneWire_Masters/OneWireMaster.cpp --- a/OneWire_Masters/OneWireMaster.cpp Tue Mar 22 15:18:00 2016 -0500 +++ b/OneWire_Masters/OneWireMaster.cpp Wed Mar 23 15:25:40 2016 -0500 @@ -37,54 +37,6 @@ const uint16_t OneWireMaster::_oddparity[] = { 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 }; -//********************************************************************* -OneWireMaster::CmdResult OneWireMaster::OWWriteBit(uint8_t sendbit) -{ - return OWTouchBit(sendbit); -} - - -//********************************************************************* -OneWireMaster::CmdResult OneWireMaster::OWReadBit(uint8_t & recvbit) -{ - recvbit = 0x01; - return(OWTouchBit(recvbit)); -} - - -//********************************************************************* -OneWireMaster::CmdResult OneWireMaster::OWTouchByte(uint8_t & sendrecvbyte) -{ - OneWireMaster::CmdResult result = OWWriteByte(sendrecvbyte); - - if (result == OneWireMaster::Success) - { - OWReadByte(sendrecvbyte); - } - - return result; -} - - -//********************************************************************* -OneWireMaster::CmdResult OneWireMaster::OWBlock(uint8_t *tran_buf, uint8_t tran_len) -{ - OneWireMaster::CmdResult result; - - for (uint8_t i = 0; i < tran_len; i++) - { - result = OWTouchByte(tran_buf[i]); - - if (result != OneWireMaster::Success) - { - break; - } - } - - return result; -} - - OneWireMaster::CmdResult OneWireMaster::OWFirst(RomId & romId) { // reset the search state