Maxim Integrated / OneWire

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Embed: (wiki syntax)

« Back to documentation index

DS2480B Class Reference

DS2480B Class Reference

Serial to 1-Wire Line Driver. More...

#include <DS2480B.h>

Inherits OneWire::OneWireMaster.

Public Types

enum  BaudRate { Baud9600bps = 0, Baud19200bps = 2, Baud57600bps = 4, Baud115200bps = 6 }
 

Baud rates for DS2480B.

More...
enum  OWSpeed
 

Speed of the 1-Wire bus.

More...
enum  OWLevel
 

Level of the 1-Wire bus.

More...
enum  SearchDirection
 

Search direction for the triplet operation.

More...
enum  CmdResult
 

Result of all 1-Wire commands.

More...

Public Member Functions

virtual OneWireMaster::CmdResult OWInitMaster ()
 Initialize a master for use.
virtual OneWireMaster::CmdResult OWReset ()
 Reset all of the devices on the 1-Wire bus and check for a presence pulse.
virtual OneWireMaster::CmdResult OWSetSpeed (OWSpeed newSpeed)
 Set the 1-Wire bus communication speed.
virtual CmdResult OWTouchBitSetLevel (uint8_t &sendRecvBit, OWLevel afterLevel)=0
 Send and receive one bit of communication and set a new level on the 1-Wire bus.
virtual CmdResult OWWriteByteSetLevel (uint8_t sendByte, OWLevel afterLevel)=0
 Send one byte of communication and set a new level on the 1-Wire bus.
virtual CmdResult OWReadByteSetLevel (uint8_t &recvByte, OWLevel afterLevel)=0
 Receive one byte of communication and set a new level on the 1-Wire bus.
virtual CmdResult OWWriteBlock (const uint8_t *sendBuf, size_t sendLen)
 Send a block of communication on the 1-Wire bus.
virtual CmdResult OWReadBlock (uint8_t *recvBuf, size_t recvLen)
 Receive a block of communication on the 1-Wire bus.
virtual CmdResult OWSetLevel (OWLevel newLevel)=0
 Set the 1-Wire bus level.
virtual CmdResult OWTriplet (SearchDirection &searchDirection, uint8_t &sbr, uint8_t &tsb)
 1-Wire Triplet operation.
CmdResult OWWriteBitSetLevel (uint8_t sendBit, OWLevel afterLevel)
 Send one bit of communication and set a new level on the 1-Wire bus.
CmdResult OWReadBitSetLevel (uint8_t &recvBit, OWLevel afterLevel)
 Receive one bit of communication and set a new level on the 1-Wire bus.

Detailed Description

Serial to 1-Wire Line Driver.

Definition at line 42 of file DS2480B.h.


Member Enumeration Documentation

enum BaudRate

Baud rates for DS2480B.

Enumerator:
Baud9600bps 

9600 bps

Baud19200bps 

19200 bps

Baud57600bps 

57600 bps

Baud115200bps 

115200 bps

Definition at line 46 of file DS2480B.h.

enum CmdResult [inherited]

Result of all 1-Wire commands.

Definition at line 67 of file OneWireMaster.h.

enum OWLevel [inherited]

Level of the 1-Wire bus.

Definition at line 53 of file OneWireMaster.h.

enum OWSpeed [inherited]

Speed of the 1-Wire bus.

Definition at line 46 of file OneWireMaster.h.

enum SearchDirection [inherited]

Search direction for the triplet operation.

Definition at line 60 of file OneWireMaster.h.


Member Function Documentation

OneWireMaster::CmdResult OWInitMaster (  ) [virtual]

Initialize a master for use.

Implements OneWireMaster.

Definition at line 210 of file DS2480B.cpp.

CmdResult OWReadBitSetLevel ( uint8_t &  recvBit,
OWLevel  afterLevel 
) [inherited]

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

Parameters:
[out]sendRecvBitRead data from 1-Wire bus will be returned in lsb.
afterLevelLevel to set the 1-Wire bus to after communication.

Definition at line 143 of file OneWireMaster.h.

OneWireMaster::CmdResult OWReadBlock ( uint8_t *  recvBuf,
size_t  recvLen 
) [virtual, inherited]

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

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

Reimplemented in DS2465.

Definition at line 53 of file OneWireMaster.cpp.

virtual CmdResult OWReadByteSetLevel ( uint8_t &  recvByte,
OWLevel  afterLevel 
) [pure virtual, inherited]

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.

Implemented in DS2465, and DS248x.

OneWireMaster::CmdResult OWReset (  ) [virtual]

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

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

Implements OneWireMaster.

Definition at line 215 of file DS2480B.cpp.

virtual CmdResult OWSetLevel ( OWLevel  newLevel ) [pure virtual, inherited]

Set the 1-Wire bus level.

Implemented in DS2465, and DS248x.

OneWireMaster::CmdResult OWSetSpeed ( OWSpeed  newSpeed ) [virtual]

Set the 1-Wire bus communication speed.

Implements OneWireMaster.

Definition at line 435 of file DS2480B.cpp.

virtual CmdResult OWTouchBitSetLevel ( uint8_t &  sendRecvBit,
OWLevel  afterLevel 
) [pure virtual, inherited]

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

Parameters:
[in,out]sendRecvBitBuffer containing the bit to send on 1-Wire bus in lsb. Read data from 1-Wire bus will be returned in lsb.
afterLevelLevel to set the 1-Wire bus to after communication.

Implemented in DS2465, and DS248x.

OneWireMaster::CmdResult OWTriplet ( SearchDirection searchDirection,
uint8_t &  sbr,
uint8_t &  tsb 
) [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 device have same bit) or in case of a discrepancy, the 'searchDirection' parameter is used.

Parameters:
[in,out]searchDirectionInput with desired direction in case both read bits are zero. Output with direction taken based on read bits.
[out]sbrBit result of first read operation.
[out]tsbBit result of second read operation.

Reimplemented in DS2465, and DS248x.

Definition at line 69 of file OneWireMaster.cpp.

CmdResult OWWriteBitSetLevel ( uint8_t  sendBit,
OWLevel  afterLevel 
) [inherited]

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

Parameters:
sendBitBuffer containing the bit to send on 1-Wire bus in lsb.
afterLevelLevel to set the 1-Wire bus to after communication.

Definition at line 138 of file OneWireMaster.h.

OneWireMaster::CmdResult OWWriteBlock ( const uint8_t *  sendBuf,
size_t  sendLen 
) [virtual, inherited]

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

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

Reimplemented in DS2465.

Definition at line 37 of file OneWireMaster.cpp.

virtual CmdResult OWWriteByteSetLevel ( uint8_t  sendByte,
OWLevel  afterLevel 
) [pure 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.

Implemented in DS2465, and DS248x.