Revo onewire library, changes to work on FRDM-K22
Fork of OneWire by
Diff: OneWire.h
- Revision:
- 6:28e60d774095
- Parent:
- 0:acf75feb0947
--- a/OneWire.h Sat Jan 07 11:20:08 2017 +0000 +++ b/OneWire.h Sat Sep 09 09:10:49 2017 +0000 @@ -38,12 +38,29 @@ #endif public: + + enum ONEWIRE_RESULT + { + ONEWIRE_OK = 0, + ONEWIRE_NO_RESPONSE, + ONEWIRE_ERROR, + ONEWIRE_ERROR_SHORT_CIRCUIT + }; + OneWire(PinName pin); + + + + // Perform a 1-Wire reset cycle. Returns ONEWIRE_OK if a device responds + // with a presence pulse. Returns ONEWIRE_NO_RESPONCE if there is no device or the + // bus is shorted or otherwise held low for more than 250uS + + uint8_t init_sequence(); - // Perform a 1-Wire reset cycle. Returns 1 if a device responds - // with a presence pulse. Returns 0 if there is no device or the - // bus is shorted or otherwise held low for more than 250uS - uint8_t reset(void); + uint8_t reset( bool force = true ); + + + // Issue a 1-Wire rom select command, you do the reset first. void select(const uint8_t rom[8]);