#include <LOW_linkPassiveSerial.h>
Inheritance diagram for LOW_linkPassiveSerial:
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 | |
LOW_linkPassiveSerial (const LOW_portSerialFactory::portSpecifier_t &inSerPortSpec, const bool inAllowProgPulse=false) | |
Constructor. More... | |
~LOW_linkPassiveSerial () | |
Destructor. More... | |
bool | operator== (LOW_link &inLink) const |
Comparison based on linkID. More... | |
Bus touch (write/read) methods required by LOW_Link | |
bool | touchBit (const bool inSendBit, const strongPullup_t inPullup=pullUp_NONE) |
Send 1 bit of communication to the 1-Wire net and return the result 1 bit read from the 1-Wire net. More... | |
uint8_t | touchByte (const uint8_t inSendByte, const strongPullup_t inPullup=pullUp_NONE) |
Send 8 bits of communication to the 1-Wire net and return the result 8 bits read from the 1-Wire net. More... | |
byteVec_t | touchBlock (const byteVec_t &inBytes, const strongPullup_t inPullup=pullUp_NONE) |
Send block of communication to the 1-Wire net and return the resulting bytes read from the 1-Wire net. More... | |
Bus read methods required by LOW_Link | |
bool | readDataBit (const strongPullup_t inPullup=pullUp_NONE) |
Receive 1 bit from the 1-Wire net by previously sending one bit of read communication to the 1-Wire net. More... | |
uint8_t | readDataByte (const strongPullup_t inPullup=pullUp_NONE) |
Receive 1 byte from the 1-Wire net by previously sending 8 bits of read communication to the 1-Wire net. More... | |
void | readData (byteVec_t &outBytes, const strongPullup_t inPullup=pullUp_NONE) |
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 required by LOW_Link | |
void | writeData (const bool inSendBit, const strongPullup_t inPullup=pullUp_NONE) |
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... | |
void | writeData (const uint8_t inSendByte, const strongPullup_t inPullup=pullUp_NONE) |
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... | |
void | writeData (const byteVec_t &inSendBytes, const strongPullup_t inPullup=pullUp_NONE) |
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 required by LOW_Link | |
void | resetLinkAdapter () |
Reset the adapter. More... | |
bool | resetBus () |
Reset all of the devices on the 1-Wire net. More... | |
void | strongPullup (const unsigned long inMicroSecs) |
Set the 1-Wire net line level to strong pullup for a specified time. More... | |
void | programPulse () |
Create a fixed 480 microseconds 12 volt pulse on the 1-Wire net for programming EPROM devices. More... | |
void | doSearchSequence (const LOW_deviceIDRaw &inBranchVector, LOW_deviceIDRaw &outFoundID, LOW_deviceIDRaw &outDiscrVec) |
Discover devices on the bus. 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... | |
Protected Types | |
enum | semNum_t { counterSemNo = 0, lockSemNo, semaphoreCount } |
Semaphore numbers for semaphore set. 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 Methods | |
void | strongPullup (const strongPullup_t inPullup) |
Set the 1-Wire net line level to strong pullup for a specified time. More... | |
Private Attributes | |
LOW_portSerial * | serialPort |
The serial port the adapter is attached to. More... | |
Static Private Attributes | |
const int | strongPullupEmuTime = 3 |
Time to wait for emulation of strong pullup in seconds. More... |
As the passive adapter is not capable of real strong pullups with high current, it is emulated by providing high level on the bus for a relatively long time.
Definition at line 36 of file LOW_linkPassiveSerial.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. |
|
Constructor.
Definition at line 36 of file LOW_linkPassiveSerial.cpp. References LOW_IPCKeyGeneratorFactory::new_IPCKeyGenerator(), LOW_portSerialFactory::new_portSerial(), LOW_semaphoreSetFactory::new_semaphoreSet(), resetBus(), resetLinkAdapter(), LOW_link::semaphoreCount, LOW_link::semSet, and serialPort. |
|
Destructor.
Definition at line 52 of file LOW_linkPassiveSerial.cpp. References LOW_link::semSet, serialPort, and LOW_portSerial::tty_flush(). |
|
Discover devices on the bus.
Reimplemented from LOW_link. Definition at line 280 of file LOW_linkPassiveSerial.cpp. References LOW_deviceIDRaw::getBit(), readDataBit(), LOW_deviceIDRaw::setBit(), and writeData(). |
|
Get whether there is an external power line on the segment.
Definition at line 133 of file LOW_link.cpp. References LOW_link::hasExternalPower. Referenced by LOW_netSegment::LOW_netSegment(). |
|
Get ID of the link.
Definition at line 127 of file LOW_link.cpp. References LOW_link::linkID. |
|
Comparison based on linkID.
Definition at line 115 of file LOW_link.cpp. References LOW_link::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 from LOW_link. Definition at line 266 of file LOW_linkPassiveSerial.cpp. References LOW_link::allowProgPulse, and LOW_link::hasProgramPulse. |
|
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 from LOW_link. Definition at line 147 of file LOW_linkPassiveSerial.cpp. References byteVec_t, and readDataByte(). |
|
Receive 1 bit from the 1-Wire net by previously sending one bit of read communication to the 1-Wire net.
Reimplemented from LOW_link. Definition at line 131 of file LOW_linkPassiveSerial.cpp. References touchBit(). Referenced by doSearchSequence(). |
|
Receive 1 byte from the 1-Wire net by previously sending 8 bits of read communication to the 1-Wire net.
Reimplemented from LOW_link. Definition at line 139 of file LOW_linkPassiveSerial.cpp. References touchByte(). Referenced by readData(). |
|
Reset all of the devices on the 1-Wire net.
Reimplemented from LOW_link. Definition at line 207 of file LOW_linkPassiveSerial.cpp. References LOW_portSerial::B10472_speed, LOW_portSerial::B115200_speed, LOW_portSerial::bit1_stopBit, LOW_portSerial::bit6_size, LOW_portSerial::bit8_size, LOW_portSerial::no_parity, LOW_portSerial::none_flowControl, serialPort, LOW_portSerial::tty_configure(), LOW_portSerial::tty_flush(), LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write(). Referenced by LOW_linkPassiveSerial(). |
|
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 from LOW_link. Definition at line 196 of file LOW_linkPassiveSerial.cpp. References LOW_portSerial::B115200_speed, LOW_portSerial::bit1_stopBit, LOW_portSerial::bit6_size, LOW_portSerial::no_parity, LOW_portSerial::none_flowControl, serialPort, LOW_portSerial::tty_configure(), and LOW_portSerial::tty_flush(). Referenced by LOW_linkPassiveSerial(). |
|
Set the 1-Wire net line level to strong pullup for a specified time. Adapter for time specification in strongPullup_t.
Definition at line 311 of file LOW_linkPassiveSerial.cpp. References LOW_link::pullUp_1048, LOW_link::pullUp_131, LOW_link::pullUp_16_4, LOW_link::pullUp_262, LOW_link::pullUp_524, LOW_link::pullUp_65_5, LOW_link::pullUp_NONE, and strongPullup(). |
|
Set the 1-Wire net line level to strong pullup for a specified time.
Reimplemented from LOW_link. Definition at line 256 of file LOW_linkPassiveSerial.cpp. References LOW_platformMisc::secSleep(), and strongPullupEmuTime. Referenced by strongPullup(), touchBit(), and touchByte(). |
|
Send 1 bit of communication to the 1-Wire net and return the result 1 bit read from the 1-Wire net.
Reimplemented from LOW_link. Definition at line 67 of file LOW_linkPassiveSerial.cpp. References serialPort, strongPullup(), LOW_portSerial::tty_flush(), LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write(). Referenced by readDataBit(), touchByte(), and writeData(). |
|
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 from LOW_link. Definition at line 112 of file LOW_linkPassiveSerial.cpp. References byteVec_t, and touchByte(). Referenced by writeData(). |
|
Send 8 bits of communication to the 1-Wire net and return the result 8 bits read from the 1-Wire net.
Reimplemented from LOW_link. Definition at line 94 of file LOW_linkPassiveSerial.cpp. References strongPullup(), and touchBit(). Referenced by readDataByte(), touchBlock(), and writeData(). |
|
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 from LOW_link. Definition at line 179 of file LOW_linkPassiveSerial.cpp. References byteVec_t, and touchBlock(). |
|
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 from LOW_link. Definition at line 170 of file LOW_linkPassiveSerial.cpp. References touchByte(). |
|
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 from LOW_link. Definition at line 161 of file LOW_linkPassiveSerial.cpp. References touchBit(). Referenced by doSearchSequence(). |
|
Wether the program pulse should be allowed.
Definition at line 354 of file LOW_link.h. Referenced by programPulse(), and LOW_linkDS2480B::programPulse(). |
|
Wether the attached bus supplies external power.
Definition at line 353 of file LOW_link.h. Referenced by LOW_link::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 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 LOW_link::getID(), and LOW_link::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_link::commLock::~commLock(), LOW_linkDS2480B::~LOW_linkDS2480B(), and ~LOW_linkPassiveSerial(). |
|
The serial port the adapter is attached to.
Definition at line 113 of file LOW_linkPassiveSerial.h. Referenced by LOW_linkPassiveSerial(), resetBus(), resetLinkAdapter(), touchBit(), and ~LOW_linkPassiveSerial(). |
|
Time to wait for emulation of strong pullup in seconds.
Definition at line 105 of file LOW_linkPassiveSerial.h. Referenced by strongPullup(). |