#include <LOW_devDS1820.h>
Inheritance diagram for LOW_devDS1820:
Public Types | |
typedef std::vector< LOW_devDS1820 *> | devDS1820PtrVec_t |
Vector type of class device pointers. More... | |
typedef LOW_devDS1820::scratchpadDS1820_t | scratchpadDS1820_t |
DS1820 internal scratchpad as defined by Dallas. More... | |
typedef std::vector< LOW_device *> | devPtrVec_t |
Vector type of class device pointers. More... | |
typedef std::map< LOW_deviceID, LOW_device *> | deviceMap_t |
Map type of devices with LOW_deviceID as key. More... | |
Public Methods | |
class_DERIVE_FROM_EXCEPTION (devDS1820_error, LOW_exception) | |
Exception base class for all exceptions thrown by LOW_devDS1820. More... | |
LOW_devDS1820 (LOW_netSegment &inSegment, const LOW_deviceID &inDevID) | |
Real constructor corresponding to static pseudo constructor new_Instance(). More... | |
~LOW_devDS1820 () | |
Destructor. More... | |
virtual string | getFamilyName () const |
Get the device's family name. More... | |
bool | getIsExternalPowered () const |
Get whether the device is externally powered. More... | |
void | cmd_ConvertT () const |
Initiate a single temperature conversion. More... | |
void | cmd_ReadScratchpad (scratchpadDS1820_t *outScratchpad) const |
Read the contents of the scratchpad. More... | |
void | cmd_WriteScratchpad (const uint8_t inTL, const uint8_t inTH) const |
Write 2 bytes of data to the DS18S20 scratchpad. More... | |
void | cmd_CopyScratchpad () const |
Copy the contents of the scratchpad TH and TL registers to EEPROM. More... | |
void | cmd_RecallE2 () const |
Recall the alarm trigger values (TH and TL) from EEPROM and place the data in bytes 2 and 3, respectively, in the scratchpad memory. More... | |
bool | cmd_ReadPowerSupply () const |
Determine the device is using parasite power. More... | |
LOW_deviceID | getID () const |
Get the device's ROM ID. More... | |
LOW_netSegment & | getNetSegment () const |
Get the network segment the device is on. More... | |
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. More... | |
Static Public Attributes | |
const LOW_deviceIDRaw::devFamCode_t | familyCode = 0x10 |
Family code of this specific device. More... | |
const string | familyName = "DS1820" |
Family name of this specific device. More... | |
const owCommand_t | ConvertT_COMMAND = 0x44 |
1-Wire command byte constant. More... | |
const owCommand_t | ReadScratchpad_COMMAND = 0xbe |
1-Wire command byte constant. More... | |
const owCommand_t | WriteScratchpad_COMMAND = 0x4e |
1-Wire command byte constant. More... | |
const owCommand_t | CopyScratchpad_COMMAND = 0x48 |
1-Wire command byte constant. More... | |
const owCommand_t | RecallE2_COMMAND = 0xb8 |
1-Wire command byte constant. More... | |
const owCommand_t | ReadPowerSupply_COMMAND = 0xb4 |
1-Wire command byte constant. More... | |
const LOW_deviceIDRaw::devFamCode_t | anyDev_famCode = 0xff |
Family code for selecting any/all device types. More... | |
const owCommand_t | MatchROM_COMMAND = 0x55 |
1-Wire command byte constant. More... | |
const owCommand_t | ReadROM_COMMAND = 0x33 |
1-Wire command byte constant. More... | |
const owCommand_t | SkipROM_COMMAND = 0xcc |
1-Wire command byte constant. More... | |
const owCommand_t | SearchROM_COMMAND = 0xf0 |
1-Wire command byte constant. More... | |
const owCommand_t | SearchAlarmROM_COMMAND = 0xec |
1-Wire command byte constant. More... | |
Protected Methods | |
LOW_link & | getLink () const |
Get the link the device is on. More... | |
void | cmd_MatchROM () const |
Shortcut for issuing a matchROM command for a device. More... | |
Static Protected Methods | |
LOW_device * | new_Instance (LOW_netSegment &inNetSegment, const LOW_deviceID &inDevID) |
Static pseudo constructor for registering with LOW_deviceFactory. More... | |
Protected Attributes | |
bool | isExternalPowered |
Indicating wether the device is externally powered. More... | |
const LOW_deviceID | ID |
1-Wire ROM ID of the device. More... | |
LOW_netSegment & | netSegment |
Network segment where the device is located. More... | |
Static Private Methods | |
int | initialize () |
Static inizializer to register the class with LOW_deviceFactory. More... | |
Static Private Attributes | |
int | initHelper = initialize() |
Needed for dirty little C++ hack to force static initialization on application start. More... | |
Friends | |
class | linkLock |
Needed to grant access to the protected getLink() method. More... |
DS1820 features:
Definition at line 48 of file LOW_devDS1820.h.
|
Vector type of class device pointers.
Definition at line 87 of file LOW_devDS1820.h. |
|
Map type of devices with LOW_deviceID as key.
Definition at line 97 of file LOW_device.h. |
|
Vector type of class device pointers.
Definition at line 96 of file LOW_device.h. Referenced by LOW_netSegment::searchDevices(). |
|
DS1820 internal scratchpad as defined by Dallas.
|
|
Real constructor corresponding to static pseudo constructor new_Instance(). External power supply status is initially detected here.
Definition at line 61 of file LOW_devDS1820.cpp. References cmd_ReadPowerSupply(), cmd_RecallE2(), LOW_helper_msglog::devDS1820_dl, LOW_netSegment::getHasExternalPower(), isExternalPowered, and LOW_helper_msglog::printDebug(). Referenced by new_Instance(). |
|
Destructor.
Definition at line 75 of file LOW_devDS1820.cpp. |
|
Exception base class for all exceptions thrown by LOW_devDS1820.
|
|
Initiate a single temperature conversion. Following the conversion, the resulting thermal data is stored in the 2-byte temperature register in the scratchpad memory and the DS18S20 returns to its low-power idle state. The method uses different techniquies to detect the end of the conversion:
Definition at line 91 of file LOW_devDS1820.cpp. References LOW_device::cmd_MatchROM(), ConvertT_COMMAND, LOW_device::getLink(), LOW_device::linkLock, LOW_link::pullUp_1048, LOW_link::readDataBit(), and LOW_link::writeData(). Referenced by LOW_compTempSensor::checkAlarm(), and LOW_compTempSensor::getTemperature(). |
|
Copy the contents of the scratchpad TH and TL registers to EEPROM. If the device is being used in parasite power mode, a strong pullup on the 1-Wire bus is enabled. Definition at line 142 of file LOW_devDS1820.cpp. References LOW_device::cmd_MatchROM(), CopyScratchpad_COMMAND, LOW_device::getLink(), LOW_device::linkLock, LOW_link::pullUp_1048, and LOW_link::writeData(). Referenced by LOW_compTempSensor::setAlarmLevels(). |
|
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(), cmd_ConvertT(), cmd_CopyScratchpad(), LOW_devDS2405::cmd_Match(), cmd_ReadPowerSupply(), cmd_ReadScratchpad(), cmd_RecallE2(), cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal(). |
|
Determine the device is using parasite power.
Definition at line 177 of file LOW_devDS1820.cpp. References LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::linkLock, LOW_link::readDataBit(), ReadPowerSupply_COMMAND, and LOW_link::writeData(). Referenced by LOW_devDS1820(). |
|
Read the contents of the scratchpad. After fully reading the scratchpad a CRC verification is performed.
Definition at line 110 of file LOW_devDS1820.cpp. References byteVec_t, LOW_helper_CRC::calcCRC8(), LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::linkLock, LOW_link::readData(), ReadScratchpad_COMMAND, and LOW_link::writeData(). Referenced by LOW_compTempSensor::getAlarmLevels(), and LOW_compTempSensor::getTemperature(). |
|
Recall the alarm trigger values (TH and TL) from EEPROM and place the data in bytes 2 and 3, respectively, in the scratchpad memory. The method uses different techniquies to detect the end of reading:
Definition at line 158 of file LOW_devDS1820.cpp. References LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::linkLock, LOW_link::pullUp_1048, LOW_link::readDataBit(), RecallE2_COMMAND, and LOW_link::writeData(). Referenced by LOW_devDS1820(), and LOW_compTempSensor::recallAlarmLevels(). |
|
Write 2 bytes of data to the DS18S20 scratchpad.
Definition at line 127 of file LOW_devDS1820.cpp. References byteVec_t, LOW_device::cmd_MatchROM(), LOW_device::getLink(), LOW_device::linkLock, LOW_link::writeData(), and WriteScratchpad_COMMAND. Referenced by LOW_compTempSensor::setAlarmLevels(). |
|
Get the device's family name.
Reimplemented from LOW_device. Definition at line 131 of file LOW_devDS1820.h. References familyName. |
|
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 device is externally powered. No real activity on the 1-Wire bus occures.
Definition at line 85 of file LOW_devDS1820.cpp. References isExternalPowered. Referenced by LOW_compTempSensor::getIsExternalPowered(). |
|
Get the link the device is on.
Definition at line 96 of file LOW_device.cpp. References LOW_netSegment::getLink(), and LOW_device::netSegment. Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), cmd_ConvertT(), cmd_CopyScratchpad(), LOW_devDS2405::cmd_MatchRead(), cmd_ReadPowerSupply(), cmd_ReadScratchpad(), cmd_RecallE2(), LOW_devDS2405::cmd_SearchRead(), cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::cmd_ChannelAccess::readData(), LOW_devDS2406::cmd_ChannelAccess::readDataBit(), LOW_devDS2406::cmd_ChannelAccess::readDataByte(), LOW_devDS2406::readMemUniversal(), LOW_devDS2406::cmd_ChannelAccess::writeData(), and LOW_devDS2406::cmd_ChannelAccess::~cmd_ChannelAccess(). |
|
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(). |
|
Static inizializer to register the class with LOW_deviceFactory.
Definition at line 36 of file LOW_devDS1820.cpp. References familyCode, new_Instance(), and LOW_deviceFactory::registerSpecificCtor(). |
|
Static pseudo constructor for registering with LOW_deviceFactory.
Reimplemented from LOW_device. Definition at line 49 of file LOW_devDS1820.cpp. References LOW_devDS1820(). Referenced by initialize(). |
|
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(), LOW_devDS2405::cmd_SearchRead(), and LOW_network::verifyDevice(). |
|
Needed to grant access to the protected getLink() method.
Definition at line 174 of file LOW_device.h. Referenced by cmd_ConvertT(), cmd_CopyScratchpad(), LOW_devDS2405::cmd_Match(), LOW_devDS2405::cmd_MatchRead(), cmd_ReadPowerSupply(), cmd_ReadScratchpad(), cmd_RecallE2(), LOW_devDS2405::cmd_SearchActive(), LOW_devDS2405::cmd_SearchRead(), cmd_WriteScratchpad(), and LOW_devDS2406::readMemUniversal(). |
|
Family code for selecting any/all device types.
Definition at line 72 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SearchROM(), LOW_netSegment::getDevice(), LOW_netSegment::getDevices(), and LOW_deviceFactory::registerSpecificCtor(). |
|
1-Wire command byte constant.
Definition at line 74 of file LOW_devDS1820.h. Referenced by cmd_ConvertT(). |
|
1-Wire command byte constant.
Definition at line 77 of file LOW_devDS1820.h. Referenced by cmd_CopyScratchpad(). |
|
Family code of this specific device.
Reimplemented from LOW_device. Definition at line 69 of file LOW_devDS1820.h. Referenced by initialize(). |
|
Family name of this specific device.
Reimplemented from LOW_device. Definition at line 33 of file LOW_devDS1820.cpp. Referenced by getFamilyName(). |
|
1-Wire ROM ID of the device.
Definition at line 182 of file LOW_device.h. Referenced by LOW_device::getID(), LOW_device::LOW_device(), and LOW_device::verifyDevice(). |
|
Needed for dirty little C++ hack to force static initialization on application start.
Definition at line 35 of file LOW_devDS1820.cpp. |
|
Indicating wether the device is externally powered.
Definition at line 212 of file LOW_devDS1820.h. Referenced by getIsExternalPowered(), and LOW_devDS1820(). |
|
1-Wire command byte constant.
Definition at line 84 of file LOW_device.h. Referenced by LOW_netSegment::cmd_MatchROM(). |
|
Network segment where the device is located.
Definition at line 183 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(). |
|
1-Wire command byte constant.
Definition at line 79 of file LOW_devDS1820.h. Referenced by cmd_ReadPowerSupply(). |
|
1-Wire command byte constant.
Definition at line 85 of file LOW_device.h. Referenced by LOW_netSegment::cmd_ReadROM(). |
|
1-Wire command byte constant.
Definition at line 75 of file LOW_devDS1820.h. Referenced by cmd_ReadScratchpad(). |
|
1-Wire command byte constant.
Definition at line 78 of file LOW_devDS1820.h. Referenced by cmd_RecallE2(). |
|
1-Wire command byte constant.
Definition at line 88 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SearchROM(), and LOW_netSegment::cmd_SearchROMVerify(). |
|
1-Wire command byte constant.
Definition at line 87 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SearchROM(), and LOW_netSegment::cmd_SearchROMVerify(). |
|
1-Wire command byte constant.
Definition at line 86 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SkipROM(). |
|
1-Wire command byte constant.
Definition at line 76 of file LOW_devDS1820.h. Referenced by cmd_WriteScratchpad(). |