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

LOW_linkDS2480B Class Reference

Link class for DS2480B Serial 1-Wire Line Driver with Load Sensor. More...

#include <LOW_linkDS2480B.h>

Inheritance diagram for LOW_linkDS2480B:

Inheritance graph
[legend]
Collaboration diagram for LOW_linkDS2480B:

Collaboration graph
[legend]
List of all members.

Public Types

enum  RXPOL_val_t { RXPOL_NORM = 0x00, RXPOL_INV }
typedef std::vector< LOW_link * > linkPtrVec_t
 Vector type of link class pointers.

typedef LOW_objectIDFactory::objectID_t linkID_t
 Type for individual link ID number.

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

enum  progPulse_t {
  progPulse_32 = 0x00, progPulse_64, progPulse_128, progPulse_256,
  progPulse_512, progPulse_1024, progPulse_2048
}
 Type for 12V program pulse period specification. More...

typedef std::vector< LOW_linkFlexibleSpeed * > flexLinkPtrVec_t
 Vector type of link class pointers.

enum  wireSpeed_t { normal_speed = 0, flexible_speed = 1, overdrive_speed = 2 }
 1-Wire communication speeds. More...

Configuration values.
enum  pdSlewRate_t {
  pdSlewRate_15 = 0x00, pdSlewRate_2_2, pdSlewRate_1_65, pdSlewRate_1_37,
  pdSlewRate_1_1, pdSlewRate_0_83, pdSlewRate_0_7, pdSlewRate_0_55
}
 Type for flexible speed pulldown slew rate in V/microsec. More...

enum  w1LowTime_t {
  w1LowTime_8 = 0x00, w1LowTime_9, w1LowTime_10, w1LowTime_11,
  w1LowTime_12, w1LowTime_13, w1LowTime_14, w1LowTime_15
}
 Type for flexible speed write-1 low time in microsec. More...

enum  soW0RecTime_t {
  soW0RecTime_3 = 0x00, soW0RecTime_4, soW0RecTime_5, soW0RecTime_6,
  soW0RecTime_7, soW0RecTime_8, soW0RecTime_9, soW0RecTime_10
}
 Type for flexible speed DSO/ W0R time in microsec. More...


Public Member Functions

 LOW_linkDS2480B (const LOW_portSerialFactory::portSpecifier_t &inSerPortSpec, const RXPOL_val_t inRXPOL, const bool inHasExternalPower, const bool inAllowProgPulse=false)
 Constructor.

virtual ~LOW_linkDS2480B ()
 Destructor.

virtual std::string getLinkFamily () const
 Get the link's family type.

 class_DERIVE_FROM_EXCEPTION (link_error, LOW_exception)
 Exception base class for all exceptions thrown by LOW_link.

 class_DERIVE_FROM_EXCEPTION (comm_error, link_error)
 Exception class to be thrown on communication errors.

 class_DERIVE_FROM_EXCEPTION (internal_error, link_error)
 Exception class to be thrown on pure internal errors.

 class_DERIVE_FROM_EXCEPTION (illegalSpeed_error, link_error)
 Exception class to be thrown on errors related to currently selected wire speed.

 class_DERIVE_FROM_EXCEPTION (illegalLevel_error, link_error)
 Exception class to be thrown on errors related to requested voltage level.

 class_DERIVE_FROM_EXCEPTION (notAllowed_error, link_error)
 Exception class to be thrown on access violation errors.

 class_DERIVE_FROM_EXCEPTION (sizeMismatch_error, link_error)
virtual bool operator== (LOW_link &inLink) const
 Comparison based on linkID.

 class_DERIVE_FROM_EXCEPTION (incompatibleSpeed_error, LOW_exception)
 Exception base class for all exceptions thrown by LOW_link.

Bus touch (write/read) methods required by LOW_link
virtual 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.

virtual 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.

virtual 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.

Misc methods required by LOW_link
virtual void resetLinkAdapter ()
 Reset the adapter.

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

virtual void strongPullup (const strongPullup_t inPullupTime)
 Set the 1-Wire net line level to strong pullup for a specified time.

virtual void programPulse (const unsigned long inMicroSecs)
 Create a 12 volt pulse on the 1-Wire net for programming EPROM devices.

virtual void programPulse (const progPulse_t inPulseTime)
 Create a 12 volt pulse on the 1-Wire net for programming EPROM devices.

Methods required by LOW_linkFlexibleSpeed
virtual void setWireSpeed (const wireSpeed_t inWireSpeed)
 Set the 1-Wire speed mode.

virtual wireSpeed_t getWireSpeed ()
 Get the 1-Wire speed mode.

virtual void setPullDownSlewRate (const pdSlewRate_t inPDSR)
 Set the Pulldown Slew Rate Control.

virtual pdSlewRate_t getPullDownSlewRate ()
 Get the Pulldown Slew Rate Control.

virtual void setWrite1LowTime (const w1LowTime_t inW1LT)
 Set the Write 1 Low Time.

virtual w1LowTime_t getWrite1LowTime ()
 Get the Write 1 Low Time.

virtual void setSampleOffsetWrite0Rec (const soW0RecTime_t inSOW0RT)
 Set the Sample Offset / Write 0 Recovery time.

virtual soW0RecTime_t getSampleOffsetWrite0Rec ()
 Get the Sample Offset / Write 0 Recovery time.

Bus read methods
virtual 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.

virtual 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.

virtual 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.

Bus write methods
virtual 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).

virtual 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).

virtual 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).

Higher level actions
virtual LOW_deviceID::deviceIDVec_t searchDevices (const bool inOnlyAlarm, const LOW_deviceIDRaw inPreload, const LOW_deviceIDRaw::devFamCode_t inFamCode, const bool inDoReset)
 Execute a complete search sequence from preloaded ID vector.

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

bool getHasProgramPulse () const
 Get wether the adapter is capable of 12V Program pulse.

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

bool getAllowProgPulse () const
 Get wether the program pulse should be allowed.


Protected Member Functions

virtual void doSearchSequence (const LOW_deviceIDRaw &inBranchVector, LOW_deviceIDRaw &outFoundID, LOW_deviceIDRaw &outDiscrVec)
 Execute a single search sequence on the bus.


Protected Attributes

const linkID_t linkID
 Individual ID of the link adapter.

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

const bool hasExternalPower
 Wether the attached bus supplies external power.

const bool allowProgPulse
 Wether the program pulse should be allowed.

wireSpeed_t wireSpeed
 Saved value of wire speed.

pdSlewRate_t pdSlewRate
 Saved value of pulldown slew rate.

w1LowTime_t w1LowTime
 Saved value of write-1 low time.

soW0RecTime_t soW0RecTime
 Saved value of DSO/W0R time.


Private Types

typedef LOW_linkDS2480B::resetAnswer_t resetAnswer_t
 Reset command reply.

enum  busStatus_t { oneWireShorted_busStat = 0x00, presencePulse_busStat, alarmingPresencePulse_busStat, noPresencePulse_busStat }
 Bus status in reset command reply. More...

enum  internalMode_t { command_mode, data_mode }
 Type for internal mode flag. More...

DS2480B specific configuration values.
enum  OWSPEED_val_t { normal_OWSPEED = 0x00, flexible_OWSPEED, overdrive_OWSPEED }
 Type for wirespeed. More...

enum  PDSR_val_t {
  PDSR_15 = 0x00, PDSR_2_2, PDSR_1_65, PDSR_1_37,
  PDSR_1_1, PDSR_0_83, PDSR_0_7, PDSR_0_55
}
 Type for flexible speed pulldown slew rate in V/microsec. More...

enum  W1LT_val_t {
  W1LT_8 = 0x00, W1LT_9, W1LT_10, W1LT_11,
  W1LT_12, W1LT_13, W1LT_14, W1LT_15
}
 Type for flexible speed write-1 low time in microsec. More...

enum  SOW0RT_val_t {
  SOW0RT_3 = 0x00, SOW0RT_4, SOW0RT_5, SOW0RT_6,
  SOW0RT_7, SOW0RT_8, SOW0RT_9, SOW0RT_10
}
 Type for flexible speed DSO/ W0R time in microsec. More...

enum  PPD_val_t {
  PPD_32 = 0x00, PPD_64, PPD_128, PPD_256,
  PPD_512, PPD_1024, PPD_2048, PPD_inf
}
 Programming Pulse Duration values. More...

enum  SPUD_val_t {
  SPUD_16_4 = 0x00, SPUD_65_5, SPUD_131, SPUD_262,
  SPUD_524, SPUD_1048, SPUD_dyn, SPUD_inf
}
 Strong Pullup Duration values. More...

enum  LST_val_t {
  LST_1_8 = 0x00, LST_2_1, LST_2_4, LST_2_7,
  LST_3_0, LST_3_3, LST_3_6, LST_3_9
}
 Load Sensor Threshold values. More...

enum  RBR_val_t { RBR_9_6 = 0x00, RBR_19_2, RBR_57_6, RBR_115_2 }
 RS232 Baud Rate values. More...


Private Member Functions

DS2480B communication commands
The DS2480B supports four communication function commands: Reset, Single Bit, Pulse, and Search Accelerator control.

The Reset, Search Accelerator Control and Single Bit commands include bits to select the 1-Wire communication speed (regular, flexible regular, Overdrive). Even if a command does not generate activity on the 1-Wire bus, these bits are latched inside the device and will take effect immediately.

virtual void reset_cmd (resetAnswer_t *outAnswer)
 Send Reset command.

virtual bool singleBit_cmd (const bool inBitVal, const bool inStrongPullup=false)
 Send Single Bit command.

virtual void pulse_cmd (const bool inArm, const bool inProgPulse=false, const bool inImmidiateTerm=false, const unsigned int inSecTimeout=5)
 Send Pulse command.

virtual void pulse_cmd_manual (const unsigned long inSleepTime, const bool inProgPulse=false)
 Generate a pulse by manually sleeping.

virtual void searchAccelCtrl_cmd (const bool inAccelOn)
 The Search Accelerator Control command is used to set or reset the Search Accelerator control flag.

DS2480B configuration commands
The DS2480B is designed to be configurable for the varying requirements of its application.

When the device powers up and/or performs a master reset cycle, the hard wired default configuration settings take effect. These settings will work on a short 1-Wire bus and assume regular 1-Wire communication speed. To change these default settings and to verify the current settings, the logic of the DS2480B supports configuration commands. A summary of the available configuration parameters, their default settings at regular and Overdrive speed and their applicability is shown in Table 3.

Parameters not related to the communication speed on the 1-Wire bus specify the duration of the 12V programming pulse, the duration of the strong pull up to 5V, the threshold current of the load sensor for dynamic strong pullup duration, and the baud rate on the interface that connects the DS2480B to the host.

The remaining three parameters are used to modify the 1-Wire communication wave forms if one selects Flexible Speed.

Configuration parameter overview:

| | Confgrable at| Default Parameter Description |Par.Code|Reg.|Flex|Ovrd| Reg/Flex| Overdrive ============================+========+====+====+====+=========+========== Pull-Down Slew Rate Control | 001 1 | | X | | 15 V/µs | 15 V/µs ----------------------------+--------+----+----+----+---------+---------- Programming Pulse Duration | 010 2 | X | X | X | 512 µs | 512 µs ----------------------------+--------+----+----+----+---------+---------- Strong Pullup Duration | 011 3 | X | X | X | 524 ms | 524 ms ----------------------------+--------+----+----+----+---------+---------- Write-1 Low Time | 100 4 | | X | | 8 µs | 1 µs ----------------------------+--------+----+----+----+---------+---------- Sample Offset | 101 5 | | X | | 3 µs | 1 µs and Write 0 Recovery Time | | | | | 3 µs | 3 µs ----------------------------+--------+----+----+----+---------+---------- Load Sensor Threshold | 110 6 | X | X | X | 3 mA | 3 mA ----------------------------+--------+----+----+----+---------+---------- RS232 Baud Rate | 111 7 | X | X | X | 9.6 kbps| 9.6 kbps

Configuration parameter value codes:

| Value Codes | Parameter Code | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | Unit ===============+=====+=====+=====+=====+=====+=====+=====+=====+======== 001 (PDSR) | 15 | 2.2 | 1.65| 1.37| 1.1 | 0.83| 0.7 | 0.55| V/µs ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 010 (PPD) | 32 | 64 | 128 | 256 | 512 | 1024| 2048| inf.| µs ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 011 (SPUD) | 16.4| 65.5| 131 | 262 | 524 | 1048| dyn.| inf.| ms ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 100 (W1LT) | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | µs ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 101 (SOW0RT) | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | µs ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 110 (LST) | 1.8 | 2.1 | 2.4 | 2.7 | 3.0 | 3.3 | 3.6 | 3.9 | mA ---------------+-----+-----+-----+-----+-----+-----+-----+-----+-------- 111 (RBR) | 9.6 | 19.2| 57.6|115.2| 9.6 | 19.2| 57.6|115.2| kbits/s


virtual void setPullDownSlewRate_cmd (const PDSR_val_t inPDSR)
 Set the Pulldown Slew Rate Control.

virtual PDSR_val_t getPullDownSlewRate_cmd ()
 Get the Pulldown Slew Rate Control.

virtual void setProgPulseDuration_cmd (const PPD_val_t inPPD)
 Set the Programming Pulse Duration.

virtual PPD_val_t getProgPulseDuration_cmd ()
 Get the Programming Pulse Duration.

virtual void setStrongPullupDuration_cmd (const SPUD_val_t inSPUD)
 Set the Strong Pullup Duration.

virtual SPUD_val_t getStrongPullupDuration_cmd ()
 Get the Strong Pullup Duration.

virtual void setWrite1LowTime_cmd (const W1LT_val_t inW1LT)
 Set the Write 1 Low Time.

virtual W1LT_val_t getWrite1LowTime_cmd ()
 Get the Write 1 Low Time.

virtual void setSampleOffsetWrite0Rec_cmd (const SOW0RT_val_t inSOW0RT)
 Set the Sample Offset / Write 0 Recovery time.

virtual SOW0RT_val_t getSampleOffsetWrite0Rec_cmd ()
 Get the Sample Offset / Write 0 Recovery time.

virtual void setLoadSensorThreshold_cmd (const LST_val_t inLST)
 Set the Load Sensor Threshold.

virtual LST_val_t getLoadSensorThreshold_cmd ()
 Set the Load Sensor Threshold.

virtual void setRS232BaudRate_cmd (const RBR_val_t inRBR, const RXPOL_val_t inRXPOL)
 Set the RS232 Baud Rate and RXD polarity.

virtual RBR_val_t getRS232BaudRate_cmd ()
 Get the RS232 Baud Rate.

virtual RXPOL_val_t getRS232RxPol_cmd ()
 Get the RS232 RXD polarity.

Internal methods
virtual void writeConfigValue (const uint8_t inParamCode, const uint8_t inParamValue)
 Write a config value to DS2480B and do sanity checking.

virtual uint8_t readConfigValue (const uint8_t inParamCode)
 Read a config value from DS2480B and do sanity checking.

virtual void setMode (const internalMode_t inMode)
 Switch between DS2480B data/command mode and vice versa.

Enumeration type conversion methods
virtual const SPUD_val_t strongPullup_2_SPUD_val (const strongPullup_t inStrongPullup) const
 Convert value of type strongPullup_t to SPUD_val_t.

virtual const LOW_linkDS2480B::PPD_val_t progPulse_2_PPD_val (const progPulse_t inProgPulse) const
 Convert value of type progPulse_t to PPD_val_t.

virtual const pdSlewRate_t PDSR_val_2_pdSlewRate (const PDSR_val_t inPDSR_val) const
 Convert value of type PDSR_val_t to pdSlewRate_t.

virtual const PDSR_val_t pdSlewRate_2_PDSR_val (const pdSlewRate_t inPdSlewRate_t) const
 Convert value of type pdSlewRate_t to PDSR_val_t.

virtual const w1LowTime_t W1LT_val_2_w1LowTime (const W1LT_val_t inW1LT_val) const
 Convert value of type W1LT_val_t to w1LowTime_t.

virtual const W1LT_val_t w1LowTime_2_W1LT_val (const w1LowTime_t inW1LowTime) const
 Convert value of type w1LowTime_t to W1LT_val_t.

virtual const soW0RecTime_t SOW0RT_val_2_soW0RecTime (const SOW0RT_val_t inSOW0RT_val) const
 Convert value of type SOW0RT_val_t to soW0RecTime_t.

virtual const SOW0RT_val_t soW0RecTime_2_SOW0RT_val (const soW0RecTime_t inSoW0RecTime) const
 Convert value of type soW0RecTime_t to SOW0RT_val_t.

virtual const wireSpeed_t OWSPEED_val_2_wireSpeed (const OWSPEED_val_t inOWSPEED_val) const
 Convert value of type OWSPEED_val_t to wireSpeed_t.

virtual const OWSPEED_val_t wireSpeed_2_OWSPEED_val (const wireSpeed_t inWireSpeed) const
 Convert value of type wireSpeed_t to OWSPEED_val_t.


Private Attributes

LOW_portSerialserialPort
 The serial port the adapter is attached to.

const RXPOL_val_t receivePolarity
 Polarity of RXD pin.

internalMode_t internalMode
 Mode (cmd/data) of DS2480B.


Static Private Attributes

Communication command bytes
const uint8_t SerialSpeedAdapt_Cmd = 0xc1
 Communication command byte.

const uint8_t SwitchToDataMode_Cmd = 0xe1
 Communication command byte.

const uint8_t SwitchToCommandMode_Cmd = 0xe3
 Communication command byte.

const uint8_t PulseTermination_Cmd = 0xf1
 Communication command byte.

const uint8_t Reset_Cmd = 0xc1
 Communication command byte.

const uint8_t SearchAccel_Cmd = 0xa1
 Communication command byte.

const uint8_t Pulse_Cmd = 0xe1
 Communication command byte.

const uint8_t SingleBit_Cmd = 0x81
 Communication command byte.

Configuration command bytes
const uint8_t PullDownSlewRate_cfgCmd = 0x01
 Configuration command byte.

const uint8_t ProgPulseDuration_cfgCmd = 0x02
 Configuration command byte.

const uint8_t StrongPullupDuration_cfgCmd = 0x03
 Configuration command byte.

const uint8_t Write1LowTime_cfgCmd = 0x04
 Configuration command byte.

const uint8_t SampleOffsetWrite0Rec_cfgCmd = 0x05
 Configuration command byte.

const uint8_t LoadSensorThreshold_cfgCmd = 0x06
 Configuration command byte.

const uint8_t RS232BaudRate_cfgCmd = 0x07
 Configuration command byte.


Detailed Description

Link class for DS2480B Serial 1-Wire Line Driver with Load Sensor.

DS2480B features:

The DS2480B is a serial port to 1-Wire interface chip that supports regular and Overdrive speeds. It connects directly to UARTs and 5V RS232 systems. Interfacing to RS232C (± 12V levels) requires a passive clamping circuit and one 5V to ±12V level translator. Internal timers relieve the host of the burden of generating the time-critical 1-Wire communication waveforms. In contrast to the DS9097(E) where a full character must be sent by the host for each 1-Wire time slot, the DS2480B can translate each character into eight 1-Wire time slots, thereby increasing the data throughput significantly. In addition, the DS2480B can be set to communicate at four different data rates, including 115.2 kbps, 57.6 kbps and 19.2 kbps with 9.6 kbps being the power-on default. Command codes received from the host s crystal controlled UART serve as a reference to continuously calibrate the on-chip timing generator. The DS2480B uses a unique protocol that merges data and control information without requiring control pins. This approach maintains compatibility to off-the-shelf serial to wireless converters, allowing easy realization of 1-Wire media jumpers. The various control functions of the DS2480B are optimized for MicroLAN 1-Wire networks and support the special needs of all current 1-Wire devices including the crypto iButton, EPROM-based Add-Only Memories, EEPROM devices and 1-Wire Thermometers.

This class is thread-safe.

Todo:
Provide assignment operator and copy constructor

Complete documentation of exceptions thrown.

Author:
Harald Roelle

Parts of the documentation by Dallas Semiconductors / Maxim Integrated Products

Definition at line 75 of file LOW_linkDS2480B.h.


Member Typedef Documentation

typedef std::vector<LOW_linkFlexibleSpeed*> LOW_linkFlexibleSpeed::flexLinkPtrVec_t [inherited]
 

Vector type of link class pointers.

Definition at line 64 of file LOW_linkFlexibleSpeed.h.

typedef LOW_objectIDFactory::objectID_t LOW_link::linkID_t [inherited]
 

Type for individual link ID number.

Definition at line 126 of file LOW_link.h.

typedef std::vector<LOW_link*> LOW_link::linkPtrVec_t [inherited]
 

Vector type of link class pointers.

Definition at line 124 of file LOW_link.h.

typedef struct LOW_linkDS2480B::resetAnswer_t LOW_linkDS2480B::resetAnswer_t [private]
 

Reset command reply.


Member Enumeration Documentation

enum LOW_linkDS2480B::busStatus_t [private]
 

Bus status in reset command reply.

Enumeration values:
oneWireShorted_busStat 
presencePulse_busStat 
alarmingPresencePulse_busStat 
noPresencePulse_busStat 

Definition at line 225 of file LOW_linkDS2480B.h.

enum LOW_linkDS2480B::internalMode_t [private]
 

Type for internal mode flag.

Enumeration values:
command_mode 
data_mode 

Definition at line 239 of file LOW_linkDS2480B.h.

enum LOW_linkDS2480B::LST_val_t [private]
 

Load Sensor Threshold values.

Enumeration values:
LST_1_8 
LST_2_1 
LST_2_4 
LST_2_7 
LST_3_0 
LST_3_3 
LST_3_6 
LST_3_9 

Definition at line 219 of file LOW_linkDS2480B.h.

Referenced by getLoadSensorThreshold_cmd().

enum LOW_linkDS2480B::OWSPEED_val_t [private]
 

Type for wirespeed.

Enumeration values:
normal_OWSPEED  16 kbps
flexible_OWSPEED 
overdrive_OWSPEED  142 kbps

Definition at line 207 of file LOW_linkDS2480B.h.

Referenced by wireSpeed_2_OWSPEED_val().

enum LOW_linkFlexibleSpeed::pdSlewRate_t [inherited]
 

Type for flexible speed pulldown slew rate in V/microsec.

Enumeration values:
pdSlewRate_15  Pulldown slew rate 15 V/microsec.
pdSlewRate_2_2  Pulldown slew rate 2.2 V/microsec.
pdSlewRate_1_65  Pulldown slew rate 1.65 V/microsec.
pdSlewRate_1_37  Pulldown slew rate 1.37 V/microsec.
pdSlewRate_1_1  Pulldown slew rate 1.1 V/microsec.
pdSlewRate_0_83  Pulldown slew rate 0.83 V/microsec.
pdSlewRate_0_7  Pulldown slew rate 0.7 V/microsec.
pdSlewRate_0_55  Pulldown slew rate 0.55 V/microsec.

Definition at line 76 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getPullDownSlewRate(), LOW_linkDS2490::getPullDownSlewRate(), getPullDownSlewRate(), LOW_linkDS2490::PDSR_val_2_pdSlewRate(), and PDSR_val_2_pdSlewRate().

enum LOW_linkDS2480B::PDSR_val_t [private]
 

Type for flexible speed pulldown slew rate in V/microsec.

Enumeration values:
PDSR_15 
PDSR_2_2 
PDSR_1_65 
PDSR_1_37 
PDSR_1_1 
PDSR_0_83 
PDSR_0_7 
PDSR_0_55 

Definition at line 209 of file LOW_linkDS2480B.h.

Referenced by getPullDownSlewRate_cmd(), and pdSlewRate_2_PDSR_val().

enum LOW_linkDS2480B::PPD_val_t [private]
 

Programming Pulse Duration values.

Enumeration values:
PPD_32 
PPD_64 
PPD_128 
PPD_256 
PPD_512 
PPD_1024 
PPD_2048 
PPD_inf 

Definition at line 215 of file LOW_linkDS2480B.h.

Referenced by getProgPulseDuration_cmd(), and progPulse_2_PPD_val().

enum LOW_link::progPulse_t [inherited]
 

Type for 12V program pulse period specification.

Period may vary a little, depending on actual device.

Enumeration values:
progPulse_32  32 microsec
progPulse_64  64 microsec
progPulse_128  128 microsec
progPulse_256  256 microsec
progPulse_512  512 microsec
progPulse_1024  1024 microsec
progPulse_2048  2032 / 2048 microsec

Definition at line 141 of file LOW_link.h.

enum LOW_linkDS2480B::RBR_val_t [private]
 

RS232 Baud Rate values.

Enumeration values:
RBR_9_6 
RBR_19_2 
RBR_57_6 
RBR_115_2 

Definition at line 221 of file LOW_linkDS2480B.h.

Referenced by getRS232BaudRate_cmd(), and resetLinkAdapter().

enum LOW_linkDS2480B::RXPOL_val_t
 

Enumeration values:
RXPOL_NORM 
RXPOL_INV 

Definition at line 85 of file LOW_linkDS2480B.h.

Referenced by getRS232RxPol_cmd().

enum LOW_linkFlexibleSpeed::soW0RecTime_t [inherited]
 

Type for flexible speed DSO/ W0R time in microsec.

Enumeration values:
soW0RecTime_3  DSO/w0R time 3 microsec.
soW0RecTime_4  DSO/w0R time 4 microsec.
soW0RecTime_5  DSO/w0R time 5 microsec.
soW0RecTime_6  DSO/w0R time 6 microsec.
soW0RecTime_7  DSO/w0R time 7 microsec.
soW0RecTime_8  DSO/w0R time 8 microsec.
soW0RecTime_9  DSO/w0R time 9 microsec.
soW0RecTime_10  DSO/w0R time 10 microsec.

Definition at line 98 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getSampleOffsetWrite0Rec(), LOW_linkDS2490::getSampleOffsetWrite0Rec(), getSampleOffsetWrite0Rec(), LOW_linkDS2490::SOW0RT_val_2_soW0RecTime(), and SOW0RT_val_2_soW0RecTime().

enum LOW_linkDS2480B::SOW0RT_val_t [private]
 

Type for flexible speed DSO/ W0R time in microsec.

Enumeration values:
SOW0RT_3 
SOW0RT_4 
SOW0RT_5 
SOW0RT_6 
SOW0RT_7 
SOW0RT_8 
SOW0RT_9 
SOW0RT_10 

Definition at line 213 of file LOW_linkDS2480B.h.

Referenced by getSampleOffsetWrite0Rec_cmd(), and soW0RecTime_2_SOW0RT_val().

enum LOW_linkDS2480B::SPUD_val_t [private]
 

Strong Pullup Duration values.

Enumeration values:
SPUD_16_4 
SPUD_65_5 
SPUD_131 
SPUD_262 
SPUD_524 
SPUD_1048 
SPUD_dyn 
SPUD_inf 

Definition at line 217 of file LOW_linkDS2480B.h.

Referenced by getStrongPullupDuration_cmd(), and strongPullup_2_SPUD_val().

enum LOW_link::strongPullup_t [inherited]
 

Type for strong pullup period specification.

Period may vary a little, depending on actual device.

Enumeration values:
pullUp_16_4  16 / 16.4 ms
pullUp_65_5  64 / 65.5 ms
pullUp_131  128 / 131 ms
pullUp_262  256 / 262 ms
pullUp_524  512 / 524 ms
pullUp_1048  1024 / 1048 ms
pullUp_NONE  no pullup

Definition at line 130 of file LOW_link.h.

enum LOW_linkFlexibleSpeed::w1LowTime_t [inherited]
 

Type for flexible speed write-1 low time in microsec.

Enumeration values:
w1LowTime_8  Write-1 low time 8 microsec.
w1LowTime_9  Write-1 low time 9 microsec.
w1LowTime_10  Write-1 low time 10 microsec.
w1LowTime_11  Write-1 low time 11 microsec.
w1LowTime_12  Write-1 low time 12 microsec.
w1LowTime_13  Write-1 low time 13 microsec.
w1LowTime_14  Write-1 low time 14 microsec.
w1LowTime_15  Write-1 low time 15 microsec.

Definition at line 87 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getWrite1LowTime(), LOW_linkDS2490::getWrite1LowTime(), getWrite1LowTime(), LOW_linkDS2490::W1LT_val_2_w1LowTime(), and W1LT_val_2_w1LowTime().

enum LOW_linkDS2480B::W1LT_val_t [private]
 

Type for flexible speed write-1 low time in microsec.

Enumeration values:
W1LT_8 
W1LT_9 
W1LT_10 
W1LT_11 
W1LT_12 
W1LT_13 
W1LT_14 
W1LT_15 

Definition at line 211 of file LOW_linkDS2480B.h.

Referenced by getWrite1LowTime_cmd(), and w1LowTime_2_W1LT_val().

enum LOW_linkFlexibleSpeed::wireSpeed_t [inherited]
 

1-Wire communication speeds.

Enumeration values:
normal_speed  Normal 1-Wire speed, 16 kbps.
flexible_speed  Flexible 1-Wire speed.
overdrive_speed  Overdrive 1-Wire speed, 142 kbps.

Definition at line 67 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkDS2490::getWireSpeed(), getWireSpeed(), LOW_linkDS2490::OWSPEED_val_2_wireSpeed(), and OWSPEED_val_2_wireSpeed().


Constructor & Destructor Documentation

LOW_linkDS2480B::LOW_linkDS2480B const LOW_portSerialFactory::portSpecifier_t &  inSerPortSpec,
const RXPOL_val_t  inRXPOL,
const bool  inHasExternalPower,
const bool  inAllowProgPulse = false
 

Constructor.

Timings for flexible speed is configured to the recommeded optimal parameters as of app note #148.

Parameters:
inSerPortSpec Serial port the DS2480B is connected to.
inRXPOL Whether RX signal polarity is inverted to TX signal.
inHasExternalPower Whether the attached bus supplies external power.
inAllowProgPulse Whether the program pulse should be allowed.

Definition at line 22 of file LOW_linkDS2480B.cpp.

References LOW_portSerialFactory::new_portSerial(), resetLinkAdapter(), and serialPort.

LOW_linkDS2480B::~LOW_linkDS2480B  )  [virtual]
 

Destructor.

Definition at line 34 of file LOW_linkDS2480B.cpp.

References serialPort, and LOW_portSerial::tty_flush().


Member Function Documentation

LOW_linkFlexibleSpeed::class_DERIVE_FROM_EXCEPTION incompatibleSpeed_error  ,
LOW_exception 
[inherited]
 

Exception base class for all exceptions thrown by LOW_link.

LOW_link::class_DERIVE_FROM_EXCEPTION sizeMismatch_error  ,
link_error 
[inherited]
 

LOW_link::class_DERIVE_FROM_EXCEPTION notAllowed_error  ,
link_error 
[inherited]
 

Exception class to be thrown on access violation errors.

LOW_link::class_DERIVE_FROM_EXCEPTION illegalLevel_error  ,
link_error 
[inherited]
 

Exception class to be thrown on errors related to requested voltage level.

LOW_link::class_DERIVE_FROM_EXCEPTION illegalSpeed_error  ,
link_error 
[inherited]
 

Exception class to be thrown on errors related to currently selected wire speed.

LOW_link::class_DERIVE_FROM_EXCEPTION internal_error  ,
link_error 
[inherited]
 

Exception class to be thrown on pure internal errors.

LOW_link::class_DERIVE_FROM_EXCEPTION comm_error  ,
link_error 
[inherited]
 

Exception class to be thrown on communication errors.

LOW_link::class_DERIVE_FROM_EXCEPTION link_error  ,
LOW_exception 
[inherited]
 

Exception base class for all exceptions thrown by LOW_link.

void LOW_linkDS2480B::doSearchSequence const LOW_deviceIDRaw inBranchVector,
LOW_deviceIDRaw outFoundID,
LOW_deviceIDRaw outDiscrVec
[protected, virtual]
 

Execute a single search sequence on the bus.

A default implementation relying on bit i/o methods is provided.

Parameters:
inBranchVector ID vector to start the search sequence.
outFoundID Device ID found.
outDiscrVec Discrepancy vector after the search.

Reimplemented from LOW_link.

Definition at line 311 of file LOW_linkDS2480B.cpp.

References byteVec_t, LOW_deviceIDRaw::getBit(), searchAccelCtrl_cmd(), LOW_deviceIDRaw::setBit(), and touchBlock().

bool LOW_link::getAllowProgPulse  )  const [inherited]
 

Get wether the program pulse should be allowed.

Returns:
Wether the program pulse should be allowed.

Definition at line 80 of file LOW_link.cpp.

References LOW_link::allowProgPulse.

bool LOW_link::getHasExternalPower  )  const [inherited]
 

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 74 of file LOW_link.cpp.

References LOW_link::hasExternalPower.

Referenced by LOW_netSegment::LOW_netSegment().

bool LOW_link::getHasProgramPulse  )  const [inherited]
 

Get wether the adapter is capable of 12V Program pulse.

Returns:
Wether the adapter is capable of 12V Program pulse.

Definition at line 68 of file LOW_link.cpp.

References LOW_link::hasProgramPulse.

uint32_t LOW_link::getID  )  const [inherited]
 

Get ID of the link.

Returns:
ID of the link.

Definition at line 62 of file LOW_link.cpp.

References LOW_link::linkID.

virtual std::string LOW_linkDS2480B::getLinkFamily  )  const [inline, virtual]
 

Get the link's family type.

Note: Subclasses must implement this method to return a clear text name of their kind.

Returns:
Family type name of the link.

Implements LOW_link.

Definition at line 116 of file LOW_linkDS2480B.h.

LOW_linkDS2480B::LST_val_t LOW_linkDS2480B::getLoadSensorThreshold_cmd  )  [private, virtual]
 

Set the Load Sensor Threshold.

See setLoadSensorThreshold_cmd()

Definition at line 649 of file LOW_linkDS2480B.cpp.

References LoadSensorThreshold_cfgCmd, LST_val_t, and readConfigValue().

LOW_linkDS2480B::PPD_val_t LOW_linkDS2480B::getProgPulseDuration_cmd  )  [private, virtual]
 

Get the Programming Pulse Duration.

See setProgPulseDuration_cmd()

Definition at line 589 of file LOW_linkDS2480B.cpp.

References PPD_val_t, ProgPulseDuration_cfgCmd, and readConfigValue().

LOW_linkDS2480B::pdSlewRate_t LOW_linkDS2480B::getPullDownSlewRate  )  [virtual]
 

Get the Pulldown Slew Rate Control.

Current speed checking is done by provided implementation.

Note:Implementations should NOT simply return the value saved in this class, but read the actual values from the device.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 389 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::getPullDownSlewRate(), getPullDownSlewRate_cmd(), LOW_linkFlexibleSpeed::pdSlewRate_t, and PDSR_val_2_pdSlewRate().

LOW_linkDS2480B::PDSR_val_t LOW_linkDS2480B::getPullDownSlewRate_cmd  )  [private, virtual]
 

Get the Pulldown Slew Rate Control.

See setPullDownSlewRate_cmd()

Definition at line 574 of file LOW_linkDS2480B.cpp.

References PDSR_val_t, PullDownSlewRate_cfgCmd, and readConfigValue().

Referenced by getPullDownSlewRate().

LOW_linkDS2480B::RBR_val_t LOW_linkDS2480B::getRS232BaudRate_cmd  )  [private, virtual]
 

Get the RS232 Baud Rate.

See setRS232BaudRate_cmd()

Definition at line 664 of file LOW_linkDS2480B.cpp.

References RBR_val_t, readConfigValue(), and RS232BaudRate_cfgCmd.

LOW_linkDS2480B::RXPOL_val_t LOW_linkDS2480B::getRS232RxPol_cmd  )  [private, virtual]
 

Get the RS232 RXD polarity.

See setRS232BaudRate_cmd()

Definition at line 671 of file LOW_linkDS2480B.cpp.

References readConfigValue(), RS232BaudRate_cfgCmd, and RXPOL_val_t.

LOW_linkDS2480B::soW0RecTime_t LOW_linkDS2480B::getSampleOffsetWrite0Rec  )  [virtual]
 

Get the Sample Offset / Write 0 Recovery time.

Current speed checking is done by provided implementation.

Note:Implementations should NOT simply return the value saved in this class, but read the actual values from the device.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 429 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::getSampleOffsetWrite0Rec(), getSampleOffsetWrite0Rec_cmd(), LOW_linkFlexibleSpeed::soW0RecTime_t, and SOW0RT_val_2_soW0RecTime().

LOW_linkDS2480B::SOW0RT_val_t LOW_linkDS2480B::getSampleOffsetWrite0Rec_cmd  )  [private, virtual]
 

Get the Sample Offset / Write 0 Recovery time.

See setSampleOffsetWrite0Rec_cmd()

Definition at line 634 of file LOW_linkDS2480B.cpp.

References readConfigValue(), SampleOffsetWrite0Rec_cfgCmd, and SOW0RT_val_t.

Referenced by getSampleOffsetWrite0Rec().

LOW_linkDS2480B::SPUD_val_t LOW_linkDS2480B::getStrongPullupDuration_cmd  )  [private, virtual]
 

Get the Strong Pullup Duration.

See setProgPulseDuration_cmd()

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 604 of file LOW_linkDS2480B.cpp.

References readConfigValue(), SPUD_val_t, and StrongPullupDuration_cfgCmd.

LOW_linkDS2480B::wireSpeed_t LOW_linkDS2480B::getWireSpeed  )  [virtual]
 

Get the 1-Wire speed mode.

Implements LOW_linkFlexibleSpeed.

Definition at line 371 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::wireSpeed, and LOW_linkFlexibleSpeed::wireSpeed_t.

LOW_linkDS2480B::w1LowTime_t LOW_linkDS2480B::getWrite1LowTime  )  [virtual]
 

Get the Write 1 Low Time.

Current speed checking is done by provided implementation.

Note:Implementations should NOT simply return the value saved in this class, but read the actual values from the device.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 409 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::getWrite1LowTime(), getWrite1LowTime_cmd(), LOW_linkFlexibleSpeed::w1LowTime_t, and W1LT_val_2_w1LowTime().

LOW_linkDS2480B::W1LT_val_t LOW_linkDS2480B::getWrite1LowTime_cmd  )  [private, virtual]
 

Get the Write 1 Low Time.

See setWrite1LowTime_cmd()

Definition at line 619 of file LOW_linkDS2480B.cpp.

References readConfigValue(), W1LT_val_t, and Write1LowTime_cfgCmd.

Referenced by getWrite1LowTime().

bool LOW_link::operator== LOW_link inLink  )  const [virtual, inherited]
 

Comparison based on linkID.

Definition at line 50 of file LOW_link.cpp.

References LOW_link::linkID.

const LOW_linkDS2480B::wireSpeed_t LOW_linkDS2480B::OWSPEED_val_2_wireSpeed const OWSPEED_val_t  inOWSPEED_val  )  const [private, virtual]
 

Convert value of type OWSPEED_val_t to wireSpeed_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 884 of file LOW_linkDS2480B.cpp.

References flexible_OWSPEED, LOW_linkFlexibleSpeed::flexible_speed, normal_OWSPEED, LOW_linkFlexibleSpeed::normal_speed, overdrive_OWSPEED, LOW_linkFlexibleSpeed::overdrive_speed, and LOW_linkFlexibleSpeed::wireSpeed_t.

const LOW_linkDS2480B::PDSR_val_t LOW_linkDS2480B::pdSlewRate_2_PDSR_val const pdSlewRate_t  inPdSlewRate_t  )  const [private, virtual]
 

Convert value of type pdSlewRate_t to PDSR_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 796 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::pdSlewRate_0_55, LOW_linkFlexibleSpeed::pdSlewRate_0_7, LOW_linkFlexibleSpeed::pdSlewRate_0_83, LOW_linkFlexibleSpeed::pdSlewRate_15, LOW_linkFlexibleSpeed::pdSlewRate_1_1, LOW_linkFlexibleSpeed::pdSlewRate_1_37, LOW_linkFlexibleSpeed::pdSlewRate_1_65, LOW_linkFlexibleSpeed::pdSlewRate_2_2, PDSR_0_55, PDSR_0_7, PDSR_0_83, PDSR_15, PDSR_1_1, PDSR_1_37, PDSR_1_65, PDSR_2_2, and PDSR_val_t.

Referenced by setPullDownSlewRate().

const LOW_linkDS2480B::pdSlewRate_t LOW_linkDS2480B::PDSR_val_2_pdSlewRate const PDSR_val_t  inPDSR_val  )  const [private, virtual]
 

Convert value of type PDSR_val_t to pdSlewRate_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 779 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::pdSlewRate_0_55, LOW_linkFlexibleSpeed::pdSlewRate_0_7, LOW_linkFlexibleSpeed::pdSlewRate_0_83, LOW_linkFlexibleSpeed::pdSlewRate_15, LOW_linkFlexibleSpeed::pdSlewRate_1_1, LOW_linkFlexibleSpeed::pdSlewRate_1_37, LOW_linkFlexibleSpeed::pdSlewRate_1_65, LOW_linkFlexibleSpeed::pdSlewRate_2_2, LOW_linkFlexibleSpeed::pdSlewRate_t, PDSR_0_55, PDSR_0_7, PDSR_0_83, PDSR_15, PDSR_1_1, PDSR_1_37, PDSR_1_65, and PDSR_2_2.

Referenced by getPullDownSlewRate().

const LOW_linkDS2480B::PPD_val_t LOW_linkDS2480B::progPulse_2_PPD_val const progPulse_t  inProgPulse  )  const [private, virtual]
 

Convert value of type progPulse_t to PPD_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 762 of file LOW_linkDS2480B.cpp.

References PPD_1024, PPD_128, PPD_2048, PPD_256, PPD_32, PPD_512, PPD_64, PPD_val_t, LOW_link::progPulse_1024, LOW_link::progPulse_128, LOW_link::progPulse_2048, LOW_link::progPulse_256, LOW_link::progPulse_32, LOW_link::progPulse_512, and LOW_link::progPulse_64.

Referenced by programPulse().

void LOW_linkDS2480B::programPulse const progPulse_t  inPulseTime  )  [virtual]
 

Create a 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.

Note: Dependening on the implementation, time may only as accurate as the operating system permits (scheduling!).

Parameters:
inPulseTime Pulse time by predefined type.

Implements LOW_link.

Definition at line 296 of file LOW_linkDS2480B.cpp.

References LOW_link::allowProgPulse, LOW_link::hasProgramPulse, progPulse_2_PPD_val(), pulse_cmd(), and setProgPulseDuration_cmd().

void LOW_linkDS2480B::programPulse const unsigned long  inMicroSecs  )  [virtual]
 

Create a 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.

Note: Dependening on the implementation, time may only as accurate as the operating system permits (scheduling!).

Parameters:
inMicroSecs Pulse time in micro seconds.

Implements LOW_link.

Definition at line 271 of file LOW_linkDS2480B.cpp.

References LOW_link::allowProgPulse, LOW_link::hasProgramPulse, LOW_link::progPulse_1024, LOW_link::progPulse_128, LOW_link::progPulse_2048, LOW_link::progPulse_256, LOW_link::progPulse_32, LOW_link::progPulse_512, LOW_link::progPulse_64, and pulse_cmd_manual().

void LOW_linkDS2480B::pulse_cmd const bool  inArm,
const bool  inProgPulse = false,
const bool  inImmidiateTerm = false,
const unsigned int  inSecTimeout = 5
[private, virtual]
 

Send Pulse command.

The Pulse command serves several functions that are selected by the contents of bit 1 and bit 4 of the command code. The main functions are generating a strong pullup to 5V and generating 12V programming pulses for EPROM devices (if the 12V are available at the VPP pin). The secondary function of the pulse command is arming and disarming a strong pullup after every subsequent byte in Data Mode.

The arm/disarm function is controlled by bit 1 of the command code. Bit 4 determines whether the device will generate a strong pullup to 5V or a 12V programming pulse. The table below summarizes these options.

BIT 4 | BIT 1 | FUNCTION ======+=======+================================== 0 | 0 | strong pullup to 5V and disarm ------+-------+---------------------------------- 1 | 0 | 12V programming pulse and disarm ------+-------+---------------------------------- 0 | 1 | strong pullup to 5V and arm ------+-------+---------------------------------- 1 | 1 | 12V programming pulse and arm ------+-------+----------------------------------

The strong pullup to 5V is required to program EEPROM devices or to operate special function devices that require a higher current for a limited time after having received a go and convert command. Therefore and because it significantly reduces the effective data throughput on the 1-wire bus, the strong pullup is disarmed most of the time. Although arming or disarming is simultaneously possible while generating a programming pulse, this is not recommended since it is likely to destroy the DS2480B if non EPROM devices are connected to the 1 Wire bus.

The duration of the strong pullup or programming pulse is determined by configuration parameters and ranges from a few microseconds over dynamic duration (strong pullup only) up to unlimited (see section Configuration Commands). However, unlimited duration is not allowed in conjunction with arming the strong pullup after every byte. As long as the DS2480B is in Command Mode the host may terminate a strong pullup or programming pulse prematurely at any time by sending the command code F1h.

The response byte is generated as soon as the strong pullup or programming pulse is over (either because the predefined time has elapsed, the high current demand is over, or due to termination by the host). The response byte mainly returns the command code as sent by the host, but the 2 least significant bits are undefined.

If the strong pullup is armed and the device is in Data Mode, the end of the strong pullup will be signaled as code F6h if the most significant bit of the preceding data byte on the 1 Wire bus is a 1 and 76h otherwise. The host will see this response byte in addition to the response on the data byte sent.

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 ===============+=======+=======+=======+====================+=======+========+==========+======= Send Pulse | 1 | 1 |1 | 0 5V strong pullup | 11 pulse | 0 disarm | 1 | | | | 1 12V prog. pulse | | 1 arm | ---------------+-------+-------+-------+--------------------+-------+--------+----------+------- Response Pulse | 1 | 1 |1 | same as sent | undefined

Definition at line 496 of file LOW_linkDS2480B.cpp.

References byteVec_t, command_mode, Pulse_Cmd, PulseTermination_Cmd, serialPort, setMode(), LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write().

Referenced by programPulse(), strongPullup(), and touchByte().

void LOW_linkDS2480B::pulse_cmd_manual const unsigned long  inSleepTime,
const bool  inProgPulse = false
[private, virtual]
 

Generate a pulse by manually sleeping.

Parameters:
inSleepTime If it's a strong pullup sleep time in ms, if it's a program pulse sleep time in microseconds
inProgPulse Whether it's a strong pullup or a program pulse.

Definition at line 519 of file LOW_linkDS2480B.cpp.

References command_mode, LOW_platformMisc::microSleep(), LOW_platformMisc::milliSleep(), PPD_inf, Pulse_Cmd, PulseTermination_Cmd, serialPort, setMode(), setProgPulseDuration_cmd(), setStrongPullupDuration_cmd(), SPUD_inf, LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write().

Referenced by programPulse(), and strongPullup().

uint8_t LOW_linkDS2480B::readConfigValue const uint8_t  inParamCode  )  [private, virtual]
 

Read a config value from DS2480B and do sanity checking.

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 |BIT 0 =========================+=======+=======+=======+=======+=======+=======+=======+===== Send Read Parameter | 0 | 0 | 0 | 0 | parameter code | 1 -------------------------+-------+-------+-------+-------+-------+-------+-------+----- Response Read Parameter | 0 | same as sent | parameter value code | 0

Parameters:
inParamCode Selection of configuration value to read.
Returns:
Read config value.
Exceptions:
comm_error Thrown when sanity check fails.

Definition at line 700 of file LOW_linkDS2480B.cpp.

References command_mode, serialPort, setMode(), LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write().

Referenced by getLoadSensorThreshold_cmd(), getProgPulseDuration_cmd(), getPullDownSlewRate_cmd(), getRS232BaudRate_cmd(), getRS232RxPol_cmd(), getSampleOffsetWrite0Rec_cmd(), getStrongPullupDuration_cmd(), and getWrite1LowTime_cmd().

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

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 NOT appear after each byte sent, only after the last byte the pullup is done!

A default implementation relying on the touch methods is provided.

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.

Definition at line 130 of file LOW_link.cpp.

References byteVec_t, and LOW_link::touchBlock().

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

bool LOW_link::readDataBit const strongPullup_t  inPullup = pullUp_NONE  )  [virtual, inherited]
 

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

A default implementation relying on the touch methods is provided.

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

Definition at line 114 of file LOW_link.cpp.

References LOW_link::touchBit().

Referenced by LOW_devDS1820::cmd_ConvertT(), LOW_devDS2405::cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2405::cmd_SearchRead(), LOW_devDS2890::cmd_WriteControlRegister(), LOW_devDS2890::cmd_WritePosition(), LOW_link::doSearchSequence(), and LOW_devDS2406::cmd_ChannelAccess::readDataBit().

uint8_t LOW_link::readDataByte const strongPullup_t  inPullup = pullUp_NONE  )  [virtual, inherited]
 

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

A default implementation relying on the touch methods is provided.

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

Definition at line 122 of file LOW_link.cpp.

References LOW_link::touchByte().

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS2890::cmd_Decrement(), LOW_devDS2890::cmd_Increment(), LOW_devDS2890::cmd_WriteControlRegister(), LOW_devDS2890::cmd_WritePosition(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::cmd_ChannelAccess::readDataByte(), and LOW_devDS2406::readMemUniversal().

void LOW_linkDS2480B::reset_cmd resetAnswer_t outAnswer  )  [private, virtual]
 

Send Reset command.

The Reset command must be used to begin all 1-Wire communication. The speed selection included in the command code immediately takes effect. The response byte includes a code for the reaction on the 1 Wire bus (bits 0 and 1) and a code for the chip revision (bits 2 to 4). If bit 5 of the response byte reads 1, a programming voltage is present on the VPP pin, indicating that one may try programming EPROM devices.

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 ===============+=======+=======+===========+=======+=======+========+=======+==================== Send Reset | 1 | 1 | 0 | 0 | 00 reg. speed | 0 | 1 | | | | | 01 flex. speed | | | | | | | 10 OD. speed | | | | | | | 11 reg. speed | | ---------------+-------+-------+-----------+-------+-------+--------+-------+-------------------- Response Reset | 1 | 1 | 0 no Vpp | chip revision | 00 1-Wire shorted | | | 1 Vpp | | 01 presence pulse | | | present | | 10 alarming presence pulse | | | | | 11 no presence pulse

Definition at line 446 of file LOW_linkDS2480B.cpp.

References LOW_linkDS2480B::resetAnswer_t::busStatus, LOW_linkDS2480B::resetAnswer_t::chipRevision, command_mode, LOW_linkDS2480B::resetAnswer_t::isVppPresent, Reset_Cmd, serialPort, setMode(), LOW_portSerial::tty_flush(), LOW_portSerial::tty_readByte(), LOW_portSerial::tty_write(), LOW_linkFlexibleSpeed::wireSpeed, and wireSpeed_2_OWSPEED_val().

Referenced by resetBus().

bool LOW_linkDS2480B::resetBus  )  [virtual]
 

Todo:
Check if and how "alarming presence pulse" response works.

Implements LOW_link.

Definition at line 212 of file LOW_linkDS2480B.cpp.

References alarmingPresencePulse_busStat, LOW_linkDS2480B::resetAnswer_t::busStatus, LOW_link::hasProgramPulse, LOW_linkDS2480B::resetAnswer_t::isVppPresent, noPresencePulse_busStat, oneWireShorted_busStat, presencePulse_busStat, and reset_cmd().

Referenced by setWireSpeed().

void LOW_linkDS2480B::resetLinkAdapter  )  [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.

Implements LOW_link.

Definition at line 131 of file LOW_linkDS2480B.cpp.

References LOW_portSerial::B57600_speed, LOW_portSerial::B9600_speed, LOW_portSerial::bit1_stopBit, LOW_portSerial::bit8_size, command_mode, LOW_linkFlexibleSpeed::flexible_speed, internalMode, LOW_platformMisc::milliSleep(), LOW_portSerial::no_parity, LOW_portSerial::none_flowControl, LOW_linkFlexibleSpeed::normal_speed, LOW_linkFlexibleSpeed::overdrive_speed, LOW_linkFlexibleSpeed::pdSlewRate, RBR_57_6, RBR_9_6, RBR_val_t, receivePolarity, serialPort, SerialSpeedAdapt_Cmd, setPullDownSlewRate(), setRS232BaudRate_cmd(), setSampleOffsetWrite0Rec(), setWrite1LowTime(), LOW_linkFlexibleSpeed::soW0RecTime, LOW_portSerial::tty_break(), LOW_portSerial::tty_configure(), LOW_portSerial::tty_flush(), LOW_portSerial::tty_write(), LOW_linkFlexibleSpeed::w1LowTime, and LOW_linkFlexibleSpeed::wireSpeed.

Referenced by LOW_linkDS2480B(), and setWireSpeed().

void LOW_linkDS2480B::searchAccelCtrl_cmd const bool  inAccelOn  )  [private, virtual]
 

The Search Accelerator Control command is used to set or reset the Search Accelerator control flag.

Bit 4 of the command code contains the state to which the accelerator control flag is to be set. If the flag is set to a 1 (on) the device translates every byte received in Data Mode into a 12 bit sequence on the 1-Wire bus. Before activating the Search Accelerator, one must make sure that the strong pullup after every byte is disarmed (see Pulse Command). The Search Accelerator command does not generate a command response byte.

Although the Search Accelerator Control command itself does not generate any 1-Wire activity, it can be used to select the communication speed on the 1-Wire bus. The speed selection (if different from the previous setting, e.g., from a Reset command) will take effect immediately.

Command code description:

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 ==============+=======+=======+=======+====================+=======+========+=======+======= Search Accel. | 1 | 0 | 1 | 0 accelerator off | 00 reg. speed | 0 | 1 Control | | | | 1 = accelerator on | 01 flex. speed | | | | | | | 10 OD. speed | | | | | | | 11 reg. speed | |

Definition at line 549 of file LOW_linkDS2480B.cpp.

References command_mode, SearchAccel_Cmd, serialPort, setMode(), LOW_portSerial::tty_write(), LOW_linkFlexibleSpeed::wireSpeed, and wireSpeed_2_OWSPEED_val().

Referenced by doSearchSequence().

LOW_deviceID::deviceIDVec_t LOW_link::searchDevices const bool  inOnlyAlarm,
const LOW_deviceIDRaw  inPreload,
const LOW_deviceIDRaw::devFamCode_t  inFamCode,
const bool  inDoReset
[virtual, inherited]
 

Execute a complete search sequence from preloaded ID vector.

Search is executed on the currently active bus configuration. No branch selection is done in advance.

A default implementation relying on the doSearchSequence() method is provided.

Parameters:
inOnlyAlarm Select normal search or alarmin only search.
inPreload The ID vector to start the search from.
inFamCode Narrow search to given family code. To not narrow use LOW_device::anyDev_famCode.
Returns:
List of devices found on the currently active bus configuration.

Reimplemented in LOW_linkDS2490.

Definition at line 185 of file LOW_link.cpp.

References LOW_device::anyDev_famCode, LOW_deviceID::deviceIDVec_t, LOW_link::doSearchSequence(), LOW_deviceIDRaw::getBit(), LOW_deviceIDRaw::getFamilyCode(), LOW_link::resetBus(), LOW_device::SearchAlarmROM_COMMAND, LOW_device::SearchROM_COMMAND, LOW_deviceIDRaw::setBit(), LOW_deviceIDRaw::setFamilyCode(), and LOW_link::writeData().

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

void LOW_linkDS2480B::setLoadSensorThreshold_cmd const LST_val_t  inLST  )  [private, virtual]
 

Set the Load Sensor Threshold.

Parameter Load Sensor Threshold has been implemented in order to more efficiently support the high current demand of the crypto iButton. The load sensor is only active if "dynamic" for the Strong Pullup Duration has been selected. The nominal and default value for the load sensor threshold is 3.0 mA with a tolerance band of -25% to +80%. The sensor threshold should be left at its default value; changes should only be made to compensate for tolerances. Dynamic duration should only be used when operating crypto iButtons and not for gang-programming 1-Wire EEPROMs or measuring temperature with multiple temperature sensors converting simultaneously.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 642 of file LOW_linkDS2480B.cpp.

References LoadSensorThreshold_cfgCmd, and writeConfigValue().

void LOW_linkDS2480B::setMode const internalMode_t  inMode  )  [private, virtual]
 

Switch between DS2480B data/command mode and vice versa.

It is safe to call the method regardless of current state.

Parameters:
inMode Desired DS2480 mode.
Exceptions:
internal_error Thrown on illegal transition (should never happen).

Definition at line 718 of file LOW_linkDS2480B.cpp.

References command_mode, data_mode, internalMode, serialPort, SwitchToCommandMode_Cmd, SwitchToDataMode_Cmd, and LOW_portSerial::tty_write().

Referenced by pulse_cmd(), pulse_cmd_manual(), readConfigValue(), reset_cmd(), searchAccelCtrl_cmd(), singleBit_cmd(), touchBlock(), touchByte(), and writeConfigValue().

void LOW_linkDS2480B::setProgPulseDuration_cmd const PPD_val_t  inPPD  )  [private, virtual]
 

Set the Programming Pulse Duration.

For parameter Programming Pulse Duration one may select indefinite duration. This value, however, should only be selected if one is not going to switch the device to Data Mode. As long as the device stays in Command Mode, any pulse function (programming or strong pullup) that uses one of these parameters can be terminated by sending the command code F1h. Termination is not possible if the device is in Data Mode.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 582 of file LOW_linkDS2480B.cpp.

References ProgPulseDuration_cfgCmd, and writeConfigValue().

Referenced by programPulse(), and pulse_cmd_manual().

void LOW_linkDS2480B::setPullDownSlewRate const pdSlewRate_t  inPDSR  )  [virtual]
 

Set the Pulldown Slew Rate Control.

Current speed checking and remembering the value is done by provided implementation.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 379 of file LOW_linkDS2480B.cpp.

References pdSlewRate_2_PDSR_val(), LOW_linkFlexibleSpeed::setPullDownSlewRate(), and setPullDownSlewRate_cmd().

Referenced by resetLinkAdapter().

void LOW_linkDS2480B::setPullDownSlewRate_cmd const PDSR_val_t  inPDSR  )  [private, virtual]
 

Set the Pulldown Slew Rate Control.

The numbers given Pulldown Slew Rate Control are nominal values. They may vary to some extent and are almost independent of the load on the 1-Wire bus.

Whenever the DS2480B begins pulling the 1-Wire bus low to initiate a time slot, for example, it first turns off the weak pullup current IWEAKPU. Then, at regular and Overdrive speeds it will generate a falling edge at a slew rate of typically 15V/ms. This value is acceptable for short 1-Wire busses and adequate for communication at Overdrive speed. For MicroLAN networks of more than roughly 30 meters length one should always use flexible speed. One of the parameters that is adjustable at flexible speed is the slew rate of DS2480B initiated falling edges.

As extensive tests have shown, MicroLAN networks at a length of up to 300 meters will perform best if the fall time tF is in the range of 4 ± 0.5 ms. This translates into a slew rate of approximately 1V/ms. If the actual measured fall time is longer than the target value, one should use a value of 1.37 V/µs or higher. If the fall time is shorter, one should use a value of 0.83 V/µs or lower.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 567 of file LOW_linkDS2480B.cpp.

References PullDownSlewRate_cfgCmd, and writeConfigValue().

Referenced by setPullDownSlewRate().

void LOW_linkDS2480B::setRS232BaudRate_cmd const RBR_val_t  inRBR,
const RXPOL_val_t  inRXPOL
[private, virtual]
 

Set the RS232 Baud Rate and RXD polarity.

Parameter RS232 Baud Rate has two functions. It selects the baud rate and allows inversion of the signal at the RXD pin. Note that when changing the baud rate, the DS2480B will send the command response byte at the new data rate.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 657 of file LOW_linkDS2480B.cpp.

References RS232BaudRate_cfgCmd, and writeConfigValue().

Referenced by resetLinkAdapter().

void LOW_linkDS2480B::setSampleOffsetWrite0Rec const soW0RecTime_t  inSOW0RT  )  [virtual]
 

Set the Sample Offset / Write 0 Recovery time.

Current speed checking and remembering the value is done by provided implementation.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 419 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::setSampleOffsetWrite0Rec(), setSampleOffsetWrite0Rec_cmd(), and soW0RecTime_2_SOW0RT_val().

Referenced by resetLinkAdapter().

void LOW_linkDS2480B::setSampleOffsetWrite0Rec_cmd const SOW0RT_val_t  inSOW0RT  )  [private, virtual]
 

Set the Sample Offset / Write 0 Recovery time.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 627 of file LOW_linkDS2480B.cpp.

References SampleOffsetWrite0Rec_cfgCmd, and writeConfigValue().

Referenced by setSampleOffsetWrite0Rec().

void LOW_linkDS2480B::setStrongPullupDuration_cmd const SPUD_val_t  inSPUD  )  [private, virtual]
 

Set the Strong Pullup Duration.

For parameter Strong Pullup Duration one may select indefinite duration. This value, however, should only be selected if one is not going to switch the device to Data Mode. As long as the device stays in Command Mode, any pulse function (programming or strong pullup) that uses one of these parameters can be terminated by sending the command code F1h. Termination is not possible if the device is in Data Mode.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 597 of file LOW_linkDS2480B.cpp.

References StrongPullupDuration_cfgCmd, and writeConfigValue().

Referenced by pulse_cmd_manual(), strongPullup(), touchBit(), and touchByte().

void LOW_linkDS2480B::setWireSpeed const wireSpeed_t  inWireSpeed  )  [virtual]
 

Set the 1-Wire speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 360 of file LOW_linkDS2480B.cpp.

References resetBus(), resetLinkAdapter(), and LOW_linkFlexibleSpeed::setWireSpeed().

void LOW_linkDS2480B::setWrite1LowTime const w1LowTime_t  inW1LT  )  [virtual]
 

Set the Write 1 Low Time.

Current speed checking and remembering the value is done by provided implementation.

Exceptions:
incompatibleSpeed_error Thrown when not in flexible speed mode.

Reimplemented from LOW_linkFlexibleSpeed.

Definition at line 399 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::setWrite1LowTime(), setWrite1LowTime_cmd(), and w1LowTime_2_W1LT_val().

Referenced by resetLinkAdapter().

void LOW_linkDS2480B::setWrite1LowTime_cmd const W1LT_val_t  inW1LT  )  [private, virtual]
 

Set the Write 1 Low Time.

Note: This is the raw command version. No checking if the parameter is selectable in the current 1-Wire speed mode is done.

Definition at line 612 of file LOW_linkDS2480B.cpp.

References Write1LowTime_cfgCmd, and writeConfigValue().

Referenced by setWrite1LowTime().

bool LOW_linkDS2480B::singleBit_cmd const bool  inBitVal,
const bool  inStrongPullup = false
[private, virtual]
 

Send Single Bit command.

The Single Bit command is used to generate a single time slot on the 1-Wire bus at the speed indicated by bits 2 and 3. The type of the time slot (Write-0 or Write-1) is determined by the logic value of bit 4. A Read Data time slot is identical to the Write-1 time slot. Bits 0 and 1 of the response byte transmitted by the DS2480B at the end of the time slot reveal the value found on the 1-Wire bus when reading.

For a time slot without a subsequent strong pull up, bit 1 of the command must be set to 0. For a time slot immediately followed by a strong pullup bit 1 must be set to 1. As soon as the strong pullup is over, the device will send a second response byte, code EFh (read 1) or ECh (read 0), depending on the value found on the 1 Wire bus when reading. The strong pullup directly following the single bit is used in conjunction with the crypto iButton.

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 ====================+=======+=======+=======+===========+=======+========+=================+======= Send Single Bit | 1 | 0 | 0 | 0=write 0 | 00 reg. speed | 0 norm pullup | 1 | | | | 1=write 1 | 01 flex. speed | 1 strong pullup | | | | | | 10 OD. speed | SECOND RESP. | | | | | | 11 reg. speed | BYTE FOLLOWS | --------------------+-------+-------+-------+-----------+-------+--------+-----------------+------- Response Single Bit | 1 | 0 | 0 | same as sent | 1-Wire read back | | | | | both bits same value --------------------+-------+-------+-------+-----------+-------+--------+-----------------+------- Second response Bit | 1 | 1 | 1 | 0 | 1 | 1 | 00 = read 0 when pullup | | | | | | | 11 = read 1

Definition at line 468 of file LOW_linkDS2480B.cpp.

References command_mode, serialPort, setMode(), SingleBit_Cmd, LOW_portSerial::tty_readByte(), LOW_portSerial::tty_write(), LOW_linkFlexibleSpeed::wireSpeed, and wireSpeed_2_OWSPEED_val().

Referenced by touchBit().

const LOW_linkDS2480B::SOW0RT_val_t LOW_linkDS2480B::soW0RecTime_2_SOW0RT_val const soW0RecTime_t  inSoW0RecTime  )  const [private, virtual]
 

Convert value of type soW0RecTime_t to SOW0RT_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 866 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::soW0RecTime_10, LOW_linkFlexibleSpeed::soW0RecTime_3, LOW_linkFlexibleSpeed::soW0RecTime_4, LOW_linkFlexibleSpeed::soW0RecTime_5, LOW_linkFlexibleSpeed::soW0RecTime_6, LOW_linkFlexibleSpeed::soW0RecTime_7, LOW_linkFlexibleSpeed::soW0RecTime_8, LOW_linkFlexibleSpeed::soW0RecTime_9, SOW0RT_10, SOW0RT_3, SOW0RT_4, SOW0RT_5, SOW0RT_6, SOW0RT_7, SOW0RT_8, SOW0RT_9, and SOW0RT_val_t.

Referenced by setSampleOffsetWrite0Rec().

const LOW_linkDS2480B::soW0RecTime_t LOW_linkDS2480B::SOW0RT_val_2_soW0RecTime const SOW0RT_val_t  inSOW0RT_val  )  const [private, virtual]
 

Convert value of type SOW0RT_val_t to soW0RecTime_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 849 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::soW0RecTime_10, LOW_linkFlexibleSpeed::soW0RecTime_3, LOW_linkFlexibleSpeed::soW0RecTime_4, LOW_linkFlexibleSpeed::soW0RecTime_5, LOW_linkFlexibleSpeed::soW0RecTime_6, LOW_linkFlexibleSpeed::soW0RecTime_7, LOW_linkFlexibleSpeed::soW0RecTime_8, LOW_linkFlexibleSpeed::soW0RecTime_9, LOW_linkFlexibleSpeed::soW0RecTime_t, SOW0RT_10, SOW0RT_3, SOW0RT_4, SOW0RT_5, SOW0RT_6, SOW0RT_7, SOW0RT_8, and SOW0RT_9.

Referenced by getSampleOffsetWrite0Rec().

void LOW_linkDS2480B::strongPullup const strongPullup_t  inPullupTime  )  [virtual]
 

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

Note: Dependening on the implementation, time may only as accurate as the operating system permits (scheduling!).

Parameters:
inPullupTime Pullup time by predefined type.

Implements LOW_link.

Definition at line 251 of file LOW_linkDS2480B.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, pulse_cmd(), setStrongPullupDuration_cmd(), and strongPullup_2_SPUD_val().

void LOW_linkDS2480B::strongPullup const unsigned long  inMicroSecs  )  [virtual]
 

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

Note: Dependening on the implementation, time may only as accurate as the operating system permits (scheduling!).

Parameters:
inMicroSecs Pullup time in micro seconds.

Implements LOW_link.

Definition at line 233 of file LOW_linkDS2480B.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, and pulse_cmd_manual().

const LOW_linkDS2480B::SPUD_val_t LOW_linkDS2480B::strongPullup_2_SPUD_val const strongPullup_t  inStrongPullup  )  const [private, virtual]
 

Convert value of type strongPullup_t to SPUD_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 746 of file LOW_linkDS2480B.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, SPUD_1048, SPUD_131, SPUD_16_4, SPUD_262, SPUD_524, SPUD_65_5, and SPUD_val_t.

Referenced by strongPullup(), touchBit(), and touchByte().

bool LOW_linkDS2480B::touchBit const bool  inSendBit,
const strongPullup_t  inPullup = pullUp_NONE
[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.

Implements LOW_link.

Definition at line 47 of file LOW_linkDS2480B.cpp.

References LOW_link::pullUp_NONE, setStrongPullupDuration_cmd(), singleBit_cmd(), and strongPullup_2_SPUD_val().

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

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

A default implementation relying on the touchByte() method is provided.

Note: When the strong pullup is selected it will NOT appear after each byte sent, only after the last byte the pullup is done!

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

Definition at line 84 of file LOW_linkDS2480B.cpp.

References byteVec_t, data_mode, serialPort, setMode(), SwitchToCommandMode_Cmd, touchByte(), LOW_portSerial::tty_read(), and LOW_portSerial::tty_write().

Referenced by doSearchSequence().

uint8_t LOW_linkDS2480B::touchByte const uint8_t  inSendByte,
const strongPullup_t  inPullup = pullUp_NONE
[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.

Implements LOW_link.

Definition at line 59 of file LOW_linkDS2480B.cpp.

References data_mode, LOW_link::pullUp_NONE, pulse_cmd(), serialPort, setMode(), setStrongPullupDuration_cmd(), strongPullup_2_SPUD_val(), SwitchToCommandMode_Cmd, LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write().

Referenced by touchBlock().

const LOW_linkDS2480B::W1LT_val_t LOW_linkDS2480B::w1LowTime_2_W1LT_val const w1LowTime_t  inW1LowTime  )  const [private, virtual]
 

Convert value of type w1LowTime_t to W1LT_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 831 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::w1LowTime_10, LOW_linkFlexibleSpeed::w1LowTime_11, LOW_linkFlexibleSpeed::w1LowTime_12, LOW_linkFlexibleSpeed::w1LowTime_13, LOW_linkFlexibleSpeed::w1LowTime_14, LOW_linkFlexibleSpeed::w1LowTime_15, LOW_linkFlexibleSpeed::w1LowTime_8, LOW_linkFlexibleSpeed::w1LowTime_9, W1LT_10, W1LT_11, W1LT_12, W1LT_13, W1LT_14, W1LT_15, W1LT_8, W1LT_9, and W1LT_val_t.

Referenced by setWrite1LowTime().

const LOW_linkDS2480B::w1LowTime_t LOW_linkDS2480B::W1LT_val_2_w1LowTime const W1LT_val_t  inW1LT_val  )  const [private, virtual]
 

Convert value of type W1LT_val_t to w1LowTime_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 814 of file LOW_linkDS2480B.cpp.

References LOW_linkFlexibleSpeed::w1LowTime_10, LOW_linkFlexibleSpeed::w1LowTime_11, LOW_linkFlexibleSpeed::w1LowTime_12, LOW_linkFlexibleSpeed::w1LowTime_13, LOW_linkFlexibleSpeed::w1LowTime_14, LOW_linkFlexibleSpeed::w1LowTime_15, LOW_linkFlexibleSpeed::w1LowTime_8, LOW_linkFlexibleSpeed::w1LowTime_9, LOW_linkFlexibleSpeed::w1LowTime_t, W1LT_10, W1LT_11, W1LT_12, W1LT_13, W1LT_14, W1LT_15, W1LT_8, and W1LT_9.

Referenced by getWrite1LowTime().

const LOW_linkDS2480B::OWSPEED_val_t LOW_linkDS2480B::wireSpeed_2_OWSPEED_val const wireSpeed_t  inWireSpeed  )  const [private, virtual]
 

Convert value of type wireSpeed_t to OWSPEED_val_t.

Exceptions:
internal_error Thrown when conversion not possible (should not happen).

Definition at line 896 of file LOW_linkDS2480B.cpp.

References flexible_OWSPEED, LOW_linkFlexibleSpeed::flexible_speed, normal_OWSPEED, LOW_linkFlexibleSpeed::normal_speed, overdrive_OWSPEED, LOW_linkFlexibleSpeed::overdrive_speed, and OWSPEED_val_t.

Referenced by reset_cmd(), searchAccelCtrl_cmd(), and singleBit_cmd().

void LOW_linkDS2480B::writeConfigValue const uint8_t  inParamCode,
const uint8_t  inParamValue
[private, virtual]
 

Write a config value to DS2480B and do sanity checking.

| BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 |BIT 0 =========================+=======+=======+=======+=======+=======+=======+=======+===== Send Write Parameter | 0 | parameter code | parameter value code | 1 -------------------------+-------+-------+-------+-------+-------+-------+-------+----- Response Write Parameter | 0 | same as sent | same as sent | 0
Parameters:
inParamCode Selection of configuration value to write.
inParamValue Value to write.
Exceptions:
comm_error Thrown when sanity check fails.

Definition at line 685 of file LOW_linkDS2480B.cpp.

References command_mode, serialPort, setMode(), LOW_portSerial::tty_readByte(), and LOW_portSerial::tty_write().

Referenced by setLoadSensorThreshold_cmd(), setProgPulseDuration_cmd(), setPullDownSlewRate_cmd(), setRS232BaudRate_cmd(), setSampleOffsetWrite0Rec_cmd(), setStrongPullupDuration_cmd(), and setWrite1LowTime_cmd().

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

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).

A default implementation relying on the touch methods is provided.

Note: When the strong pullup is selected it will NOT appear after each byte sent, only after the last byte the pullup is done!

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

Definition at line 166 of file LOW_link.cpp.

References byteVec_t, and LOW_link::touchBlock().

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

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).

A default implementation relying on the touch methods is provided.

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

Definition at line 157 of file LOW_link.cpp.

References LOW_link::touchByte().

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

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).

A default implementation relying on the touch methods is provided.

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

Definition at line 148 of file LOW_link.cpp.

References LOW_link::touchBit().

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), LOW_devDS2890::cmd_Decrement(), LOW_devDS2890::cmd_Increment(), LOW_netSegment::cmd_MatchROM(), LOW_devDS2890::cmd_ReadControlRegister(), LOW_devDS2890::cmd_ReadPosition(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_netSegment::cmd_ReadROM(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_netSegment::cmd_SkipROM(), LOW_devDS2890::cmd_WriteControlRegister(), LOW_devDS2890::cmd_WritePosition(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), LOW_link::doSearchSequence(), LOW_devDS2406::readMemUniversal(), LOW_link::searchDevices(), and LOW_devDS2406::cmd_ChannelAccess::writeData().


Member Data Documentation

const bool LOW_link::allowProgPulse [protected, inherited]
 

Wether the program pulse should be allowed.

Definition at line 460 of file LOW_link.h.

Referenced by LOW_link::getAllowProgPulse(), LOW_linkPassiveSerial::programPulse(), LOW_linkDS2490::programPulse(), programPulse(), and LOW_linkDS2490::resetLinkAdapter().

const bool LOW_link::hasExternalPower [protected, inherited]
 

Wether the attached bus supplies external power.

Definition at line 459 of file LOW_link.h.

Referenced by LOW_link::getHasExternalPower().

bool LOW_link::hasProgramPulse [protected, inherited]
 

Wether the adapter is capable of 12V Program pulse.

Definition at line 458 of file LOW_link.h.

Referenced by LOW_link::getHasProgramPulse(), LOW_linkPassiveSerial::programPulse(), LOW_linkDS2490::programPulse(), programPulse(), resetBus(), and LOW_linkDS2490::resetLinkAdapter().

internalMode_t LOW_linkDS2480B::internalMode [private]
 

Mode (cmd/data) of DS2480B.

Definition at line 250 of file LOW_linkDS2480B.h.

Referenced by resetLinkAdapter(), and setMode().

const linkID_t LOW_link::linkID [protected, inherited]
 

Individual ID of the link adapter.

Definition at line 457 of file LOW_link.h.

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

const uint8_t LOW_linkDS2480B::LoadSensorThreshold_cfgCmd = 0x06 [static, private]
 

Configuration command byte.

Definition at line 195 of file LOW_linkDS2480B.h.

Referenced by getLoadSensorThreshold_cmd(), and setLoadSensorThreshold_cmd().

pdSlewRate_t LOW_linkFlexibleSpeed::pdSlewRate [protected, inherited]
 

Saved value of pulldown slew rate.

Definition at line 187 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getPullDownSlewRate(), LOW_linkDS2490::resetLinkAdapter(), resetLinkAdapter(), LOW_linkFlexibleSpeed::setPullDownSlewRate(), and LOW_linkDS2490::setWireSpeed().

const uint8_t LOW_linkDS2480B::ProgPulseDuration_cfgCmd = 0x02 [static, private]
 

Configuration command byte.

Definition at line 191 of file LOW_linkDS2480B.h.

Referenced by getProgPulseDuration_cmd(), and setProgPulseDuration_cmd().

const uint8_t LOW_linkDS2480B::PullDownSlewRate_cfgCmd = 0x01 [static, private]
 

Configuration command byte.

Definition at line 190 of file LOW_linkDS2480B.h.

Referenced by getPullDownSlewRate_cmd(), and setPullDownSlewRate_cmd().

const uint8_t LOW_linkDS2480B::Pulse_Cmd = 0xe1 [static, private]
 

Communication command byte.

Definition at line 184 of file LOW_linkDS2480B.h.

Referenced by pulse_cmd(), and pulse_cmd_manual().

const uint8_t LOW_linkDS2480B::PulseTermination_Cmd = 0xf1 [static, private]
 

Communication command byte.

Definition at line 181 of file LOW_linkDS2480B.h.

Referenced by pulse_cmd(), and pulse_cmd_manual().

const RXPOL_val_t LOW_linkDS2480B::receivePolarity [private]
 

Polarity of RXD pin.

Definition at line 249 of file LOW_linkDS2480B.h.

Referenced by resetLinkAdapter().

const uint8_t LOW_linkDS2480B::Reset_Cmd = 0xc1 [static, private]
 

Communication command byte.

Definition at line 182 of file LOW_linkDS2480B.h.

Referenced by reset_cmd().

const uint8_t LOW_linkDS2480B::RS232BaudRate_cfgCmd = 0x07 [static, private]
 

Configuration command byte.

Definition at line 196 of file LOW_linkDS2480B.h.

Referenced by getRS232BaudRate_cmd(), getRS232RxPol_cmd(), and setRS232BaudRate_cmd().

const uint8_t LOW_linkDS2480B::SampleOffsetWrite0Rec_cfgCmd = 0x05 [static, private]
 

Configuration command byte.

Definition at line 194 of file LOW_linkDS2480B.h.

Referenced by getSampleOffsetWrite0Rec_cmd(), and setSampleOffsetWrite0Rec_cmd().

const uint8_t LOW_linkDS2480B::SearchAccel_Cmd = 0xa1 [static, private]
 

Communication command byte.

Definition at line 183 of file LOW_linkDS2480B.h.

Referenced by searchAccelCtrl_cmd().

LOW_portSerial* LOW_linkDS2480B::serialPort [private]
 

The serial port the adapter is attached to.

Definition at line 248 of file LOW_linkDS2480B.h.

Referenced by LOW_linkDS2480B(), pulse_cmd(), pulse_cmd_manual(), readConfigValue(), reset_cmd(), resetLinkAdapter(), searchAccelCtrl_cmd(), setMode(), singleBit_cmd(), touchBlock(), touchByte(), writeConfigValue(), and ~LOW_linkDS2480B().

const uint8_t LOW_linkDS2480B::SerialSpeedAdapt_Cmd = 0xc1 [static, private]
 

Communication command byte.

Definition at line 178 of file LOW_linkDS2480B.h.

Referenced by resetLinkAdapter().

const uint8_t LOW_linkDS2480B::SingleBit_Cmd = 0x81 [static, private]
 

Communication command byte.

Definition at line 185 of file LOW_linkDS2480B.h.

Referenced by singleBit_cmd().

soW0RecTime_t LOW_linkFlexibleSpeed::soW0RecTime [protected, inherited]
 

Saved value of DSO/W0R time.

Definition at line 189 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getSampleOffsetWrite0Rec(), LOW_linkDS2490::resetLinkAdapter(), resetLinkAdapter(), LOW_linkFlexibleSpeed::setSampleOffsetWrite0Rec(), and LOW_linkDS2490::setWireSpeed().

const uint8_t LOW_linkDS2480B::StrongPullupDuration_cfgCmd = 0x03 [static, private]
 

Configuration command byte.

Definition at line 192 of file LOW_linkDS2480B.h.

Referenced by getStrongPullupDuration_cmd(), and setStrongPullupDuration_cmd().

const uint8_t LOW_linkDS2480B::SwitchToCommandMode_Cmd = 0xe3 [static, private]
 

Communication command byte.

Definition at line 180 of file LOW_linkDS2480B.h.

Referenced by setMode(), touchBlock(), and touchByte().

const uint8_t LOW_linkDS2480B::SwitchToDataMode_Cmd = 0xe1 [static, private]
 

Communication command byte.

Definition at line 179 of file LOW_linkDS2480B.h.

Referenced by setMode().

w1LowTime_t LOW_linkFlexibleSpeed::w1LowTime [protected, inherited]
 

Saved value of write-1 low time.

Definition at line 188 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getWrite1LowTime(), LOW_linkDS2490::resetLinkAdapter(), resetLinkAdapter(), LOW_linkDS2490::setWireSpeed(), and LOW_linkFlexibleSpeed::setWrite1LowTime().

wireSpeed_t LOW_linkFlexibleSpeed::wireSpeed [protected, inherited]
 

Saved value of wire speed.

Definition at line 186 of file LOW_linkFlexibleSpeed.h.

Referenced by LOW_linkFlexibleSpeed::getPullDownSlewRate(), LOW_linkFlexibleSpeed::getSampleOffsetWrite0Rec(), getWireSpeed(), LOW_linkFlexibleSpeed::getWrite1LowTime(), reset_cmd(), LOW_linkDS2490::resetLinkAdapter(), resetLinkAdapter(), searchAccelCtrl_cmd(), LOW_linkFlexibleSpeed::setPullDownSlewRate(), LOW_linkFlexibleSpeed::setSampleOffsetWrite0Rec(), LOW_linkFlexibleSpeed::setWireSpeed(), LOW_linkDS2490::setWireSpeed(), LOW_linkFlexibleSpeed::setWrite1LowTime(), and singleBit_cmd().

const uint8_t LOW_linkDS2480B::Write1LowTime_cfgCmd = 0x04 [static, private]
 

Configuration command byte.

Definition at line 193 of file LOW_linkDS2480B.h.

Referenced by getWrite1LowTime_cmd(), and setWrite1LowTime_cmd().


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 11:30:59 2004 for OneWireLibrary++ by doxygen 1.3.2