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 }
 RS232 RXD polarity. More...

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

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

Configuration values.
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
}
enum  W1LT_val_t {
  W1LT_8 = 0x00, W1LT_9, W1LT_10, W1LT_11,
  W1LT_12, W1LT_13, W1LT_14, W1LT_15
}
enum  SOW0RT_val_t {
  SOW0RT_3 = 0x00, SOW0RT_4, SOW0RT_5, SOW0RT_6,
  SOW0RT_7, SOW0RT_8, SOW0RT_9, SOW0RT_10
}

Public Methods

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

void setWireSpeed (const wireSpeed_t inWireSpeed)
 Set the 1-Wire speed mode. More...

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

void setPullDownSlewRate (const PDSR_val_t inPDSR)
 Set the Pulldown Slew Rate Control. More...

PDSR_val_t getPullDownSlewRate ()
 Get the Pulldown Slew Rate Control. More...

void setWrite1LowTime (const W1LT_val_t inW1LT)
 Set the Write 1 Low Time. More...

W1LT_val_t getWrite1LowTime ()
 Get the Write 1 Low Time. More...

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

SOW0RT_val_t getSampleOffsetWrite0Rec ()
 Get the Sample Offset / Write 0 Recovery time. 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)
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_semaphoreSetsemSet
 Semaphore set for locking. More...


Static Protected Attributes

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


Private Types

typedef LOW_linkDS2480B::resetAnswer_t resetAnswer_t
 Reset command reply. More...

typedef LOW_linkDS2480B::sharedAttr_t sharedAttr_t
 Attributes shared between processes to enable alternating use. More...

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

Only internally needed configuration values.
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 Methods

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.

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

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

void pulse_cmd (const bool inArm, const bool inProgPulse=false, const bool inImmidiateTerm=false)
 Send Pulse command. More...

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

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
      


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

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

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

PPD_val_t getProgPulseDuration_cmd ()
 Get the Programming Pulse Duration. More...

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

SPUD_val_t getStrongPullupDuration_cmd ()
 Get the Strong Pullup Duration. More...

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

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

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

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

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

LST_val_t getLoadSensorThreshold_cmd ()
 Set the Load Sensor Threshold. More...

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

RBR_val_t getRS232BaudRate_cmd ()
 Get the RS232 Baud Rate. More...

RXPOL_val_t getRS232RxPol_cmd ()
 Get the RS232 RXD polarity. More...

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

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

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

Misc methods
SPUD_val_t strongPullup_2_SPUD_val (const strongPullup_t inStrongPullup)
 Convert value of type strongPullup_t to SPUD_val_t. More...

void initCmdAvailTable ()
 Initialize attribute cfgCmdAvailable. More...


Private Attributes

const LOW_portSerialserialPort
 The serial port the adapter is attached to. More...

LOW_sharedMemSegmentsharedMemSeg
 Shared memory segment for inter-process attribute sharing. More...

const RXPOL_val_t receivePolarity
 Polarity of RXD pin. More...

sharedAttr_tsharedAttr
 Inter-process shared attributes. More...

bool cfgCmdAvailable [8][3]
 Determines availability of config parameters. More...


Static Private Attributes

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

const uint8_t SwitchToDataMode_Cmd = 0xe1
 Communication command byte. More...

const uint8_t SwitchToCommandMode_Cmd = 0xe3
 Communication command byte. More...

const uint8_t PulseTermination_Cmd = 0xf1
 Communication command byte. More...

const uint8_t Reset_Cmd = 0xc1
 Communication command byte. More...

const uint8_t SearchAccel_Cmd = 0xa1
 Communication command byte. More...

const uint8_t Pulse_Cmd = 0xe1
 Communication command byte. More...

const uint8_t SingleBit_Cmd = 0x81
 Communication command byte. More...

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

const uint8_t ProgPulseDuration_cfgCmd = 0x02
 Configuration command byte. More...

const uint8_t StrongPullupDuration_cfgCmd = 0x03
 Configuration command byte. More...

const uint8_t Write1LowTime_cfgCmd = 0x04
 Configuration command byte. More...

const uint8_t SampleOffsetWrite0Rec_cfgCmd = 0x05
 Configuration command byte. More...

const uint8_t LoadSensorThreshold_cfgCmd = 0x06
 Configuration command byte. More...

const uint8_t RS232BaudRate_cfgCmd = 0x07
 Configuration command byte. More...


Detailed Description

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

DS2480B features:

Some notes about the class:

Todo:
Complete documentation of exceptions thrown.

Author:
Harald Roelle, Helmut Reiser

Definition at line 59 of file LOW_linkDS2480B.h.


Member Typedef Documentation

typedef uint32_t LOW_link::linkID_t [inherited]
 

Type for individual link ID number.

Definition at line 96 of file LOW_link.h.

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

Vector type of link class pointers.

Definition at line 93 of file LOW_link.h.

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

Reset command reply.

typedef struct LOW_linkDS2480B::sharedAttr_t LOW_linkDS2480B::sharedAttr_t [private]
 

Attributes shared between processes to enable alternating use.


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 236 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 246 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 230 of file LOW_linkDS2480B.h.

Referenced by getLoadSensorThreshold_cmd().

enum LOW_linkDS2480B::PDSR_val_t
 

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 77 of file LOW_linkDS2480B.h.

Referenced by getPullDownSlewRate(), and getPullDownSlewRate_cmd().

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 226 of file LOW_linkDS2480B.h.

Referenced by getProgPulseDuration_cmd().

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 232 of file LOW_linkDS2480B.h.

Referenced by getRS232BaudRate_cmd(), and resetLinkAdapter().

enum LOW_linkDS2480B::RXPOL_val_t
 

RS232 RXD polarity.

Enumeration values:
RXPOL_NORM 
RXPOL_INV 

Definition at line 70 of file LOW_linkDS2480B.h.

Referenced by getRS232RxPol_cmd().

enum LOW_link::semNum_t [protected, inherited]
 

Semaphore numbers for semaphore set.

Enumeration values:
counterSemNo 
lockSemNo 
semaphoreCount 

Definition at line 338 of file LOW_link.h.

enum LOW_linkDS2480B::SOW0RT_val_t
 

Enumeration values:
SOW0RT_3 
SOW0RT_4 
SOW0RT_5 
SOW0RT_6 
SOW0RT_7 
SOW0RT_8 
SOW0RT_9 
SOW0RT_10 

Definition at line 79 of file LOW_linkDS2480B.h.

Referenced by getSampleOffsetWrite0Rec(), and getSampleOffsetWrite0Rec_cmd().

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

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

Definition at line 99 of file LOW_link.h.

enum LOW_linkDS2480B::W1LT_val_t
 

Enumeration values:
W1LT_8 
W1LT_9 
W1LT_10 
W1LT_11 
W1LT_12 
W1LT_13 
W1LT_14 
W1LT_15 

Definition at line 78 of file LOW_linkDS2480B.h.

Referenced by getWrite1LowTime(), and getWrite1LowTime_cmd().

enum LOW_linkDS2480B::wireSpeed_t
 

1-Wire communication speeds.

Enumeration values:
normal_speed  16 kbps.
flexible_speed 
overdrive_speed  142 kbps.

Definition at line 73 of file LOW_linkDS2480B.h.

Referenced by getWireSpeed().


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
 

Definition at line 31 of file LOW_linkDS2480B.cpp.

References flexible_speed, LOW_sharedMemSegment::get(), initCmdAvailTable(), LOW_IPCKeyGeneratorFactory::new_IPCKeyGenerator(), LOW_portSerialFactory::new_portSerial(), LOW_semaphoreSetFactory::new_semaphoreSet(), LOW_sharedMemSegmentFactory::new_sharedMemSegment(), PDSR_1_37, resetLinkAdapter(), LOW_link::semaphoreCount, LOW_link::semSet, serialPort, setPullDownSlewRate(), setSampleOffsetWrite0Rec(), setWrite1LowTime(), sharedAttr, sharedMemSeg, SOW0RT_10, W1LT_11, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

LOW_linkDS2480B::~LOW_linkDS2480B  
 

Destructor.

Definition at line 57 of file LOW_linkDS2480B.cpp.

References LOW_link::semSet, serialPort, sharedMemSeg, and LOW_portSerial::tty_flush().


Member Function Documentation

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

Discover devices on the bus.

Parameters:
inBranchVector 
outFoundID 
outDiscrVec 

Reimplemented from LOW_link.

Definition at line 349 of file LOW_linkDS2480B.cpp.

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

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

References LOW_link::hasExternalPower.

Referenced by LOW_netSegment::LOW_netSegment().

uint32_t LOW_link::getID   const [inherited]
 

Get ID of the link.

Returns:
ID of the link.

Definition at line 127 of file LOW_link.cpp.

References LOW_link::linkID.

LOW_linkDS2480B::LST_val_t LOW_linkDS2480B::getLoadSensorThreshold_cmd   [private]
 

Set the Load Sensor Threshold.

See setLoadSensorThreshold_cmd()

Definition at line 636 of file LOW_linkDS2480B.cpp.

References LoadSensorThreshold_cfgCmd, LST_val_t, and readConfigValue().

LOW_linkDS2480B::PPD_val_t LOW_linkDS2480B::getProgPulseDuration_cmd   [private]
 

Get the Programming Pulse Duration.

See setProgPulseDuration_cmd()

Definition at line 592 of file LOW_linkDS2480B.cpp.

References PPD_val_t, ProgPulseDuration_cfgCmd, and readConfigValue().

LOW_linkDS2480B::PDSR_val_t LOW_linkDS2480B::getPullDownSlewRate  
 

Get the Pulldown Slew Rate Control.

See setPullDownSlewRate_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 428 of file LOW_linkDS2480B.cpp.

References flexible_speed, getPullDownSlewRate_cmd(), PDSR_val_t, sharedAttr, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

LOW_linkDS2480B::PDSR_val_t LOW_linkDS2480B::getPullDownSlewRate_cmd   [private]
 

Get the Pulldown Slew Rate Control.

See setPullDownSlewRate_cmd()

Definition at line 581 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]
 

Get the RS232 Baud Rate.

See setRS232BaudRate_cmd()

Definition at line 647 of file LOW_linkDS2480B.cpp.

References RBR_val_t, readConfigValue(), and RS232BaudRate_cfgCmd.

LOW_linkDS2480B::RXPOL_val_t LOW_linkDS2480B::getRS232RxPol_cmd   [private]
 

Get the RS232 RXD polarity.

See setRS232BaudRate_cmd()

Definition at line 652 of file LOW_linkDS2480B.cpp.

References readConfigValue(), RS232BaudRate_cfgCmd, and RXPOL_val_t.

LOW_linkDS2480B::SOW0RT_val_t LOW_linkDS2480B::getSampleOffsetWrite0Rec  
 

Get the Sample Offset / Write 0 Recovery time.

See setSampleOffsetWrite0Rec_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 472 of file LOW_linkDS2480B.cpp.

References flexible_speed, getSampleOffsetWrite0Rec_cmd(), sharedAttr, SOW0RT_val_t, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

LOW_linkDS2480B::SOW0RT_val_t LOW_linkDS2480B::getSampleOffsetWrite0Rec_cmd   [private]
 

Get the Sample Offset / Write 0 Recovery time.

See setSampleOffsetWrite0Rec_cmd()

Definition at line 625 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]
 

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 603 of file LOW_linkDS2480B.cpp.

References readConfigValue(), SPUD_val_t, and StrongPullupDuration_cfgCmd.

LOW_linkDS2480B::wireSpeed_t LOW_linkDS2480B::getWireSpeed  
 

Get the 1-Wire speed mode.

Definition at line 409 of file LOW_linkDS2480B.cpp.

References sharedAttr, LOW_linkDS2480B::sharedAttr_t::wireSpeed, and wireSpeed_t.

LOW_linkDS2480B::W1LT_val_t LOW_linkDS2480B::getWrite1LowTime  
 

Get the Write 1 Low Time.

See setWrite1LowTime_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 450 of file LOW_linkDS2480B.cpp.

References flexible_speed, getWrite1LowTime_cmd(), sharedAttr, W1LT_val_t, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

LOW_linkDS2480B::W1LT_val_t LOW_linkDS2480B::getWrite1LowTime_cmd   [private]
 

Get the Write 1 Low Time.

See setWrite1LowTime_cmd()

Definition at line 614 of file LOW_linkDS2480B.cpp.

References readConfigValue(), W1LT_val_t, and Write1LowTime_cfgCmd.

Referenced by getWrite1LowTime().

void LOW_linkDS2480B::initCmdAvailTable   [private]
 

Initialize attribute cfgCmdAvailable.

                                  |        |Configurable at
      Parameter Description       |Par.Code|Reg.|Flex|Ovrd|
      ============================+========+====+====+====+
      Pull-Down Slew Rate Control | 001  1 |    | X  |    |
      ----------------------------+--------+----+----+----+
      Programming Pulse Duration  | 010  2 | X  | X  | X  |
      ----------------------------+--------+----+----+----+
      Strong Pullup Duration      | 011  3 | X  | X  | X  |
      ----------------------------+--------+----+----+----+
      Write-1 Low Time            | 100  4 |    | X  |    |
      ----------------------------+--------+----+----+----+
      Sample Offset               | 101  5 |    | X  |    |
        and Write 0 Recovery Time |        |    |    |    |
      ----------------------------+--------+----+----+----+
      Load Sensor Threshold       | 110  6 | X  | X  | X  |
      ----------------------------+--------+----+----+----+
      RS232 Baud Rate             | 111  7 | X  | X  | X  |
      

Definition at line 739 of file LOW_linkDS2480B.cpp.

References cfgCmdAvailable, flexible_speed, LoadSensorThreshold_cfgCmd, normal_speed, overdrive_speed, ProgPulseDuration_cfgCmd, PullDownSlewRate_cfgCmd, RS232BaudRate_cfgCmd, SampleOffsetWrite0Rec_cfgCmd, StrongPullupDuration_cfgCmd, and Write1LowTime_cfgCmd.

Referenced by LOW_linkDS2480B().

bool LOW_link::operator== LOW_link   inLink const [inherited]
 

Comparison based on linkID.

Definition at line 115 of file LOW_link.cpp.

References LOW_link::linkID.

void LOW_linkDS2480B::programPulse   [virtual]
 

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

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

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

Reimplemented from LOW_link.

Definition at line 334 of file LOW_linkDS2480B.cpp.

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

void LOW_linkDS2480B::pulse_cmd const bool    inArm,
const bool    inProgPulse = false,
const bool    inImmidiateTerm = false
[private]
 

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 538 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(), touchBlock(), and touchByte().

uint8_t LOW_linkDS2480B::readConfigValue const uint8_t    inParamCode [private]
 

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 679 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_linkDS2480B::readData byteVec_t   outBytes,
const strongPullup_t    inPullup = pullUp_NONE
[virtual]
 

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

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

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

Reimplemented from LOW_link.

Definition at line 172 of file LOW_linkDS2480B.cpp.

References byteVec_t, and touchBlock().

bool LOW_linkDS2480B::readDataBit const strongPullup_t    inPullup = pullUp_NONE [virtual]
 

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

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

Reimplemented from LOW_link.

Definition at line 156 of file LOW_linkDS2480B.cpp.

References touchBit().

uint8_t LOW_linkDS2480B::readDataByte const strongPullup_t    inPullup = pullUp_NONE [virtual]
 

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

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

Reimplemented from LOW_link.

Definition at line 164 of file LOW_linkDS2480B.cpp.

References touchByte().

void LOW_linkDS2480B::reset_cmd resetAnswer_t   outAnswer [private]
 

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 490 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(), sharedAttr, LOW_portSerial::tty_flush(), LOW_portSerial::tty_readByte(), LOW_portSerial::tty_write(), and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by resetBus().

bool LOW_linkDS2480B::resetBus   [virtual]
 

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

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

Reimplemented from LOW_link.

Definition at line 301 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.

Reimplemented from LOW_link.

Definition at line 228 of file LOW_linkDS2480B.cpp.

References LOW_portSerial::B57600_speed, LOW_portSerial::B9600_speed, LOW_portSerial::bit1_stopBit, LOW_portSerial::bit8_size, command_mode, flexible_speed, LOW_linkDS2480B::sharedAttr_t::internalMode, LOW_platformMisc::milliSleep(), LOW_portSerial::no_parity, LOW_portSerial::none_flowControl, normal_speed, overdrive_speed, RBR_57_6, RBR_9_6, RBR_val_t, receivePolarity, serialPort, SerialSpeedAdapt_Cmd, setRS232BaudRate_cmd(), sharedAttr, LOW_portSerial::tty_break(), LOW_portSerial::tty_configure(), LOW_portSerial::tty_flush(), LOW_portSerial::tty_write(), and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by LOW_linkDS2480B(), and setWireSpeed().

void LOW_linkDS2480B::searchAccelCtrl_cmd const bool    inAccelOn [private]
 

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 559 of file LOW_linkDS2480B.cpp.

References command_mode, SearchAccel_Cmd, serialPort, setMode(), sharedAttr, LOW_portSerial::tty_write(), and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by doSearchSequence().

void LOW_linkDS2480B::setLoadSensorThreshold_cmd const LST_val_t    inLST [private]
 

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 631 of file LOW_linkDS2480B.cpp.

References LoadSensorThreshold_cfgCmd, and writeConfigValue().

void LOW_linkDS2480B::setMode const internalMode_t    inMode [private]
 

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 697 of file LOW_linkDS2480B.cpp.

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

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

void LOW_linkDS2480B::setProgPulseDuration_cmd const PPD_val_t    inPPD [private]
 

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 587 of file LOW_linkDS2480B.cpp.

References ProgPulseDuration_cfgCmd, and writeConfigValue().

Referenced by programPulse().

void LOW_linkDS2480B::setPullDownSlewRate const PDSR_val_t    inPDSR
 

Set the Pulldown Slew Rate Control.

See setPullDownSlewRate_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 417 of file LOW_linkDS2480B.cpp.

References flexible_speed, setPullDownSlewRate_cmd(), sharedAttr, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by LOW_linkDS2480B().

void LOW_linkDS2480B::setPullDownSlewRate_cmd const PDSR_val_t    inPDSR [private]
 

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 576 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]
 

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 642 of file LOW_linkDS2480B.cpp.

References RS232BaudRate_cfgCmd, and writeConfigValue().

Referenced by resetLinkAdapter().

void LOW_linkDS2480B::setSampleOffsetWrite0Rec const SOW0RT_val_t    inSOW0RT
 

Set the Sample Offset / Write 0 Recovery time.

See setSampleOffsetWrite0Rec_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 461 of file LOW_linkDS2480B.cpp.

References flexible_speed, setSampleOffsetWrite0Rec_cmd(), sharedAttr, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by LOW_linkDS2480B().

void LOW_linkDS2480B::setSampleOffsetWrite0Rec_cmd const SOW0RT_val_t    inSOW0RT [private]
 

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 620 of file LOW_linkDS2480B.cpp.

References SampleOffsetWrite0Rec_cfgCmd, and writeConfigValue().

Referenced by setSampleOffsetWrite0Rec().

void LOW_linkDS2480B::setStrongPullupDuration_cmd const SPUD_val_t    inSPUD [private]
 

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 598 of file LOW_linkDS2480B.cpp.

References StrongPullupDuration_cfgCmd, and writeConfigValue().

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

void LOW_linkDS2480B::setWireSpeed const wireSpeed_t    inWireSpeed
 

Set the 1-Wire speed mode.

Definition at line 398 of file LOW_linkDS2480B.cpp.

References resetBus(), resetLinkAdapter(), sharedAttr, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

void LOW_linkDS2480B::setWrite1LowTime const W1LT_val_t    inW1LT
 

Set the Write 1 Low Time.

See setWrite1LowTime_cmd()

Exceptions:
notAllowed_error  Thrown when not in flexible speed mode.

Definition at line 439 of file LOW_linkDS2480B.cpp.

References flexible_speed, setWrite1LowTime_cmd(), sharedAttr, and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by LOW_linkDS2480B().

void LOW_linkDS2480B::setWrite1LowTime_cmd const W1LT_val_t    inW1LT [private]
 

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 609 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]
 

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 512 of file LOW_linkDS2480B.cpp.

References command_mode, serialPort, setMode(), sharedAttr, SingleBit_Cmd, LOW_portSerial::tty_readByte(), LOW_portSerial::tty_write(), and LOW_linkDS2480B::sharedAttr_t::wireSpeed.

Referenced by touchBit().

void LOW_linkDS2480B::strongPullup const unsigned long    inMilliSecs [virtual]
 

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

Reimplemented from LOW_link.

Definition at line 322 of file LOW_linkDS2480B.cpp.

References LOW_platformMisc::milliSleep(), pulse_cmd(), PulseTermination_Cmd, serialPort, setStrongPullupDuration_cmd(), SPUD_inf, and LOW_portSerial::tty_write().

LOW_linkDS2480B::SPUD_val_t LOW_linkDS2480B::strongPullup_2_SPUD_val const strongPullup_t    inStrongPullup [private]
 

Convert value of type strongPullup_t to SPUD_val_t.

Parameters:
inStrongPullup  Value to convert.
Returns:
Converted value.
Exceptions:
internal_error  Thrown when conversion not possible (should not happen).

Definition at line 725 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 touchBit(), touchBlock(), 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.

Reimplemented from LOW_link.

Definition at line 72 of file LOW_linkDS2480B.cpp.

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

Referenced by readDataBit(), and writeData().

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.

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

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

Reimplemented from LOW_link.

Definition at line 109 of file LOW_linkDS2480B.cpp.

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

Referenced by doSearchSequence(), readData(), and writeData().

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.

Reimplemented from LOW_link.

Definition at line 84 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 readDataByte(), and writeData().

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

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 664 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_linkDS2480B::writeData const byteVec_t   inSendBytes,
const strongPullup_t    inPullup = pullUp_NONE
[virtual]
 

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

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

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

Reimplemented from LOW_link.

Definition at line 209 of file LOW_linkDS2480B.cpp.

References byteVec_t, and touchBlock().

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

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

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

Reimplemented from LOW_link.

Definition at line 200 of file LOW_linkDS2480B.cpp.

References touchByte().

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

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

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

Reimplemented from LOW_link.

Definition at line 191 of file LOW_linkDS2480B.cpp.

References touchBit().


Member Data Documentation

const bool LOW_link::allowProgPulse [protected, inherited]
 

Wether the program pulse should be allowed.

Definition at line 354 of file LOW_link.h.

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

bool LOW_linkDS2480B::cfgCmdAvailable[8][3] [private]
 

Determines availability of config parameters.

See initCmdAvailTable().

Definition at line 266 of file LOW_linkDS2480B.h.

Referenced by initCmdAvailTable().

const bool LOW_link::hasExternalPower [protected, inherited]
 

Wether the attached bus supplies external power.

Definition at line 353 of file LOW_link.h.

Referenced by LOW_link::getHasExternalPower().

const bool LOW_link::hasOverDrive [protected, inherited]
 

Wether the adapter is capable of overdrive bus speed.

Definition at line 352 of file LOW_link.h.

bool LOW_link::hasProgramPulse [protected, inherited]
 

Wether the adapter is capable of 12V Program pulse.

Definition at line 351 of file LOW_link.h.

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

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

Incremented on instance creation to get individual IDs.

Definition at line 28 of file LOW_link.cpp.

const linkID_t LOW_link::linkID [protected, inherited]
 

Individual ID of the link adapter.

Definition at line 350 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 214 of file LOW_linkDS2480B.h.

Referenced by getLoadSensorThreshold_cmd(), initCmdAvailTable(), and setLoadSensorThreshold_cmd().

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

Configuration command byte.

Definition at line 210 of file LOW_linkDS2480B.h.

Referenced by getProgPulseDuration_cmd(), initCmdAvailTable(), and setProgPulseDuration_cmd().

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

Configuration command byte.

Definition at line 209 of file LOW_linkDS2480B.h.

Referenced by getPullDownSlewRate_cmd(), initCmdAvailTable(), and setPullDownSlewRate_cmd().

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

Communication command byte.

Definition at line 203 of file LOW_linkDS2480B.h.

Referenced by pulse_cmd().

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

Communication command byte.

Definition at line 200 of file LOW_linkDS2480B.h.

Referenced by pulse_cmd(), and strongPullup().

const RXPOL_val_t LOW_linkDS2480B::receivePolarity [private]
 

Polarity of RXD pin.

Definition at line 263 of file LOW_linkDS2480B.h.

Referenced by resetLinkAdapter().

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

Communication command byte.

Definition at line 201 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 215 of file LOW_linkDS2480B.h.

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

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

Configuration command byte.

Definition at line 213 of file LOW_linkDS2480B.h.

Referenced by getSampleOffsetWrite0Rec_cmd(), initCmdAvailTable(), and setSampleOffsetWrite0Rec_cmd().

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

Communication command byte.

Definition at line 202 of file LOW_linkDS2480B.h.

Referenced by searchAccelCtrl_cmd().

LOW_semaphoreSet* LOW_link::semSet [protected, inherited]
 

Semaphore set for locking.

Definition at line 355 of file LOW_link.h.

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

const LOW_portSerial* LOW_linkDS2480B::serialPort [private]
 

The serial port the adapter is attached to.

Definition at line 261 of file LOW_linkDS2480B.h.

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

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

Communication command byte.

Definition at line 197 of file LOW_linkDS2480B.h.

Referenced by resetLinkAdapter().

sharedAttr_t* LOW_linkDS2480B::sharedAttr [private]
 

Inter-process shared attributes.

Definition at line 265 of file LOW_linkDS2480B.h.

Referenced by getPullDownSlewRate(), getSampleOffsetWrite0Rec(), getWireSpeed(), getWrite1LowTime(), LOW_linkDS2480B(), reset_cmd(), resetLinkAdapter(), searchAccelCtrl_cmd(), setMode(), setPullDownSlewRate(), setSampleOffsetWrite0Rec(), setWireSpeed(), setWrite1LowTime(), and singleBit_cmd().

LOW_sharedMemSegment* LOW_linkDS2480B::sharedMemSeg [private]
 

Shared memory segment for inter-process attribute sharing.

Definition at line 262 of file LOW_linkDS2480B.h.

Referenced by LOW_linkDS2480B(), and ~LOW_linkDS2480B().

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

Communication command byte.

Definition at line 204 of file LOW_linkDS2480B.h.

Referenced by singleBit_cmd().

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

Configuration command byte.

Definition at line 211 of file LOW_linkDS2480B.h.

Referenced by getStrongPullupDuration_cmd(), initCmdAvailTable(), and setStrongPullupDuration_cmd().

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

Communication command byte.

Definition at line 199 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 198 of file LOW_linkDS2480B.h.

Referenced by setMode().

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

Configuration command byte.

Definition at line 212 of file LOW_linkDS2480B.h.

Referenced by getWrite1LowTime_cmd(), initCmdAvailTable(), and setWrite1LowTime_cmd().


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