Device interface library for multiple platforms including Mbed.

Dependents:   DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#

Embed: (wiki syntax)

« Back to documentation index

DS2484 Class Reference

DS2484 I2C to 1-Wire Master. More...

#include <DS2482_DS2484.hpp>

Inherits MaximInterfaceDevices::DS2482_DS2484.

Public Types

enum  PortParameter
 

1-Wire port adjustment parameters.

More...
enum  ErrorValue
 

Result of all 1-Wire commands.

More...
enum  Speed
 

Speed of the 1-Wire bus.

More...
enum  Level
 

Level of the 1-Wire bus.

More...

Public Member Functions

MaximInterfaceDevices_EXPORT
Core::Result< void > 
adjustPort (PortParameter param, int val)
 Adjust 1-Wire port parameters.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
initialize (Config config=Config())
 Initialize hardware for use.
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeConfig (Config config)
 Write a new configuration to the device.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< TripletData
triplet (bool sendBit)
 1-Wire Triplet operation.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< void > 
reset ()
 Reset all of the devices on the 1-Wire bus and check for a presence pulse.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< bool > 
touchBitSetLevel (bool sendBit, Level afterLevel)
 Send and receive one bit of communication and set a new level on the 1-Wire bus.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< uint_least8_t > 
readByteSetLevel (Level afterLevel)
 Receive one byte of communication and set a new level on the 1-Wire bus.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< void > 
writeByteSetLevel (uint_least8_t sendByte, Level afterLevel)
 Send one byte of communication and set a new level on the 1-Wire bus.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< void > 
setSpeed (Speed newSpeed)
 Set the 1-Wire bus communication speed.
virtual
MaximInterfaceDevices_EXPORT
Core::Result< void > 
setLevel (Level newLevel)
 Set the 1-Wire bus level.
virtual
MaximInterfaceCore_EXPORT
Result< void > 
writeBlock (span< const uint_least8_t > sendBuf)
 Send a block of communication on the 1-Wire bus.
virtual
MaximInterfaceCore_EXPORT
Result< void > 
readBlock (span< uint_least8_t > recvBuf)
 Receive a block of communication on the 1-Wire bus.
Result< void > writeBitSetLevel (bool sendBit, Level afterLevel)
 Send one bit of communication and set a new level on the 1-Wire bus.
Result< bool > readBitSetLevel (Level afterLevel)
 Receive one bit of communication and set a new level on the 1-Wire bus.

Protected Member Functions

Core::Result< void > sendCommand (uint_least8_t cmd) const
Core::Result< void > sendCommand (uint_least8_t cmd, uint_least8_t param) const
Core::Result< uint_least8_t > readRegister (uint_least8_t reg) const
 Reads a register from the device.
Core::Result< uint_least8_t > readRegister () const
 Reads the current register from the device.

Detailed Description

DS2484 I2C to 1-Wire Master.

Definition at line 249 of file DS2482_DS2484.hpp.


Member Enumeration Documentation

enum ErrorValue [inherited]

Result of all 1-Wire commands.

Reimplemented from OneWireMaster.

Definition at line 45 of file DS2482_DS2484.hpp.

enum Level [inherited]

Level of the 1-Wire bus.

Definition at line 51 of file OneWireMaster.hpp.

1-Wire port adjustment parameters.

Note:
See datasheet page 13.

Definition at line 253 of file DS2482_DS2484.hpp.

enum Speed [inherited]

Speed of the 1-Wire bus.

Definition at line 48 of file OneWireMaster.hpp.


Member Function Documentation

Result< void > adjustPort ( PortParameter  param,
int  val 
)

Adjust 1-Wire port parameters.

Parameters:
paramParameter to adjust.
valNew parameter value to set. Consult datasheet for value mappings.

Definition at line 336 of file DS2482_DS2484.cpp.

Result< void > initialize ( Config  config = Config() ) [inherited]

Initialize hardware for use.

Definition at line 51 of file DS2482_DS2484.cpp.

Result<bool> readBitSetLevel ( Level  afterLevel ) [inherited]

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

Parameters:
afterLevelLevel to set the 1-Wire bus to after communication.
Returns:
Received data from the 1-Wire bus.

Definition at line 135 of file OneWireMaster.hpp.

Result< void > readBlock ( span< uint_least8_t >  recvBuf ) [virtual, inherited]

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 72 of file OneWireMaster.cpp.

Result< uint_least8_t > readByteSetLevel ( Level  afterLevel ) [virtual, inherited]

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

Parameters:
afterLevelLevel to set the 1-Wire bus to after communication.
Returns:
Data received from the 1-Wire bus.

Reimplemented from OneWireMaster.

Definition at line 151 of file DS2482_DS2484.cpp.

Result< uint_least8_t > readRegister ( uint_least8_t  reg ) const [protected, inherited]

Reads a register from the device.

Parameters:
regRegister to read from.
Returns:
Read data from register.

Definition at line 203 of file DS2482_DS2484.cpp.

Result< uint_least8_t > readRegister (  ) const [protected, inherited]

Reads the current register from the device.

Returns:
Read data from register.

Definition at line 208 of file DS2482_DS2484.cpp.

Result< void > reset (  ) [virtual, inherited]

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.

Implements OneWireMaster.

Definition at line 99 of file DS2482_DS2484.cpp.

Result< void > sendCommand ( uint_least8_t  cmd,
uint_least8_t  param 
) const [protected, inherited]
Note:
Allow marking const since not public.

Definition at line 245 of file DS2482_DS2484.cpp.

Result< void > sendCommand ( uint_least8_t  cmd ) const [protected, inherited]
Note:
Allow marking const since not public.

Definition at line 241 of file DS2482_DS2484.cpp.

Result< void > setLevel ( Level  newLevel ) [virtual, inherited]

Set the 1-Wire bus level.

Implements OneWireMaster.

Definition at line 180 of file DS2482_DS2484.cpp.

Result< void > setSpeed ( Speed  newSpeed ) [virtual, inherited]

Set the 1-Wire bus communication speed.

Implements OneWireMaster.

Definition at line 167 of file DS2482_DS2484.cpp.

Result< bool > touchBitSetLevel ( bool  sendBit,
Level  afterLevel 
) [virtual, inherited]

Send and receive 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.
Returns:
Bit received from the 1-Wire bus.

Implements OneWireMaster.

Definition at line 121 of file DS2482_DS2484.cpp.

Result< OneWireMaster::TripletData > triplet ( bool  sendBit ) [virtual, inherited]

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:
sendBitBit to send in case both read bits are zero.

Reimplemented from OneWireMaster.

Definition at line 79 of file DS2482_DS2484.cpp.

Result<void> writeBitSetLevel ( bool  sendBit,
Level  afterLevel 
) [inherited]

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.

Result< void > writeBlock ( span< const uint_least8_t >  sendBuf ) [virtual, inherited]

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 65 of file OneWireMaster.cpp.

Result< void > writeByteSetLevel ( uint_least8_t  sendByte,
Level  afterLevel 
) [virtual, inherited]

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 from OneWireMaster.

Definition at line 136 of file DS2482_DS2484.cpp.

Result< void > writeConfig ( Config  config ) [inherited]

Write a new configuration to the device.

Parameters:
[in]configNew configuration to write.

Definition at line 188 of file DS2482_DS2484.cpp.