#include <LOW_devDS2890.h>
Inheritance diagram for LOW_devDS2890:
Public Types | |
typedef std::vector< LOW_devDS2890 * > | devDS2890PtrVec_t |
Vector type of class device pointers. | |
typedef uint16_t | wiperPosition_t |
Type for position setting of wiper. | |
typedef controlRegister_t | controlRegister_t |
typedef std::vector< LOW_device * > | devPtrVec_t |
Vector type of class device pointers. | |
typedef std::map< LOW_deviceID, LOW_device * > | deviceMap_t |
Map type of devices with LOW_deviceID as key. | |
Public Member Functions | |
class_DERIVE_FROM_EXCEPTION (devDS2890_error, LOW_exception) | |
Exception base class for all exceptions thrown by LOW_devDS2890. | |
LOW_devDS2890 (LOW_netSegment &inSegment, const LOW_deviceID &inDevID) | |
Real constructor corresponding to static pseudo constructor new_Instance(). | |
virtual | ~LOW_devDS2890 () |
Destructor. | |
virtual const LOW_deviceIDRaw::devFamCode_t | getFamilyCode () const |
Get the device's family code. | |
virtual const std::string | getFamilyName () const |
Get the device's family name. | |
virtual void | setChargePumpAllowed (const bool inCharpePumpAllowed) |
Set whether charge pump is allowed for this device. | |
virtual bool | getChargePumpAllowed () |
Get whether charge pump is allowed for this device. | |
virtual bool | getHasLinearPotElements () const |
Get whether the device has logarithmic or linear potentiometer elements. | |
virtual bool | getIsWiperSettingVolatile () const |
Get whether the wiper settings are volatile. | |
virtual uint8_t | getPotentiometerCount () const |
Get number of potentiometers in the device. | |
virtual wiperPosition_t | getWiperPositionsCount () const |
Get number of positions selectable for each wiper. | |
virtual uint32_t | getPotentiometerResistance () const |
Get potentiometer resistance in ohm. | |
virtual uint8_t | getCachedWiperNumber () |
Get the cached value of the currently activated wiper. | |
virtual wiperPosition_t | getCachedWiperPosition (const uint8_t inControlledWiperNum=0) |
Get the cached value of a wiper position. | |
virtual wiperPosition_t | cmd_ReadPosition () |
The Read Position command is used to obtain the wiper setting of the potentiometer currently addressed by the Control Register. | |
virtual void | cmd_WritePosition (const wiperPosition_t inNewPosition) |
The Write Position command is used to set the position of the currently addressed potentiometer wiper. | |
virtual controlRegister_t | cmd_ReadControlRegister () |
The Read Control Register command is used to obtain both the Control Register and potentiometer Feature Register. | |
virtual void | cmd_WriteControlRegister (const uint8_t inControlledWiperNum=0, const bool inChargePumpOn=false) |
The Write Control Register command is used to manipulate DS2890 state bits located in the Control Register. | |
virtual wiperPosition_t | cmd_Increment () |
The Increment command is used for a one step position increase of the currently addressed potentiometer wiper. | |
virtual wiperPosition_t | cmd_Decrement () |
The Decrement command is used for a one step position decrease of the currently addressed potentiometer wiper. | |
virtual LOW_deviceID | getID () const |
Get the device's ROM ID. | |
virtual LOW_netSegment & | getNetSegment () const |
Get the network segment the device is on. | |
virtual bool | verifyDevice (const bool inOnlyAlarm=false, const bool inDoReset=true) const |
Shortcut method to verify the presence of the device on it's network segment. | |
Static Public Attributes | |
const LOW_deviceIDRaw::devFamCode_t | familyCode = 0x2c |
Family code of this specific device. | |
const std::string | familyName = "DS2890" |
Family name of this specific device. | |
const owCommand_t | ReadPosition_COMMAND = 0xf0 |
1-Wire command byte constant | |
const owCommand_t | WritePosition_COMMAND = 0x0f |
1-Wire command byte constant | |
const owCommand_t | ReadControlRegister_COMMAND = 0xaa |
1-Wire command byte constant | |
const owCommand_t | WriteControlRegister_COMMAND = 0x55 |
1-Wire command byte constant | |
const owCommand_t | Increment_COMMAND = 0xc3 |
1-Wire command byte constant | |
const owCommand_t | Decrement_COMMAND = 0x99 |
1-Wire command byte constant | |
const LOW_deviceIDRaw::devFamCode_t | anyDev_famCode = 0x00 |
Pseudo family code for selecting any/all device types. | |
const LOW_deviceIDRaw::devFamCode_t | unknownDev_famCode = 0xff |
Pseudo family code for unknown device types. | |
const owCommand_t | MatchROM_COMMAND = 0x55 |
1-Wire command byte constant | |
const owCommand_t | ReadROM_COMMAND = 0x33 |
1-Wire command byte constant | |
const owCommand_t | SkipROM_COMMAND = 0xcc |
1-Wire command byte constant | |
const owCommand_t | SearchROM_COMMAND = 0xf0 |
1-Wire command byte constant | |
const owCommand_t | SearchAlarmROM_COMMAND = 0xec |
1-Wire command byte constant | |
Protected Member Functions | |
virtual LOW_link & | getLink () const |
Get the link the device is on. | |
virtual void | cmd_MatchROM () const |
Shortcut for issuing a matchROM command for a device. | |
Static Protected Member Functions | |
LOW_device * | new_Instance (LOW_netSegment &inNetSegment, const LOW_deviceID &inDevID) |
Static pseudo constructor for registering with LOW_deviceFactory. | |
Protected Attributes | |
bool | chargePumpAllowed |
Enables setting chage pump option. | |
bool | hasLinearPotElements |
Feature register value. | |
bool | isWiperSettingVolatile |
Feature register value. | |
uint8_t | potentiometerCount |
Feature register value. | |
wiperPosition_t | wiperPositionsCount |
Feature register value. | |
uint32_t | potentiometerResistance |
Feature register value. | |
wiperPosition_t * | cachedWiperPos |
Cached wiper positions. | |
uint8_t | cachedCurrentWiper |
Wiper which was selected. | |
const LOW_deviceID | ID |
1-Wire ROM ID of the device | |
LOW_netSegment & | netSegment |
Network segment where the device is located. | |
Static Protected Attributes | |
const uint8_t | releaseCode_subcommand = 0x96 |
Special byte to activate new values. | |
Feature register masks. | |
const uint8_t | potentiometerType_featRegMask = 0x01 |
const uint8_t | wiperSetVolatility_featRegMask = 0x02 |
const uint8_t | potentiometerCount_featRegMask = 0x0c |
const uint8_t | wiperPositions_featRegMask = 0x30 |
const uint8_t | potentiometerResistance_featRegMask = 0xc0 |
Control register masks. | |
const uint8_t | wiperNum_ctlRegMsk = 0x03 |
const uint8_t | invWiperNum_ctlRegMsk = 0x0c |
const uint8_t | chargePump_ctlRegMsk = 0x40 |
Static Private Member Functions | |
int | initialize () |
Static inizializer to register the class with LOW_deviceFactory. | |
Static Private Attributes | |
int | initHelper = initialize() |
Needed for dirty little C++ hack to force static initialization on application start. | |
Friends | |
class | linkLock |
Needed to grant access to the protected getLink() method. |
DS2890 features:
This class is thread-safe.
Parts of the documentation by Dallas Semiconductors / Maxim Integrated Products
Definition at line 50 of file LOW_devDS2890.h.
|
Definition at line 97 of file LOW_devDS2890.h. |
|
Vector type of class device pointers.
Definition at line 88 of file LOW_devDS2890.h. |
|
Map type of devices with LOW_deviceID as key.
Definition at line 101 of file LOW_device.h. |
|
Vector type of class device pointers.
Definition at line 100 of file LOW_device.h. Referenced by LOW_netSegment::searchDevices(). |
|
Type for position setting of wiper.
Definition at line 90 of file LOW_devDS2890.h. Referenced by cmd_Decrement(), cmd_Increment(), cmd_ReadPosition(), getCachedWiperPosition(), getWiperPositionsCount(), and LOW_devDS2890(). |
|
Real constructor corresponding to static pseudo constructor new_Instance(). Device features are initially detected here.
Definition at line 55 of file LOW_devDS2890.cpp. References cachedWiperPos, chargePumpAllowed, cmd_ReadControlRegister(), getPotentiometerCount(), and wiperPosition_t. Referenced by new_Instance(). |
|
Destructor.
Definition at line 66 of file LOW_devDS2890.cpp. References cachedWiperPos. |
|
Exception base class for all exceptions thrown by LOW_devDS2890.
|
|
The Decrement command is used for a one step position decrease of the currently addressed potentiometer wiper. Although the DS2890 is a single element potentiometer, wiper addressing still applies and the Control Register wiper number used for addressing must be set accordingly. No position change is made if the DS2890 wiper is at the minimum position (00h) and a Decrement command is received.
Definition at line 287 of file LOW_devDS2890.cpp. References cachedCurrentWiper, cachedWiperPos, LOW_device::cmd_MatchROM(), Decrement_COMMAND, LOW_device::getLink(), LOW_device::linkLock, LOW_link::readDataByte(), LOW_link::resetBus(), wiperPosition_t, and LOW_link::writeData(). |
|
The Increment command is used for a one step position increase of the currently addressed potentiometer wiper. Although the DS2890 is a single element potentiometer, wiper addressing still applies and the Control Register wiper number used for addressing must be set accordingly. No position change is made if the DS2890 wiper is at the maximum position and an Increment command is received.
Definition at line 272 of file LOW_devDS2890.cpp. References cachedCurrentWiper, cachedWiperPos, LOW_device::cmd_MatchROM(), LOW_device::getLink(), Increment_COMMAND, LOW_device::linkLock, LOW_link::readDataByte(), LOW_link::resetBus(), wiperPosition_t, and LOW_link::writeData(). |
|
Shortcut for issuing a matchROM command for a device. Calls the corresponding method in LOW_netSegment. Definition at line 102 of file LOW_device.cpp. References LOW_netSegment::cmd_MatchROM(), and LOW_device::netSegment. Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), cmd_Decrement(), cmd_Increment(), LOW_devDS2405::cmd_Match(), cmd_ReadControlRegister(), cmd_ReadPosition(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), cmd_WriteControlRegister(), cmd_WritePosition(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal(). |
|
The Read Control Register command is used to obtain both the Control Register and potentiometer Feature Register. The Feature Register is not returned directly, but stored in internal attributes which are accessible via the various get*() methods.
Definition at line 187 of file LOW_devDS2890.cpp. References byteVec_t, cachedCurrentWiper, chargePump_ctlRegMsk, LOW_device::cmd_MatchROM(), LOW_devDS2890::controlRegister_t::controlledWiperNum, LOW_device::getLink(), hasLinearPotElements, invWiperNum_ctlRegMsk, LOW_devDS2890::controlRegister_t::isChargePumpOn, isWiperSettingVolatile, LOW_device::linkLock, potentiometerCount, potentiometerCount_featRegMask, potentiometerResistance, potentiometerResistance_featRegMask, potentiometerType_featRegMask, ReadControlRegister_COMMAND, LOW_link::readData(), wiperNum_ctlRegMsk, wiperPositions_featRegMask, wiperPositionsCount, wiperSetVolatility_featRegMask, and LOW_link::writeData(). Referenced by LOW_devDS2890(). |
|
The Read Position command is used to obtain the wiper setting of the potentiometer currently addressed by the Control Register. Although the DS2890 is a single element potentiometer, wiper addressing still applies and the Control Register wiper number used for addressing must be set accordingly.
Definition at line 134 of file LOW_devDS2890.cpp. References byteVec_t, cachedCurrentWiper, cachedWiperPos, LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::linkLock, LOW_link::readData(), ReadPosition_COMMAND, wiperNum_ctlRegMsk, wiperPosition_t, and LOW_link::writeData(). |
|
The Write Control Register command is used to manipulate DS2890 state bits located in the Control Register. This command is used to set the potentiometer wiper address and charge pump state. Note that for enabling the charge pump this feature must explicitely enabled by setChargePumpAllowed().
Definition at line 229 of file LOW_devDS2890.cpp. References byteVec_t, cachedCurrentWiper, chargePump_ctlRegMsk, chargePumpAllowed, LOW_device::cmd_MatchROM(), LOW_device::getLink(), getPotentiometerCount(), invWiperNum_ctlRegMsk, LOW_device::linkLock, LOW_link::readDataBit(), LOW_link::readDataByte(), releaseCode_subcommand, LOW_link::resetBus(), wiperNum_ctlRegMsk, WriteControlRegister_COMMAND, and LOW_link::writeData(). |
|
The Write Position command is used to set the position of the currently addressed potentiometer wiper. Although the DS2890 is a single element potentiometer, wiper addressing still applies and the Control Register wiper number used for addressing must be set accordingly.
Definition at line 155 of file LOW_devDS2890.cpp. References byteVec_t, cachedCurrentWiper, cachedWiperPos, LOW_device::cmd_MatchROM(), LOW_device::getLink(), getWiperPositionsCount(), LOW_device::linkLock, LOW_link::readDataBit(), LOW_link::readDataByte(), releaseCode_subcommand, LOW_link::resetBus(), LOW_link::writeData(), and WritePosition_COMMAND. |
|
Get the cached value of the currently activated wiper. No real activity on the 1-Wire bus occures.
Definition at line 119 of file LOW_devDS2890.cpp. References cachedCurrentWiper. |
|
Get the cached value of a wiper position. No real activity on the 1-Wire bus occures.
Definition at line 125 of file LOW_devDS2890.cpp. References cachedWiperPos, getPotentiometerCount(), and wiperPosition_t. |
|
Get whether charge pump is allowed for this device. No real activity on the 1-Wire bus occures.
Definition at line 83 of file LOW_devDS2890.cpp. References chargePumpAllowed. |
|
Get the device's family code. Note: Subclasses must implement this method to return their specific family code.
Reimplemented from LOW_device. Definition at line 129 of file LOW_devDS2890.h. References LOW_deviceIDRaw::devFamCode_t, and familyCode. |
|
Get the device's family name. Note: Subclasses must implement this method to return a clear text name of their family.
Reimplemented from LOW_device. Definition at line 136 of file LOW_devDS2890.h. References familyName. |
|
Get whether the device has logarithmic or linear potentiometer elements. No real activity on the 1-Wire bus occures.
Definition at line 89 of file LOW_devDS2890.cpp. References hasLinearPotElements. |
|
Get the device's ROM ID.
Definition at line 73 of file LOW_device.cpp. References LOW_device::ID. Referenced by LOW_netSegment::buryDevice(), LOW_netSegment::cmd_MatchROM(), LOW_compJalousieController::LOW_compJalousieController(), LOW_netSegment::removeDevice(), and LOW_netSegment::revitalizeDevice(). |
|
Get whether the wiper settings are volatile. No real activity on the 1-Wire bus occures.
Definition at line 95 of file LOW_devDS2890.cpp. References isWiperSettingVolatile. |
|
|
Get the network segment the device is on.
Definition at line 79 of file LOW_device.cpp. References LOW_device::netSegment. Referenced by LOW_compJalousieController::LOW_compJalousieController(), and LOW_compTwinSwitch::LOW_compTwinSwitch(). |
|
Get number of potentiometers in the device. No real activity on the 1-Wire bus occures.
Definition at line 101 of file LOW_devDS2890.cpp. References potentiometerCount. Referenced by cmd_WriteControlRegister(), getCachedWiperPosition(), and LOW_devDS2890(). |
|
Get potentiometer resistance in ohm. No real activity on the 1-Wire bus occures.
Definition at line 113 of file LOW_devDS2890.cpp. References potentiometerResistance. |
|
Get number of positions selectable for each wiper. No real activity on the 1-Wire bus occures.
Definition at line 107 of file LOW_devDS2890.cpp. References wiperPosition_t, and wiperPositionsCount. Referenced by cmd_WritePosition(). |
|
Static inizializer to register the class with LOW_deviceFactory.
Definition at line 30 of file LOW_devDS2890.cpp. References familyCode, new_Instance(), and LOW_deviceFactory::registerSpecificCtor(). |
|
Static pseudo constructor for registering with LOW_deviceFactory.
Reimplemented from LOW_device. Definition at line 43 of file LOW_devDS2890.cpp. References LOW_devDS2890(). Referenced by initialize(). |
|
Set whether charge pump is allowed for this device. Charge pump is only allowed to be used when external voltage supply is present. As this cannot be sensed by the device it has to set manually using this method. No real activity on the 1-Wire bus occures.
Definition at line 77 of file LOW_devDS2890.cpp. References chargePumpAllowed. |
|
Shortcut method to verify the presence of the device on it's network segment.
Definition at line 85 of file LOW_device.cpp. References LOW_device::ID, LOW_device::netSegment, and LOW_netSegment::verifyDevice(). Referenced by LOW_compTwinSwitch::alarmPollLoop(), LOW_compTempSensor::checkAlarm(), LOW_devDS2405::cmd_SearchActive(), and LOW_devDS2405::cmd_SearchRead(). |
|
Needed to grant access to the protected getLink() method.
Definition at line 184 of file LOW_device.h. Referenced by LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), cmd_Decrement(), cmd_Increment(), LOW_devDS2405::cmd_Match(), LOW_devDS2405::cmd_MatchRead(), cmd_ReadControlRegister(), cmd_ReadPosition(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2405::cmd_SearchActive(), LOW_devDS2405::cmd_SearchRead(), cmd_WriteControlRegister(), cmd_WritePosition(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal(). |
|
Pseudo family code for selecting any/all device types.
Definition at line 73 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SearchROMVerify(), LOW_netSegment::getDevice(), LOW_netSegment::getDevices(), LOW_deviceFactory::registerSpecificCtor(), LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices(). |
|
Wiper which was selected.
Definition at line 293 of file LOW_devDS2890.h. Referenced by cmd_Decrement(), cmd_Increment(), cmd_ReadControlRegister(), cmd_ReadPosition(), cmd_WriteControlRegister(), cmd_WritePosition(), and getCachedWiperNumber(). |
|
Cached wiper positions.
Definition at line 292 of file LOW_devDS2890.h. Referenced by cmd_Decrement(), cmd_Increment(), cmd_ReadPosition(), cmd_WritePosition(), getCachedWiperPosition(), LOW_devDS2890(), and ~LOW_devDS2890(). |
|
Definition at line 277 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and cmd_WriteControlRegister(). |
|
Enables setting chage pump option.
Definition at line 286 of file LOW_devDS2890.h. Referenced by cmd_WriteControlRegister(), getChargePumpAllowed(), LOW_devDS2890(), and setChargePumpAllowed(). |
|
1-Wire command byte constant
Definition at line 80 of file LOW_devDS2890.h. Referenced by cmd_Decrement(). |
|
Family code of this specific device.
Reimplemented from LOW_device. Definition at line 70 of file LOW_devDS2890.h. Referenced by getFamilyCode(), and initialize(). |
|
Family name of this specific device.
Reimplemented from LOW_device. Definition at line 27 of file LOW_devDS2890.cpp. Referenced by getFamilyName(). |
|
Feature register value.
Definition at line 287 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and getHasLinearPotElements(). |
|
1-Wire ROM ID of the device
Definition at line 192 of file LOW_device.h. Referenced by LOW_device::getID(), LOW_device::LOW_device(), and LOW_device::verifyDevice(). |
|
1-Wire command byte constant
Definition at line 79 of file LOW_devDS2890.h. Referenced by cmd_Increment(). |
|
Needed for dirty little C++ hack to force static initialization on application start.
Definition at line 29 of file LOW_devDS2890.cpp. |
|
Definition at line 276 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and cmd_WriteControlRegister(). |
|
Feature register value.
Definition at line 288 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and getIsWiperSettingVolatile(). |
|
1-Wire command byte constant
Definition at line 88 of file LOW_device.h. Referenced by LOW_netSegment::cmd_MatchROM(). |
|
Network segment where the device is located.
Definition at line 193 of file LOW_device.h. Referenced by LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::getNetSegment(), LOW_device::LOW_device(), LOW_device::verifyDevice(), and LOW_device::~LOW_device(). |
|
Feature register value.
Definition at line 289 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and getPotentiometerCount(). |
|
Definition at line 268 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
Feature register value.
Definition at line 291 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and getPotentiometerResistance(). |
|
Definition at line 270 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
Definition at line 266 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
1-Wire command byte constant
Definition at line 77 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
1-Wire command byte constant
Definition at line 75 of file LOW_devDS2890.h. Referenced by cmd_ReadPosition(). |
|
1-Wire command byte constant
Definition at line 89 of file LOW_device.h. Referenced by LOW_netSegment::cmd_ReadROM(). |
|
Special byte to activate new values.
Definition at line 262 of file LOW_devDS2890.h. Referenced by cmd_WriteControlRegister(), and cmd_WritePosition(). |
|
1-Wire command byte constant
Definition at line 92 of file LOW_device.h. Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices(). |
|
1-Wire command byte constant
Definition at line 91 of file LOW_device.h. Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices(). |
|
1-Wire command byte constant
Definition at line 90 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SkipROM(). |
|
Pseudo family code for unknown device types.
Definition at line 76 of file LOW_device.h. Referenced by LOW_netSegment::getDevice(), LOW_netSegment::getDevices(), and LOW_deviceFactory::registerSpecificCtor(). |
|
Definition at line 275 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), cmd_ReadPosition(), and cmd_WriteControlRegister(). |
|
Definition at line 269 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
Feature register value.
Definition at line 290 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(), and getWiperPositionsCount(). |
|
Definition at line 267 of file LOW_devDS2890.h. Referenced by cmd_ReadControlRegister(). |
|
1-Wire command byte constant
Definition at line 78 of file LOW_devDS2890.h. Referenced by cmd_WriteControlRegister(). |
|
1-Wire command byte constant
Definition at line 76 of file LOW_devDS2890.h. Referenced by cmd_WritePosition(). |