1-Wire API for .NET Version 4.00
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

MemoryBankScratchTemp Class Reference

Memory bank class for the DS28EA00. More...

Inherits com::dalsemi::onewire::container::MemoryBank.

List of all members.

Public Member Functions

 MemoryBankScratchTemp (OneWireContainer ibutton)
 Memory bank contstuctor.
String getBankDescription ()
 Query to see get a string description of the current memory bank.
boolean isGeneralPurposeMemory ()
 Query to see if the current memory bank is general purpose user memory.
int getSize ()
 Query to get the memory bank size in bytes.
boolean isReadWrite ()
 Query to see if current memory bank is read/write.
boolean isWriteOnce ()
 Query to see if current memory bank is write write once such as with EPROM technology.
boolean isReadOnly ()
 Query to see if current memory bank is read only.
boolean isNonVolatile ()
 Query to see if current memory bank non-volatile.
boolean needsProgramPulse ()
 Query to see if current memory bank pages need the adapter to have a 'ProgramPulse' in order to write to the memory.
boolean needsPowerDelivery ()
 Query to see if current memory bank pages need the adapter to have a 'PowerDelivery' feature in order to write to the memory.
int getStartPhysicalAddress ()
 Query to get the starting physical address of this bank.
void setWriteVerification (boolean doReadVerf)
 Set the write verification for the 'write()' method.
void read (int startAddr, boolean readContinue, byte[] readBuf, int offset, int len) throws OneWireIOException, OneWireException
 Read memory in the current bank with no CRC checking (device or data).
void write (int startAddr, byte[] writeBuf, int offset, int len) throws OneWireIOException, OneWireException
 Write memory in the current bank.
void writeScratchpad (byte[] data) throws OneWireIOException, OneWireException
 Writes to the Scratchpad of the DS28EA00 and similar devices.
boolean isExternalPowerSupplied () throws OneWireIOException, OneWireException
 Reads the way power is supplied to the DS28EA00.
void checkSpeed () throws OneWireIOException, OneWireException
 Check the device speed if has not been done before or if an error was detected.
void forceVerify ()
 Set the flag to indicate the next 'checkSpeed()' will force a speed set and verify 'doSpeed()'.

Static Public Attributes

static final byte READ_POWER_SUPPLY_COMMAND = ( byte ) 0xB4
 Read power supply command.

Protected Member Functions

byte[] readScratchpad () throws OneWireIOException, OneWireException
 Reads the 8 byte scratchpad and returns the data in an array.
byte[] readRecallScratchpad () throws OneWireIOException, OneWireException
 Reads the 8 byte scratchpad with Esquared recalled and returns the data in an array.

Protected Attributes

int startPhysicalAddress
 Starting physical address in memory bank.
int size
 Size of memory bank in bytes.
String bankDescription
 Memory bank descriptions.
boolean generalPurposeMemory
 Memory bank usage flags.
boolean readWrite
 Flag if memory bank is read/write.
boolean writeOnce
 Flag if memory bank is write once (EPROM)
boolean readOnly
 Flag if memory bank is read only.
boolean nonVolatile
 Flag if memory bank is non volatile (will not erase when power removed)
boolean powerDelivery
 Flag if memory bank needs power delivery to write.
OneWireContainer ib
 Reference to the OneWireContainer this bank resides on.
byte[] ffBlock
 block of 0xFF's used for faster read pre-fill of 1-Wire blocks
boolean writeVerification
 Flag if read back verification is enabled in 'write()'.
boolean doSetSpeed
 Flag to indicate that speed needs to be set.

Detailed Description

Memory bank class for the DS28EA00.

Version:
0.00, 15 October 2006
Author:

Constructor & Destructor Documentation

Memory bank contstuctor.

Requires reference to the OneWireContainer this memory bank resides on.


Member Function Documentation

void checkSpeed ( ) throws OneWireIOException, OneWireException

Check the device speed if has not been done before or if an error was detected.

Exceptions:
OneWireIOException
OneWireException
String getBankDescription ( )

Query to see get a string description of the current memory bank.

Returns:
String containing the memory bank description

Implements MemoryBank.

int getSize ( )

Query to get the memory bank size in bytes.

Returns:
memory bank size in bytes.

Implements MemoryBank.

int getStartPhysicalAddress ( )

Query to get the starting physical address of this bank.

Physical banks are sometimes sub-divided into logical banks due to changes in attributes.

Returns:
physical starting address of this logical bank.

Implements MemoryBank.

boolean isExternalPowerSupplied ( ) throws OneWireIOException, OneWireException

Reads the way power is supplied to the DS28EA00.

Returns:
true for external power,
false for parasite power
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer42. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter
boolean isGeneralPurposeMemory ( )

Query to see if the current memory bank is general purpose user memory.

If it is NOT then it is Memory-Mapped and writing values to this memory will affect the behavior of the 1-Wire device.

Returns:
'true' if current memory bank is general purpose

Implements MemoryBank.

boolean isNonVolatile ( )

Query to see if current memory bank non-volatile.

Memory is non-volatile if it retains its contents even when removed from the 1-Wire network.

Returns:
'true' if current memory bank non volatile.

Implements MemoryBank.

boolean isReadOnly ( )

Query to see if current memory bank is read only.

Returns:
'true' if current memory bank can only be read

Implements MemoryBank.

boolean isReadWrite ( )

Query to see if current memory bank is read/write.

Returns:
'true' if current memory bank is read/write

Implements MemoryBank.

boolean isWriteOnce ( )

Query to see if current memory bank is write write once such as with EPROM technology.

Returns:
'true' if current memory bank can only be written once

Implements MemoryBank.

boolean needsPowerDelivery ( )

Query to see if current memory bank pages need the adapter to have a 'PowerDelivery' feature in order to write to the memory.

Returns:
'true' if writing to the current memory bank pages requires 'PowerDelivery'.

Implements MemoryBank.

boolean needsProgramPulse ( )

Query to see if current memory bank pages need the adapter to have a 'ProgramPulse' in order to write to the memory.

Returns:
'true' if writing to the current memory bank pages requires a 'ProgramPulse'.

Implements MemoryBank.

void read ( int  startAddr,
boolean  readContinue,
byte[]  readBuf,
int  offset,
int  len 
) throws OneWireIOException, OneWireException

Read memory in the current bank with no CRC checking (device or data).

The resulting data from this API may or may not be what is on the 1-Wire device. It is recommends that the data contain some kind of checking (CRC) like in the readPagePacket() method or have the 1-Wire device provide the CRC as in readPageCRC(). readPageCRC() however is not supported on all memory types, see 'hasPageAutoCRC()'. If neither is an option then this method could be called more then once to at least verify that the same thing is read consistantly.

Parameters:
startAddrstarting physical address
readContinueignored by method
readBufbyte array to place read data into
offsetoffset into readBuf to place data
lenlength in bytes to read
Exceptions:
OneWireIOException
OneWireException

Implements MemoryBank.

byte [] readRecallScratchpad ( ) throws OneWireIOException, OneWireException [protected]

Reads the 8 byte scratchpad with Esquared recalled and returns the data in an array.

Parameters:
none
Returns:
eight byte array that make up the scratchpad
Exceptions:
OneWireIOExceptionError reading data
OneWireExceptionCould not find part
byte [] readScratchpad ( ) throws OneWireIOException, OneWireException [protected]

Reads the 8 byte scratchpad and returns the data in an array.

Parameters:
none
Returns:
eight byte array that make up the scratchpad
Exceptions:
OneWireIOExceptionError reading data
OneWireExceptionCould not find part
void setWriteVerification ( boolean  doReadVerf)

Set the write verification for the 'write()' method.

Parameters:
doReadVerftrue (default) verify write in 'write' false, don't verify write (used on Write-Once bit manipulation)

Implements MemoryBank.

void write ( int  startAddr,
byte[]  writeBuf,
int  offset,
int  len 
) throws OneWireIOException, OneWireException

Write memory in the current bank.

It is recommended that when writing data that some structure in the data is created to provide error free reading back with read(). Or the method 'writePagePacket()' could be used which automatically wraps the data in a length and CRC.

When using on Write-Once devices care must be taken to write into into empty space. If write() is used to write over an unlocked page on a Write-Once device it will fail. If write verification is turned off with the method 'setWriteVerification(false)' then the result will be an 'AND' of the existing data and the new data.

Parameters:
startAddrstarting address
writeBufbyte array containing data to write
offsetoffset into writeBuf to start writing data
lenlength in bytes to write
Exceptions:
OneWireIOException
OneWireException

Implements MemoryBank.

void writeScratchpad ( byte[]  data) throws OneWireIOException, OneWireException

Writes to the Scratchpad of the DS28EA00 and similar devices.

Parameters:
datadata to be written to the scratchpad. First byte of data must be the temperature High Trip Point, the second byte must be the temperature Low Trip Point, and the third must be the Resolution (configuration register).
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer42. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
OneWireExceptionon a communication or setup error with the 1-Wire adapter
IllegalArgumentExceptionwhen data is of invalid length

Member Data Documentation

final byte READ_POWER_SUPPLY_COMMAND = ( byte ) 0xB4 [static]

Read power supply command.

This command is used to determine if external power is supplied.

int startPhysicalAddress [protected]

Starting physical address in memory bank.

Needed for different types of memory in the same logical memory bank. This can be used to seperate them into two virtual memory banks. Example: DS2406 status page has mixed EPROM and Volatile RAM.


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