![]() |
OneWire Library for Arduino
version: 1.0.0
|
Base class for all 1-Wire Masters. More...
#include <OneWireMaster.h>
Public Types | |
enum | OWSpeed { StandardSpeed = 0x00, OverdriveSpeed = 0x01 } |
Speed of the 1-Wire bus. More... | |
enum | OWLevel { NormalLevel = 0x00, StrongLevel = 0x02 } |
Level of the 1-Wire bus. More... | |
enum | SearchDirection { WriteZero = 0, WriteOne = 1 } |
Search direction for the triplet operation. More... | |
enum | CmdResult { Success, CommunicationWriteError, CommunicationReadError, TimeoutError, OperationFailure } |
Result of all 1-Wire commands. More... | |
Public Member Functions | |
virtual | ~OneWireMaster () |
Allow freeing through a base class pointer. More... | |
virtual CmdResult | OWInitMaster ()=0 |
Initialize a master for use. More... | |
virtual CmdResult | OWReset ()=0 |
virtual CmdResult | OWTouchBitSetLevel (uint8_t &sendRecvBit, OWLevel afterLevel)=0 |
virtual CmdResult | OWWriteByteSetLevel (uint8_t sendByte, OWLevel afterLevel)=0 |
virtual CmdResult | OWReadByteSetLevel (uint8_t &recvByte, OWLevel afterLevel)=0 |
virtual CmdResult | OWWriteBlock (const uint8_t *sendBuf, uint8_t sendLen) |
virtual CmdResult | OWReadBlock (uint8_t *recvBuf, uint8_t recvLen) |
virtual CmdResult | OWSetSpeed (OWSpeed newSpeed)=0 |
Set the 1-Wire bus communication speed. More... | |
virtual CmdResult | OWSetLevel (OWLevel newLevel)=0 |
Set the 1-Wire bus level. More... | |
virtual CmdResult | OWTriplet (SearchDirection &searchDirection, uint8_t &sbr, uint8_t &tsb) |
1-Wire Triplet operation. More... | |
CmdResult | OWWriteBitSetLevel (uint8_t sendBit, OWLevel afterLevel) |
CmdResult | OWReadBitSetLevel (uint8_t &recvBit, OWLevel afterLevel) |
CmdResult | OWWriteBit (uint8_t sendBit) |
CmdResult | OWReadBit (uint8_t &recvBit) |
CmdResult | OWWriteBitPower (uint8_t sendBit) |
CmdResult | OWReadBitPower (uint8_t &recvBit) |
CmdResult | OWWriteByte (uint8_t sendByte) |
CmdResult | OWReadByte (uint8_t &recvByte) |
CmdResult | OWWriteBytePower (uint8_t sendByte) |
CmdResult | OWReadBytePower (uint8_t &recvByte) |
Base class for all 1-Wire Masters.
|
inlinevirtual |
Allow freeing through a base class pointer.
|
pure virtual |
Initialize a master for use.
Implemented in OneWire::DS248x.
|
inline |
|
inline |
|
inline |
Receive one bit of communication and set a new level on the 1-Wire bus.
[out] | sendRecvBit | Read data from 1-Wire bus will be returned in lsb. |
afterLevel | Level to set the 1-Wire bus to after communication. |
|
virtual |
Receive a block of communication on the 1-Wire bus.
[out] | recvBuf | Buffer to receive the data from the 1-Wire bus. |
recvLen | Length of the buffer to receive. |
|
inline |
|
inline |
|
pure virtual |
Receive one byte of communication and set a new level on the 1-Wire bus.
recvByte | Buffer to receive the data from the 1-Wire bus. |
afterLevel | Level to set the 1-Wire bus to after communication. |
Implemented in OneWire::DS248x.
|
pure virtual |
Reset all of the devices on the 1-Wire bus and check for a presence pulse.
Implemented in OneWire::DS248x.
Set the 1-Wire bus level.
Implemented in OneWire::DS248x.
Set the 1-Wire bus communication speed.
Implemented in OneWire::DS248x.
|
pure virtual |
Send and receive one bit of communication and set a new level on the 1-Wire bus.
[in,out] | sendRecvBit | Buffer containing the bit to send on 1-Wire bus in lsb. Read data from 1-Wire bus will be returned in lsb. |
afterLevel | Level to set the 1-Wire bus to after communication. |
Implemented in OneWire::DS248x.
|
virtual |
1-Wire Triplet operation.
Perform one bit of a 1-Wire search. This command does two read bits and one write bit. The write bit is either the default direction (all device have same bit) or in case of a discrepancy, the 'searchDirection' parameter is used.
[in,out] | searchDirection | Input with desired direction in case both read bits are zero. Output with direction taken based on read bits. |
[out] | sbr | Bit result of first read operation. |
[out] | tsb | Bit result of second read operation. |
Reimplemented in OneWire::DS248x.
|
inline |
|
inline |
Send one bit of communication and set a new level on the 1-Wire bus.
sendBit | Buffer containing the bit to send on 1-Wire bus in lsb. |
afterLevel | Level to set the 1-Wire bus to after communication. |
|
virtual |
Send a block of communication on the 1-Wire bus.
[in] | sendBuf | Buffer to send on the 1-Wire bus. |
sendLen | Length of the buffer to send. |
|
inline |
|
inline |
|
pure virtual |
Send one byte of communication and set a new level on the 1-Wire bus.
sendByte | Byte to send on the 1-Wire bus. |
afterLevel | Level to set the 1-Wire bus to after communication. |
Implemented in OneWire::DS248x.