Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LOW_link Class Reference

Abstract base class for 1-Wire link adapters. More...

#include <LOW_link.h>

Inheritance diagram for LOW_link:

Inheritance graph
[legend]
Collaboration diagram for LOW_link:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< LOW_link *> linkPtrVec_t
 Vector type of link class pointers. More...

typedef uint32_t linkID_t
 Type for individual link ID number. More...

enum  strongPullup_t {
  pullUp_16_4 = 0x00, pullUp_65_5, pullUp_131, pullUp_262,
  pullUp_524, pullUp_1048, pullUp_NONE = 0xff
}
 Type for strong pullup period specification. More...


Public Methods

virtual ~LOW_link ()
 Destructor. More...

bool operator== (LOW_link &inLink) const
 Comparison based on linkID. More...

Bus touch (write/read) methods
virtual bool touchBit (const bool inSendBit, const strongPullup_t inPullup=pullUp_NONE)=0
 Send 1 bit of communication to the 1-Wire net and return the result 1 bit read from the 1-Wire net. More...

virtual uint8_t touchByte (const uint8_t inSendByte, const strongPullup_t inPullup=pullUp_NONE)=0
 Send 8 bits of communication to the 1-Wire net and return the result 8 bits read from the 1-Wire net. More...

virtual byteVec_t touchBlock (const byteVec_t &inBytes, const strongPullup_t inPullup=pullUp_NONE)=0
 Send block of communication to the 1-Wire net and return the resulting bytes read from the 1-Wire net. More...

Bus read methods
virtual bool readDataBit (const strongPullup_t inPullup=pullUp_NONE)=0
 Receive 1 bit from the 1-Wire net by previously sending one bit of read communication to the 1-Wire net. More...

virtual uint8_t readDataByte (const strongPullup_t inPullup=pullUp_NONE)=0
 Receive 1 byte from the 1-Wire net by previously sending 8 bits of read communication to the 1-Wire net. More...

virtual void readData (byteVec_t &outBytes, const strongPullup_t inPullup=pullUp_NONE)=0
 Receive a block of bytes from the 1-Wire net by previously sending a block of bytes of read communication to the 1-Wire Net. More...

Bus write methods
virtual void writeData (const bool inSendBit, const strongPullup_t inPullup=pullUp_NONE)=0
 Send 1 bit to the 1-Wire net and verify that the bit read from the 1-Wire net is the same (bus write operation). More...

virtual void writeData (const uint8_t inSendByte, const strongPullup_t inPullup=pullUp_NONE)=0
 Send 1 byte to the 1-Wire net and verify that the byte read from the 1-Wire net is the same (bus write operation). More...

virtual void writeData (const byteVec_t &inSendBytes, const strongPullup_t inPullup=pullUp_NONE)=0
 Send block of bytes to the 1-Wire net and verify that the bytes block read from the 1-Wire net are the same (bus write operation). More...

Misc methods
linkID_t getID () const
 Get ID of the link. More...

bool getHasExternalPower () const
 Get whether there is an external power line on the segment. More...

virtual void resetLinkAdapter ()=0
 Reset the adapter. More...

virtual bool resetBus ()=0
 Reset all of the devices on the 1-Wire net. More...

virtual void strongPullup (const unsigned long inMicroSecs)=0
 Set the 1-Wire net line level to strong pullup for a specified time. More...

virtual void programPulse ()=0
 Create a fixed 480 microseconds 12 volt pulse on the 1-Wire net for programming EPROM devices. More...

virtual void doSearchSequence (const LOW_deviceIDRaw &inBranchVector, LOW_deviceIDRaw &outFoundID, LOW_deviceIDRaw &outDiscrVec)=0
 Discover devices on the bus. More...


Protected Types

enum  semNum_t { counterSemNo = 0, lockSemNo, semaphoreCount }
 Semaphore numbers for semaphore set. More...


Protected Methods

 LOW_link (const bool inHasProgramPulse, const bool inHasOverDrive, const bool inHasExternalPower, const bool inAllowProgPulse=false)
 Constructor. More...


Protected Attributes

const linkID_t linkID
 Individual ID of the link adapter. More...

bool hasProgramPulse
 Wether the adapter is capable of 12V Program pulse. More...

const bool hasOverDrive
 Wether the adapter is capable of overdrive bus speed. More...

const bool hasExternalPower
 Wether the attached bus supplies external power. More...

const bool allowProgPulse
 Wether the program pulse should be allowed. More...

LOW_semaphoreSetsemSet
 Semaphore set for locking. More...


Static Protected Attributes

linkID_t linkCounter = 0
 Incremented on instance creation to get individual IDs. More...


Private Attributes

unsigned int aquireCount
 Counters how often a lock was aquired. More...

LOW_platformMiscFactory::threadIdent_t aquirePID
 Process which ows the lock. More...


Friends

class commLock
 Needed to access the semaphore set. More...


Detailed Description

Abstract base class for 1-Wire link adapters.

Any link class representing a concrete 1-Wire link adapter must inherit from this class.

Author:
Harald Roelle, Helmut Reiser

Definition at line 37 of file LOW_link.h.


Member Typedef Documentation

typedef uint32_t LOW_link::linkID_t
 

Type for individual link ID number.

Definition at line 96 of file LOW_link.h.

typedef std::vector<LOW_link*> LOW_link::linkPtrVec_t
 

Vector type of link class pointers.

Definition at line 93 of file LOW_link.h.


Member Enumeration Documentation

enum LOW_link::semNum_t [protected]
 

Semaphore numbers for semaphore set.

Enumeration values:
counterSemNo 
lockSemNo 
semaphoreCount 

Definition at line 338 of file LOW_link.h.

enum LOW_link::strongPullup_t
 

Type for strong pullup period specification.

Enumeration values:
pullUp_16_4  16.4 ms.
pullUp_65_5  65.5 ms.
pullUp_131  131 ms.
pullUp_262  262 ms.
pullUp_524  524 ms.
pullUp_1048  1048 ms.
pullUp_NONE  no pullup.

Definition at line 99 of file LOW_link.h.


Constructor & Destructor Documentation

LOW_link::~LOW_link   [virtual]
 

Destructor.

Definition at line 50 of file LOW_link.cpp.

LOW_link::LOW_link const bool    inHasProgramPulse,
const bool    inHasOverDrive,
const bool    inHasExternalPower,
const bool    inAllowProgPulse = false
[protected]
 

Constructor.

Parameters:
inHasProgramPulse  Wether the adapter is capable of 12V Program pulse.
inHasOverDrive  Wether the adapter is capable of overdrive bus speed.
inHasExternalPower  Wether the attached bus supplies external power.
inAllowProgPulse  Wether the program pulse should be allowed.

Definition at line 37 of file LOW_link.cpp.

References aquireCount, and aquirePID.


Member Function Documentation

virtual void LOW_link::doSearchSequence const LOW_deviceIDRaw   inBranchVector,
LOW_deviceIDRaw   outFoundID,
LOW_deviceIDRaw   outDiscrVec
[pure virtual]
 

Discover devices on the bus.

Parameters:
inBranchVector 
outFoundID 
outDiscrVec 

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_netSegment::cmd_SearchROM(), and LOW_netSegment::cmd_SearchROMVerify().

bool LOW_link::getHasExternalPower   const
 

Get whether there is an external power line on the segment.

Returns:
Whether there is an external power line on the segment.

Definition at line 133 of file LOW_link.cpp.

References hasExternalPower.

Referenced by LOW_netSegment::LOW_netSegment().

uint32_t LOW_link::getID   const
 

Get ID of the link.

Returns:
ID of the link.

Definition at line 127 of file LOW_link.cpp.

References linkID.

bool LOW_link::operator== LOW_link &    inLink const
 

Comparison based on linkID.

Definition at line 115 of file LOW_link.cpp.

References linkID.

virtual void LOW_link::programPulse   [pure virtual]
 

Create a fixed 480 microseconds 12 volt pulse on the 1-Wire net for programming EPROM devices.

For EPROM programming, only a single slave device should be connected to the 1-Wire bus and the cable must be short, not to exceed a few meters.

Note: One should not attempt generating a programming pulse with a non-EPROM device on the bus; this may damage the device as well as the link controller.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual void LOW_link::readData byteVec_t   outBytes,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Receive a block of bytes from the 1-Wire net by previously sending a block of bytes of read communication to the 1-Wire Net.

Note: When the strong pullup is selected it will appear after each byte sent and NOT only after the last byte.

Parameters:
outBytes  Values that were reveived. Read length is determined by the preset length of the vector.
inPullup  Optional strong pullup time following each 8 bit write/read cycle.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_netSegment::cmd_ReadROM(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS2406::cmd_ChannelAccess::readData(), and LOW_devDS2406::readMemUniversal().

virtual bool LOW_link::readDataBit const strongPullup_t    inPullup = pullUp_NONE [pure virtual]
 

Receive 1 bit from the 1-Wire net by previously sending one bit of read communication to the 1-Wire net.

Parameters:
inPullup  Optional strong pullup time following the write/read cycle.
Returns:
Bit that was reveived.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_devDS1820::cmd_ConvertT(), LOW_devDS2405::cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2405::cmd_SearchRead(), and LOW_devDS2406::cmd_ChannelAccess::readDataBit().

virtual uint8_t LOW_link::readDataByte const strongPullup_t    inPullup = pullUp_NONE [pure virtual]
 

Receive 1 byte from the 1-Wire net by previously sending 8 bits of read communication to the 1-Wire net.

Parameters:
inPullup  Optional strong pullup time following the write/read cycle.
Returns:
Byte that was reveived.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::cmd_ChannelAccess::readDataByte(), and LOW_devDS2406::readMemUniversal().

virtual bool LOW_link::resetBus   [pure virtual]
 

Reset all of the devices on the 1-Wire net.

Returns:
true: Presense pulse(s) detected, device(s) reset false: No presense pulses detected

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_netSegment::cmd_MatchROM(), LOW_netSegment::cmd_ReadROM(), LOW_netSegment::cmd_SearchROM(), LOW_netSegment::cmd_SearchROMVerify(), LOW_netSegment::cmd_SkipROM(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::readMemUniversal(), and LOW_devDS2406::cmd_ChannelAccess::~cmd_ChannelAccess().

virtual void LOW_link::resetLinkAdapter   [pure virtual]
 

Reset the adapter.

Note: This does not necessarily include a reset on the 1-Wire net. Whether this is done or net is left to the concrete implementation.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual void LOW_link::strongPullup const unsigned long    inMicroSecs [pure virtual]
 

Set the 1-Wire net line level to strong pullup for a specified time.

Parameters:
inMicroSecs  Pullup time in micro seconds.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual bool LOW_link::touchBit const bool    inSendBit,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send 1 bit of communication to the 1-Wire net and return the result 1 bit read from the 1-Wire net.

Parameters:
inSendBit  Bit to send.
inPullup  Optional strong pullup time following the write/read cycle.
Returns:
Bit that was reveived.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual byteVec_t LOW_link::touchBlock const byteVec_t   inBytes,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send block of communication to the 1-Wire net and return the resulting bytes read from the 1-Wire net.

Note:: When the strong pullup is selected it will appear after each byte sent and NOT only after the last byte.

Parameters:
inBytes  Byte block to send.
inPullup  Optional strong pullup time following each 8 bit write/read cycle.
Returns:
Byte block that was reveived. Length is equal to number of sent bytes.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual uint8_t LOW_link::touchByte const uint8_t    inSendByte,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send 8 bits of communication to the 1-Wire net and return the result 8 bits read from the 1-Wire net.

Parameters:
inSendByte  Byte to send.
inPullup  Optional strong pullup time following the 8 bit write/read cycle.
Returns:
Byte that was reveived.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual void LOW_link::writeData const byteVec_t   inSendBytes,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send block of bytes to the 1-Wire net and verify that the bytes block read from the 1-Wire net are the same (bus write operation).

Note:: When the strong pullup is selected it will appear after each byte sent and NOT only after the last byte.

Parameters:
inSendBytes  Block of bytes to send.
inPullup  Optional strong pullup time following each 8 bit write/read cycle.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual void LOW_link::writeData const uint8_t    inSendByte,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send 1 byte to the 1-Wire net and verify that the byte read from the 1-Wire net is the same (bus write operation).

Parameters:
inSendByte  Byte to send.
inPullup  Optional strong pullup time following the write/read cycle.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

virtual void LOW_link::writeData const bool    inSendBit,
const strongPullup_t    inPullup = pullUp_NONE
[pure virtual]
 

Send 1 bit to the 1-Wire net and verify that the bit read from the 1-Wire net is the same (bus write operation).

Parameters:
inSendBit  Bit to send.
inPullup  Optional strong pullup time following the write/read cycle.

Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), LOW_netSegment::cmd_MatchROM(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_netSegment::cmd_ReadROM(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_netSegment::cmd_SearchROM(), LOW_netSegment::cmd_SearchROMVerify(), LOW_netSegment::cmd_SkipROM(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::readMemUniversal(), and LOW_devDS2406::cmd_ChannelAccess::writeData().


Friends And Related Function Documentation

friend class commLock [friend]
 

Needed to access the semaphore set.

Definition at line 382 of file LOW_link.h.


Member Data Documentation

const bool LOW_link::allowProgPulse [protected]
 

Wether the program pulse should be allowed.

Definition at line 354 of file LOW_link.h.

Referenced by LOW_linkPassiveSerial::programPulse(), and LOW_linkDS2480B::programPulse().

unsigned int LOW_link::aquireCount [private]
 

Counters how often a lock was aquired.

Definition at line 390 of file LOW_link.h.

Referenced by LOW_link::commLock::commLock(), LOW_link(), and LOW_link::commLock::~commLock().

LOW_platformMiscFactory::threadIdent_t LOW_link::aquirePID [private]
 

Process which ows the lock.

Definition at line 391 of file LOW_link.h.

Referenced by LOW_link::commLock::commLock(), LOW_link(), and LOW_link::commLock::~commLock().

const bool LOW_link::hasExternalPower [protected]
 

Wether the attached bus supplies external power.

Definition at line 353 of file LOW_link.h.

Referenced by getHasExternalPower().

const bool LOW_link::hasOverDrive [protected]
 

Wether the adapter is capable of overdrive bus speed.

Definition at line 352 of file LOW_link.h.

bool LOW_link::hasProgramPulse [protected]
 

Wether the adapter is capable of 12V Program pulse.

Definition at line 351 of file LOW_link.h.

Referenced by LOW_linkPassiveSerial::programPulse(), LOW_linkDS2480B::programPulse(), and LOW_linkDS2480B::resetBus().

LOW_link::linkID_t LOW_link::linkCounter = 0 [static, protected]
 

Incremented on instance creation to get individual IDs.

Definition at line 28 of file LOW_link.cpp.

const linkID_t LOW_link::linkID [protected]
 

Individual ID of the link adapter.

Definition at line 350 of file LOW_link.h.

Referenced by getID(), and operator==().

LOW_semaphoreSet* LOW_link::semSet [protected]
 

Semaphore set for locking.

Definition at line 355 of file LOW_link.h.

Referenced by LOW_link::commLock::commLock(), LOW_linkDS2480B::LOW_linkDS2480B(), LOW_linkPassiveSerial::LOW_linkPassiveSerial(), LOW_link::commLock::~commLock(), LOW_linkDS2480B::~LOW_linkDS2480B(), and LOW_linkPassiveSerial::~LOW_linkPassiveSerial().


The documentation for this class was generated from the following files:
Generated on Sun Jan 12 21:07:56 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001