Maxim Integrated / OneWire

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Embed: (wiki syntax)

« Back to documentation index

DS1920 Class Reference

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

#include <DS1920.h>

Inherits OneWire::OneWireSlave.

Public Types

enum  CmdResult
 

Result of operations.

More...

Public Member Functions

 DS1920 (RandomAccessRomIterator &selector)
 DS1920 constructor.
CmdResult writeScratchPad (uint8_t th, uint8_t tl)
 Write Scratchpad Command.
CmdResult readScratchPad (uint8_t *scratchPadBuff)
 Read Scratchpad Command.
CmdResult copyScratchPad (void)
 Copy Scratchpad Command.
CmdResult convertTemperature (float &temp)
 Convert Temperature Command.
CmdResult recallEEPROM (void)
 Recall Command.
RomId romId () const

Protected Member Functions

OneWireMaster::CmdResult selectDevice () const
 Select this slave device by ROM ID.
OneWireMastermaster () const
 The 1-Wire master for this slave device.

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.

Definition at line 58 of file DS1920.h.


Member Enumeration Documentation

enum CmdResult

Result of operations.

Reimplemented from OneWireSlave.

Definition at line 63 of file DS1920.h.


Constructor & Destructor Documentation

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:

Definition at line 53 of file DS1920.cpp.


Member Function Documentation

DS1920::CmdResult convertTemperature ( float &  temp )

Convert Temperature Command.

This command begins a temperature conversion.

On Entry:

Parameters:
[in]On Exit:
[out]temp- temperature conversion results
Returns:
CmdResult - result of operation

Definition at line 151 of file DS1920.cpp.

DS1920::CmdResult 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]On Exit:
[out]
Returns:
CmdResult - result of operation

Definition at line 122 of file DS1920.cpp.

OneWireMaster& master (  ) const [protected, inherited]

The 1-Wire master for this slave device.

Definition at line 77 of file OneWireSlave.h.

DS1920::CmdResult 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

Definition at line 85 of file DS1920.cpp.

DS1920::CmdResult recallEEPROM ( void   )

Recall Command.

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

On Entry:

Parameters:
[in]On Exit:
[out]
Returns:
CmdResult - result of operation

Definition at line 198 of file DS1920.cpp.

RomId romId (  ) const [inherited]

1-Wire ROM ID for this slave device.

Definition at line 59 of file OneWireSlave.h.

OneWireMaster::CmdResult selectDevice (  ) const [protected, inherited]

Select this slave device by ROM ID.

Definition at line 74 of file OneWireSlave.h.

DS1920::CmdResult 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]
Returns:
CmdResult - result of operation

Definition at line 59 of file DS1920.cpp.