1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Embed: (wiki syntax)

« Back to documentation index

DS2431 Class Reference

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

#include <DS2431.h>

Inherits OneWire::OneWireSlave.

Public Member Functions

 DS2431 (RandomAccessRomIterator &selector)
 DS2431 constructor.
OneWireSlave::CmdResult writeMemory (Address targetAddress, const Scratchpad &data)
 writeMemory
OneWireSlave::CmdResult readMemory (Address targetAddress, uint8_t numBytes, uint8_t *data)
 readMemory
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

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.

Definition at line 54 of file DS2431.h.


Constructor & Destructor Documentation

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:

Definition at line 50 of file DS2431.cpp.


Member Function Documentation

OneWireMaster& master (  ) const [protected, inherited]

The 1-Wire master for this slave device.

Definition at line 77 of file OneWireSlave.h.

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

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

Definition at line 78 of file DS2431.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.

OneWireSlave::CmdResult writeMemory ( Address  targetAddress,
const Scratchpad data 
)

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

Definition at line 55 of file DS2431.cpp.