Package com.dalsemi.onewire.container
Class OneWireContainer2D
- java.lang.Object
-
- com.dalsemi.onewire.container.OneWireContainer
-
- com.dalsemi.onewire.container.OneWireContainer2D
-
public class OneWireContainer2D extends OneWireContainer
1-Wire® container for the '1K-Bit protected 1-Wire EEPROM family type 2D (hex), Maxim Integrated Products part number: DS2431.
Features
- 1024 bits of 5V EEPROM memory partitioned into four pages of 256 bits
- unique, fatory-lasered and tested 64-bit registration number (8-bit family code + 48-bit serial number + 8-bit CRC tester) assures absolute traceability because no two parts are alike.
- Built-in multidrop controller ensures compatibility with other 1-Wire net products.
- Reduces control, address, data and power to a single data pin.
- Directly connects to a single port pin of a microprocessor and communicates at up to 16.3k bits per second.
- Overdrive mode boosts communication speed to 142k bits per second.
- 8-bit family code specifies DS2431 communication requirements to reader.
- Presence detector acknowledges when reader first applies voltage.
- Low cost 6-lead TSOC surface mount package
- Reads and writes over a wide voltage range of 2.8V to 5.25V from -40C to +85C.
The memory can also be accessed through the objects that are returned from the
getMemoryBanks
method.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
WRITEONCE_FLAG
Page Lock Flag-
Fields inherited from class com.dalsemi.onewire.container.OneWireContainer
adapter, address, speed, speedFallBackOK
-
-
Constructor Summary
Constructors Constructor Description OneWireContainer2D()
Default Constructor OneWireContainer2D.OneWireContainer2D(DSPortAdapter sourceAdapter, byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.OneWireContainer2D(DSPortAdapter sourceAdapter, long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.OneWireContainer2D(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlternateNames()
Retrieve the alternate Maxim Integrated Products part numbers or names.java.lang.String
getDescription()
Retrieve a short description of the function of the iButton type.int
getMaxSpeed()
Returns the maximum speed this iButton can communicate at.java.util.Enumeration<MemoryBank>
getMemoryBanks()
Get an enumeration of memory bank instances that implement one or more of the following interfaces:MemoryBank
,PagedMemoryBank
, andOTPMemoryBank
.java.lang.String
getName()
Retrieve the Maxim Integrated Products part number of the iButton as a string.boolean
isPageWriteOnce(int page)
Query to see if current memory bank is write write once such as with EPROM technology.void
setPageWriteOnce(int page)
Lock the specified page in the current memory bank.void
setupContainer(DSPortAdapter sourceAdapter, byte[] newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.void
setupContainer(DSPortAdapter sourceAdapter, long newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.void
setupContainer(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.-
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer
doSpeed, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, hashCode, isAlarming, isPresent, setSpeed, toString
-
-
-
-
Field Detail
-
WRITEONCE_FLAG
public static final byte WRITEONCE_FLAG
Page Lock Flag- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OneWireContainer2D
public OneWireContainer2D()
Default Constructor OneWireContainer2D. Must call setupContainer before using.
-
OneWireContainer2D
public OneWireContainer2D(DSPortAdapter sourceAdapter, byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device
-
OneWireContainer2D
public OneWireContainer2D(DSPortAdapter sourceAdapter, long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device
-
OneWireContainer2D
public OneWireContainer2D(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device.- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device
-
-
Method Detail
-
setupContainer
public void setupContainer(DSPortAdapter sourceAdapter, byte[] newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.- Overrides:
setupContainer
in classOneWireContainer
- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device- See Also:
Address
-
setupContainer
public void setupContainer(DSPortAdapter sourceAdapter, long newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.- Overrides:
setupContainer
in classOneWireContainer
- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device- See Also:
Address
-
setupContainer
public void setupContainer(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Provide this container the adapter object used to access this device and provide the address of this iButton or 1-Wire device.- Overrides:
setupContainer
in classOneWireContainer
- Parameters:
sourceAdapter
- adapter object required to communicate with this iButton.newAddress
- address of this 1-Wire device- See Also:
Address
-
getName
public java.lang.String getName()
Retrieve the Maxim Integrated Products part number of the iButton as a string. For example 'DS1992'.- Overrides:
getName
in classOneWireContainer
- Returns:
- string representation of the iButton name.
-
getAlternateNames
public java.lang.String getAlternateNames()
Retrieve the alternate Maxim Integrated Products part numbers or names. A 'family' of MicroLAN devices may have more than one part number depending on packaging.- Overrides:
getAlternateNames
in classOneWireContainer
- Returns:
- the alternate names for this iButton or 1-Wire device
-
getDescription
public java.lang.String getDescription()
Retrieve a short description of the function of the iButton type.- Overrides:
getDescription
in classOneWireContainer
- Returns:
- string representation of the function description.
-
getMaxSpeed
public int getMaxSpeed()
Returns the maximum speed this iButton can communicate at.- Overrides:
getMaxSpeed
in classOneWireContainer
- Returns:
- max. communication speed.
- See Also:
DSPortAdapter.setSpeed(int)
-
getMemoryBanks
public java.util.Enumeration<MemoryBank> getMemoryBanks()
Get an enumeration of memory bank instances that implement one or more of the following interfaces:MemoryBank
,PagedMemoryBank
, andOTPMemoryBank
.- Overrides:
getMemoryBanks
in classOneWireContainer
- Returns:
Enumeration
of memory banks- See Also:
MemoryBank
-
isPageWriteOnce
public boolean isPageWriteOnce(int page) throws OneWireIOException, OneWireException
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
- Throws:
OneWireIOException
OneWireException
-
setPageWriteOnce
public void setPageWriteOnce(int page) throws OneWireIOException, OneWireException
Lock the specified page in the current memory bank. Not supported by all devices. See the method 'canLockPage()'.- Parameters:
page
- number of page to lock- Throws:
OneWireIOException
OneWireException
-
-