1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Superseded by MaximInterface.
Diff: OneWire_Masters/OneWireMaster.cpp
- Revision:
- 26:a361e3f42ba5
- Parent:
- 24:8942d8478d68
- Child:
- 27:d5aaefa252f1
--- 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