Extended MaximInterface

Dependents:   mbed_DS28EC20_GPIO

Embed: (wiki syntax)

« Back to documentation index

DS1920 Class Reference

DS1920 Class Reference

DS1920 1-Wire Temperature iButton. More...

#include <DS1920.hpp>

Public Types

typedef array_span
< uint_least8_t, 8 > 
Scratchpad
 Holds the contents of the device scratchpad.

Public Member Functions

MaximInterface_EXPORT error_code writeScratchpad (uint_least8_t th, uint_least8_t tl)
 Write Scratchpad Command.
MaximInterface_EXPORT error_code readScratchpad (Scratchpad::span scratchpad)
 Read Scratchpad Command.
MaximInterface_EXPORT error_code copyScratchpad ()
 Copy Scratchpad Command.
MaximInterface_EXPORT error_code convertTemperature ()
 Convert Temperature Command.
MaximInterface_EXPORT error_code 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 array_span<uint_least8_t, 8> Scratchpad

Holds the contents of the device scratchpad.

Definition at line 58 of file DS1920.hpp.


Member Function Documentation

error_code convertTemperature (  )

Convert Temperature Command.

This command begins a temperature conversion.

Definition at line 78 of file DS1920.cpp.

error_code 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 66 of file DS1920.cpp.

error_code readScratchpad ( Scratchpad::span  scratchpad )

Read Scratchpad Command.

Parameters:
[out]scratchpadContents of scratchpad.

Definition at line 48 of file DS1920.cpp.

error_code recallEeprom (  )

Recall Command.

This command recalls the temperature trigger values stored in EEPROM to the scratchpad.

Definition at line 90 of file DS1920.cpp.

error_code 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]th8-bit upper temperature threshold, MSB indicates sign.
[in]tl8-bit lower temperature threshold, MSB indicates sign.

Definition at line 39 of file DS1920.cpp.