Device interface library for multiple platforms including Mbed.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
DS1920 Class Reference
DS1920 1-Wire Temperature iButton. More...
#include <DS1920.hpp>
Public Types | |
typedef Core::array < uint_least8_t, 8 > | Scratchpad |
Holds the contents of the device scratchpad. | |
Public Member Functions | |
MaximInterfaceDevices_EXPORT Core::Result< void > | writeScratchpad (uint_least8_t th, uint_least8_t tl) |
Write Scratchpad Command. | |
MaximInterfaceDevices_EXPORT Core::Result< Scratchpad > | readScratchpad () const |
Read Scratchpad Command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | copyScratchpad () |
Copy Scratchpad Command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | convertTemperature () |
Convert Temperature Command. | |
MaximInterfaceDevices_EXPORT Core::Result< void > | recallEeprom () |
Recall Command. |
Detailed Description
DS1920 1-Wire Temperature iButton.
The iButton® temperature logger (DS1920) provides direct-to-digital 9-bit temperature readings over a range of -55°C to +100°C in 0.5° increments. The iButton communicates with a processor using the 1-Wire® protocol through a hardware port interface. The port interface provides both the physical link and handles the communication protocols that enable the processor to access iButton resources with simple commands. Two bytes of EEPROM can be used either to set alarm triggers or for storing user data.
Definition at line 53 of file DS1920.hpp.
Member Typedef Documentation
typedef Core::array<uint_least8_t, 8> Scratchpad |
Holds the contents of the device scratchpad.
Definition at line 58 of file DS1920.hpp.
Member Function Documentation
Result< void > convertTemperature | ( | ) |
Convert Temperature Command.
This command begins a temperature conversion.
Definition at line 84 of file DS1920.cpp.
Result< void > copyScratchpad | ( | ) |
Copy Scratchpad Command.
This command copies from the scratchpad into the EEPROM of the DS1920, storing the temperature trigger bytes in nonvolatile memory.
Definition at line 72 of file DS1920.cpp.
Result< DS1920::Scratchpad > readScratchpad | ( | ) | const |
Result< void > recallEeprom | ( | ) |
Recall Command.
This command recalls the temperature trigger values stored in EEPROM to the scratchpad.
Definition at line 96 of file DS1920.cpp.
Result< void > writeScratchpad | ( | uint_least8_t | th, |
uint_least8_t | tl | ||
) |
Write Scratchpad Command.
If the result of a temperature measurement is higher than TH or lower than TL, an alarm flag inside the device is set. This flag is updated with every temperature measurement. As long as the alarm flag is set, the DS1920 will respond to the alarm search command.
- Parameters:
-
[in] th 8-bit upper temperature threshold, MSB indicates sign. [in] tl 8-bit lower temperature threshold, MSB indicates sign.
Definition at line 41 of file DS1920.cpp.
Generated on Tue Jul 12 2022 11:13:20 by 1.7.2