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.h
- Revision:
- 21:00c94aeb533e
- Parent:
- 17:b646b1e3970b
- Child:
- 23:e8e403d61359
--- a/OneWire_Masters/OneWireMaster.h Mon Mar 21 01:28:34 2016 +0000 +++ b/OneWire_Masters/OneWireMaster.h Mon Mar 21 14:12:28 2016 -0500 @@ -54,7 +54,7 @@ static uint16_t calculateCRC16(uint16_t CRC16, uint16_t data); - static uint16_t calculateCRC16(const uint8_t * data, size_t data_offset, size_t data_len, uint16_t crc); + static uint16_t calculateCRC16(const uint8_t * data, size_t data_offset, size_t data_len, uint16_t crc = 0); //Part of OneWireInterface that should only be implemented once //See OneWireInterface.h for documentation @@ -89,13 +89,16 @@ virtual OneWireInterface::CmdResult OWResume(void); + virtual OneWireInterface::CmdResult OWReadBytePower(uint8_t & recvbyte) { return OperationFailure; } + protected: // Search state uint8_t _last_discrepancy; uint8_t _last_family_discrepancy; - uint8_t _last_device_flag; - uint8_t _crc8; + bool _last_device_flag; + + private: static const uint16_t _oddparity[16]; };