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

DS2431 1024-Bit 1-Wire EEPROM. More...

#include <DS2431.h>

Inheritance diagram for OneWire::DS2431:
OneWire::OneWireSlave

Public Member Functions

 DS2431 (RandomAccessRomIterator &selector)
 DS2431 constructor. More...
 
OneWireSlave::CmdResult writeMemory (uint16_t targetAddress, const uint8_t *data, uint8_t numBytes)
 writeMemory More...
 
OneWireSlave::CmdResult readMemory (uint16_t targetAddress, uint8_t *data, uint8_t numBytes)
 readMemory More...
 
- Public Member Functions inherited from OneWire::OneWireSlave
RomId romId () const
 
void setRomId (const RomId &romId)
 

Additional Inherited Members

- Public Types inherited from OneWire::OneWireSlave
enum  CmdResult {
  Success, CommunicationError, CrcError, TimeoutError,
  OperationFailure
}
 
- 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

DS2431 1024-Bit 1-Wire EEPROM.

The DS2431 is a 1024-bit, 1-Wire® EEPROM chip organized as four memory pages of 256 bits each. Data is written to an 8-byte scratchpad, verified, and then copied to the EEPROM memory. As a special feature, the four memory pages can individually be write protected or put in EPROM-emulation mode, where bits can only be changed from a 1 to a 0 state. The DS2431 communicates over the single-conductor 1-Wire bus. The communication follows the standard 1-Wire protocol. Each device has its own unalterable and unique 64-bit ROM registration number that is factory lasered into the chip. The registration number is used to address the device in a multidrop, 1-Wire net environment.

Constructor & Destructor Documentation

DS2431::DS2431 ( RandomAccessRomIterator selector)

DS2431 constructor.

Instantiate a DS2431 object that encapsulates the 1-Wire master and ROM commands for selecting the device via the RandomAccessRomIterator sub-class passed as an argument to the constructor.

This allows the user to focus on the use of the DS2431 in their application vs. the low level details of the 1-Wire protocol.

On Entry:

Parameters
[in]selector- reference to RandomAccessRomIterator sub-class; i.e. SingledropRomIterator, MultidropRomIterator, etc. See RomId/RomIterator.h

On Exit:

Returns

Member Function Documentation

OneWireSlave::CmdResult DS2431::readMemory ( uint16_t  targetAddress,
uint8_t *  data,
uint8_t  numBytes 
)

readMemory

Reads block of data from EEPROM memory.

On Entry:

Parameters
[in]targetAddress- EEPROM memory address to start. reading from
[out]data- Pointer to memory for storing data.
[in]numBytes- Number of bytes to read.

On Exit:

Returns
Result of operation
OneWireSlave::CmdResult DS2431::writeMemory ( uint16_t  targetAddress,
const uint8_t *  data,
uint8_t  numBytes 
)

writeMemory

Writes data to EEPROM. Wraps up writeScratchPad, readScratchPad and copyScratchPad into single function.

On Entry:

Parameters
[in]targetAddress- EEPROM memory address to start writing at.
[in]data- Pointer to memory holding data.
[in]numBytes- Number of bytes to write.

On Exit:

Returns
Result of operation

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