#include <LOW_link.h>
Inheritance diagram for LOW_link:
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_semaphoreSet * | semSet |
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... |
Any link class representing a concrete 1-Wire link adapter must inherit from this class.
Definition at line 37 of file LOW_link.h.
|
Type for individual link ID number.
Definition at line 96 of file LOW_link.h. |
|
Vector type of link class pointers.
Definition at line 93 of file LOW_link.h. |
|
Semaphore numbers for semaphore set.
Definition at line 338 of file LOW_link.h. |
|
Type for strong pullup period specification.
Definition at line 99 of file LOW_link.h. |
|
Destructor.
Definition at line 50 of file LOW_link.cpp. |
|
Constructor.
Definition at line 37 of file LOW_link.cpp. References aquireCount, and aquirePID. |
|
Discover devices on the bus.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. Referenced by LOW_netSegment::cmd_SearchROM(), and LOW_netSegment::cmd_SearchROMVerify(). |
|
Get 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(). |
|
Get ID of the link.
Definition at line 127 of file LOW_link.cpp. References linkID. |
|
Comparison based on linkID.
Definition at line 115 of file LOW_link.cpp. References linkID. |
|
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. |
|
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.
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(). |
|
Receive 1 bit from the 1-Wire net by previously sending one bit of read communication to the 1-Wire net.
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(). |
|
Receive 1 byte from the 1-Wire net by previously sending 8 bits of read communication to the 1-Wire net.
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(). |
|
Reset all of the devices on the 1-Wire net.
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(). |
|
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. |
|
Set the 1-Wire net line level to strong pullup for a specified time.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
Send 1 bit of communication to the 1-Wire net and return the result 1 bit read from the 1-Wire net.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
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.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
Send 8 bits of communication to the 1-Wire net and return the result 8 bits read from the 1-Wire net.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
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.
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
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).
Reimplemented in LOW_linkDS2480B, and LOW_linkPassiveSerial. |
|
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).
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(). |
|
Needed to access the semaphore set.
Definition at line 382 of file LOW_link.h. |
|
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(). |
|
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(). |
|
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(). |
|
Wether the attached bus supplies external power.
Definition at line 353 of file LOW_link.h. Referenced by getHasExternalPower(). |
|
Wether the adapter is capable of overdrive bus speed.
Definition at line 352 of file LOW_link.h. |
|
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(). |
|
Incremented on instance creation to get individual IDs.
Definition at line 28 of file LOW_link.cpp. |
|
Individual ID of the link adapter.
Definition at line 350 of file LOW_link.h. Referenced by getID(), and operator==(). |
|
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(). |