![]() |
OneWire Library for Arduino
version: 1.0.0
|
DS2431 1024-Bit 1-Wire EEPROM. More...
#include <DS2431.h>
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... | |
![]() | |
RomId | romId () const |
void | setRomId (const RomId &romId) |
Additional Inherited Members | |
![]() | |
enum | CmdResult { Success, CommunicationError, CrcError, TimeoutError, OperationFailure } |
![]() | |
OneWireSlave (RandomAccessRomIterator &selector) | |
OneWireMaster::CmdResult | selectDevice () const |
Select this slave device by ROM ID. More... | |
OneWireMaster & | master () const |
The 1-Wire master for this slave device. More... | |
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.
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:
[in] | selector | - reference to RandomAccessRomIterator sub-class; i.e. SingledropRomIterator, MultidropRomIterator, etc. See RomId/RomIterator.h |
On Exit:
OneWireSlave::CmdResult DS2431::readMemory | ( | uint16_t | targetAddress, |
uint8_t * | data, | ||
uint8_t | numBytes | ||
) |
readMemory
Reads block of data from EEPROM memory.
On Entry:
[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:
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:
[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: