Library to communicate with Maxim OneWire protocol devices
Diff: Onewire.h
- Revision:
- 0:d961f715d82b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Onewire.h Sun Jun 23 15:17:39 2013 +0000 @@ -0,0 +1,20 @@ +#ifndef Onewire_h +#define Onewire_h + +#include "mbed.h" + +class Onewire{ + +public: + Onewire(PinName oneBus); + void writeBit(int bit); + int readBit(); + int init(); + int readByte(); + void writeByte(char data); + unsigned char CRC(unsigned char* addr, unsigned char len); + +private: + DigitalInOut oneBus_; +}; +#endif \ No newline at end of file