OneWire Library for Arduino  version: 1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
OneWire::DS1920 Class Reference

DS1920 1-wire temperature i-button. More...

#include <DS1920.h>

Inheritance diagram for OneWire::DS1920:
OneWire::OneWireSlave

Public Types

enum  CmdResult { Success, CommsReadError, CommsWriteError, OpFailure }
 Result of operations. More...
 
- Public Types inherited from OneWire::OneWireSlave
enum  CmdResult {
  Success, CommunicationError, CrcError, TimeoutError,
  OperationFailure
}
 

Public Member Functions

 DS1920 (RandomAccessRomIterator &selector)
 DS1920 constructor. More...
 
CmdResult writeScratchPad (uint8_t th, uint8_t tl)
 Write Scratchpad Command. More...
 
CmdResult readScratchPad (uint8_t *scratchPadBuff)
 Read Scratchpad Command. More...
 
CmdResult copyScratchPad (void)
 Copy Scratchpad Command. More...
 
CmdResult convertTemperature (float &temp)
 Convert Temperature Command. More...
 
CmdResult recallEEPROM (void)
 Recall Command. More...
 
- Public Member Functions inherited from OneWire::OneWireSlave
RomId romId () const
 
void setRomId (const RomId &romId)
 

Static Public Attributes

static const uint8_t DS1920_FAMILY_CODE = 0x10
 

Additional Inherited Members

- Protected Member Functions inherited from OneWire::OneWireSlave
 OneWireSlave (RandomAccessRomIterator &selector)
 
OneWireMaster::CmdResult selectDevice () const
 Select this slave device by ROM ID. More...
 
OneWireMastermaster () const
 The 1-Wire master for this slave device. More...
 

Detailed Description

DS1920 1-wire temperature i-button.

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.

Member Enumeration Documentation

Result of operations.

Enumerator
Success 
CommsReadError 
CommsWriteError 
OpFailure 

Constructor & Destructor Documentation

DS1920::DS1920 ( RandomAccessRomIterator selector)

DS1920 constructor.

On Entry:

Parameters
[in]selector- Reference to RandomAccessRomiteraor object that encapsulates owm master that has access to this device and ROM function commands used to a select device

On Exit:

Returns

Member Function Documentation

DS1920::CmdResult DS1920::convertTemperature ( float &  temp)

Convert Temperature Command.

This command begins a temperature conversion.

On Entry:

Parameters
[in]OnExit:
[out]temp- temperature conversion results
Returns
CmdResult - result of operation
DS1920::CmdResult DS1920::copyScratchPad ( void  )

Copy Scratchpad Command.

This command copies from the scratchpad into the EEPROM of the DS1920, storing the temperature trigger bytes in nonvolatile memory.

On Entry:

Parameters
[in]OnExit:
[out]return CmdResult - result of operation
DS1920::CmdResult DS1920::readScratchPad ( uint8_t *  scratchPadBuff)

Read Scratchpad Command.

This command reads the complete scratchpad.

On Entry:

Parameters
[in]scratchPadBuff- array for receiving contents of scratchpad, this buffer will be over written

On Exit:

Parameters
[out]scratchPadBuff- contents of scratchpad
Returns
CmdResult - result of operation
DS1920::CmdResult DS1920::recallEEPROM ( void  )

Recall Command.

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

On Entry:

Parameters
[in]OnExit:
[out]return CmdResult - result of operation
DS1920::CmdResult DS1920::writeScratchPad ( uint8_t  th,
uint8_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.

On Entry:

Parameters
[in]th- 8-bit upper temperature threshold, MSB indicates sign
[in]tl- 8-bit lower temperature threshold, MSB indicates sign

On Exit:

Parameters
[out]return CmdResult - result of operation

Member Data Documentation

const uint8_t OneWire::DS1920::DS1920_FAMILY_CODE = 0x10
static

The documentation for this class was generated from the following files: