Extended MaximInterface

Dependents:   mbed_DS28EC20_GPIO

Embed: (wiki syntax)

« Back to documentation index

OneWireMaster Class Reference

OneWireMaster Class Reference

1-Wire master interface. More...

#include <OneWireMaster.hpp>

Inherited by DS2465, DS2480B, DS2482_DS2484, and OneWireMasterDecorator.

Public Types

enum  Speed
 

Speed of the 1-Wire bus.

More...
enum  Level
 

Level of the 1-Wire bus.

More...
enum  ErrorValue { NoSlaveError = 1 }
 

Result of all 1-Wire commands.

More...

Public Member Functions

virtual error_code reset ()=0
 Reset all of the devices on the 1-Wire bus and check for a presence pulse.
virtual error_code touchBitSetLevel (bool &sendRecvBit, Level afterLevel)=0
 Send and receive one bit of communication and set a new level on the 1-Wire bus.
virtual MaximInterface_EXPORT
error_code 
writeByteSetLevel (uint_least8_t sendByte, Level afterLevel)
 Send one byte of communication and set a new level on the 1-Wire bus.
virtual MaximInterface_EXPORT
error_code 
readByteSetLevel (uint_least8_t &recvByte, Level afterLevel)
 Receive one byte of communication and set a new level on the 1-Wire bus.
virtual MaximInterface_EXPORT
error_code 
writeBlock (span< const uint_least8_t > sendBuf)
 Send a block of communication on the 1-Wire bus.
virtual MaximInterface_EXPORT
error_code 
readBlock (span< uint_least8_t > recvBuf)
 Receive a block of communication on the 1-Wire bus.
virtual error_code setSpeed (Speed newSpeed)=0
 Set the 1-Wire bus communication speed.
virtual error_code setLevel (Level newLevel)=0
 Set the 1-Wire bus level.
virtual MaximInterface_EXPORT
error_code 
triplet (TripletData &data)
 1-Wire Triplet operation.
error_code writeBitSetLevel (bool sendBit, Level afterLevel)
 Send one bit of communication and set a new level on the 1-Wire bus.
error_code readBitSetLevel (bool &recvBit, Level afterLevel)
 Receive one bit of communication and set a new level on the 1-Wire bus.

Detailed Description

1-Wire master interface.

Definition at line 44 of file OneWireMaster.hpp.


Member Enumeration Documentation

enum ErrorValue

Result of all 1-Wire commands.

Enumerator:
NoSlaveError 

Slave not detected, typically due to no presence pulse.

Reimplemented in DS2465, DS2480B, and DS2482_DS2484.

Definition at line 53 of file OneWireMaster.hpp.

enum Level

Level of the 1-Wire bus.

Definition at line 50 of file OneWireMaster.hpp.

enum Speed

Speed of the 1-Wire bus.

Definition at line 47 of file OneWireMaster.hpp.


Member Function Documentation

error_code readBitSetLevel ( bool &  recvBit,
Level  afterLevel 
)

Receive one bit of communication and set a new level on the 1-Wire bus.

Parameters:
[out]recvBitReceived data from the 1-Wire bus.
afterLevelLevel to set the 1-Wire bus to after communication.

Definition at line 134 of file OneWireMaster.hpp.

error_code readBlock ( span< uint_least8_t >  recvBuf ) [virtual]

Receive a block of communication on the 1-Wire bus.

Parameters:
[out]recvBufBuffer to receive the data from the 1-Wire bus.

Reimplemented in DS2465.

Definition at line 77 of file OneWireMaster.cpp.

error_code readByteSetLevel ( uint_least8_t &  recvByte,
Level  afterLevel 
) [virtual]

Receive one byte of communication and set a new level on the 1-Wire bus.

Parameters:
recvByteBuffer to receive the data from the 1-Wire bus.
afterLevelLevel to set the 1-Wire bus to after communication.

Reimplemented in DS2465, DS2480B, and DS2482_DS2484.

Definition at line 50 of file OneWireMaster.cpp.

virtual error_code reset (  ) [pure virtual]

Reset all of the devices on the 1-Wire bus and check for a presence pulse.

Returns:
NoSlaveError if reset was performed but no presence pulse was detected.

Implemented in DS2465, DS2480B, and DS2482_DS2484.

virtual error_code setLevel ( Level  newLevel ) [pure virtual]

Set the 1-Wire bus level.

Implemented in DS2465, DS2480B, and DS2482_DS2484.

virtual error_code setSpeed ( Speed  newSpeed ) [pure virtual]

Set the 1-Wire bus communication speed.

Implemented in DS2465, DS2480B, and DS2482_DS2484.

virtual error_code touchBitSetLevel ( bool &  sendRecvBit,
Level  afterLevel 
) [pure virtual]

Send and receive one bit of communication and set a new level on the 1-Wire bus.

Parameters:
[in,out]sendRecvBitInput containing the bit to send and output containing the received bit.
afterLevelLevel to set the 1-Wire bus to after communication.

Implemented in DS2465, DS2480B, and DS2482_DS2484.

error_code triplet ( TripletData &  data ) [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 devices have same bit) or in case of a discrepancy, the data.writeBit parameter is used.

Parameters:
[in,out]dataInput with desired writeBit in case both read bits are zero. Output with all data fields set.

Reimplemented in DS2465, and DS2482_DS2484.

Definition at line 86 of file OneWireMaster.cpp.

error_code writeBitSetLevel ( bool  sendBit,
Level  afterLevel 
)

Send one bit of communication and set a new level on the 1-Wire bus.

Parameters:
sendBitBit to send on the 1-Wire bus.
afterLevelLevel to set the 1-Wire bus to after communication.

Definition at line 126 of file OneWireMaster.hpp.

error_code writeBlock ( span< const uint_least8_t >  sendBuf ) [virtual]

Send a block of communication on the 1-Wire bus.

Parameters:
[in]sendBufBuffer to send on the 1-Wire bus.

Reimplemented in DS2465.

Definition at line 68 of file OneWireMaster.cpp.

error_code writeByteSetLevel ( uint_least8_t  sendByte,
Level  afterLevel 
) [virtual]

Send one byte of communication and set a new level on the 1-Wire bus.

Parameters:
sendByteByte to send on the 1-Wire bus.
afterLevelLevel to set the 1-Wire bus to after communication.

Reimplemented in DS2465, DS2480B, and DS2482_DS2484.

Definition at line 40 of file OneWireMaster.cpp.