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

OneWireContainer1C Class Reference

Inherits com::dalsemi::onewire::container::OneWireContainer, and com::dalsemi::onewire::container::SwitchContainer.

List of all members.

Public Member Functions

 OneWireContainer1C ()
 Creates a new OneWireContainer for communication with a DS28E04.
 OneWireContainer1C (DSPortAdapter sourceAdapter, byte[] newAddress)
 Creates a new OneWireContainer for communication with a DS28E04.
 OneWireContainer1C (DSPortAdapter sourceAdapter, long newAddress)
 Creates a new OneWireContainer for communication with a DS28E04.
 OneWireContainer1C (DSPortAdapter sourceAdapter, String newAddress)
 Creates a new OneWireContainer for communication with a DS28E04.
String getName ()
 Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String.
Enumeration getMemoryBanks ()
 Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank.
String getAlternateNames ()
 Retrieves the alternate Maxim Integrated Products part numbers or names.
String getDescription ()
 Gets a short description of the function of this iButton or 1-Wire Device type.
int getNumberChannels (byte[] state)
 Gets the number of channels supported by this switch.
boolean isHighSideSwitch ()
 Checks if the channels of this switch are 'high side' switches.
boolean hasActivitySensing ()
 Checks if the channels of this switch support activity sensing.
boolean hasLevelSensing ()
 Checks if the channels of this switch support level sensing.
boolean hasSmartOn ()
 Checks if the channels of this switch support 'smart on'.
boolean onlySingleChannelOn ()
 Checks if the channels of this switch require that only one channel is on at any one time.
boolean getLevel (int channel, byte[] state)
 Checks the sensed level on the indicated channel.
boolean getLatchState (int channel, byte[] state)
 Checks the latch state of the indicated channel.
boolean getSensedActivity (int channel, byte[] state) throws OneWireException
 Checks if the indicated channel has experienced activity.
void clearActivity () throws OneWireException
 Clears the activity latches the next time possible.
void setLatchState (int channel, boolean latchState, boolean doSmart, byte[] state)
 Sets the latch state of the indicated channel.
void setLatchState (byte set, byte[] state)
 Sets the latch state for all of the channels.
byte[] readDevice () throws OneWireIOException, OneWireException
 Retrieves the 1-Wire device sensor state.
byte[] readRegister () throws OneWireIOException, OneWireException
 Retrieves the 1-Wire device register mask.
void writeDevice (byte[] state) throws OneWireIOException, OneWireException
 Updates the latch state for the 2 general purpose PIO pins.
void writeRegister (byte[] register) throws OneWireIOException, OneWireException
 Writes the 1-Wire device register mask that have been changed by 'set' methods.
boolean isVccPowered (byte[] register) throws OneWireIOException, OneWireException
 Retrieves the state of the VCC pin.
void clearPowerOnReset (byte[] register)
 Checks if the Power On Reset if on and if so clears it.
void orConditionalSearch (byte[] register)
 Checks if the 'or' Condition Search is set and if not sets it.
void andConditionalSearch (byte[] register)
 Checks if the 'and' Conditional Search is set and if not sets it.
void setConditionalSearchLogicLevel (byte[] register)
 Checks if the 'PIO Level' Conditional Search is set for input and if not sets it.
void setConditionalSearchActivity (byte[] register)
 Checks if the 'PIO Activity latches' are set for Conditional Search and if not sets it.
void setChannelMask (int channel, boolean set, byte[] register)
 Sets the channel passed to the proper state depending on the set parameter for responding to the Conditional Search.
void setChannelPolarity (int channel, boolean set, byte[] register)
 Sets the channel passed to the proper state depending on the set parameter for the correct polarity in the Conditional Search.
boolean getChannelMask (int channel, byte[] register)
 Retrieves the information if the channel is masked for the Conditional Search.
boolean getChannelPolarity (int channel, byte[] register)
 Retrieves the polarity of the channel for the Conditional Search.

Static Public Attributes

static final byte PIO_ACCESS_READ = ( byte ) 0xF5
 Reads the PIO logical status in an endless loops.
static final byte PIO_ACCESS_WRITE = ( byte ) 0x5A
 Writes the PIO output latch.
static final byte PIO_ACCESS_PULSE = ( byte ) 0xA5
 Generates a pulse on the selected PIOs.
static final byte RESET_ACTIVITY_LATCHES = ( byte ) 0xC3
 Generates a pulse on the selected PIOs.
static final byte WRITE_REGISTER = ( byte ) 0xCC
 Writes the value to the Conditional Search registers or Control/Status register.

Detailed Description

1-Wire® container for a Addressable 1-Wire 4K-bit EEPROM, DS28E04. This container encapsulates the functionality of the 1-Wire family type 1C (hex)

Features

Usage

See also:
com.dalsemi.onewire.container.OneWireSensor
com.dalsemi.onewire.container.SwitchContainer
com.dalsemi.onewire.container.OneWireContainer
Version:
1.00, 06 Jul 2004
Author:
SKH

Constructor & Destructor Documentation

OneWireContainer1C ( DSPortAdapter  sourceAdapter,
byte[]  newAddress 
)

Creates a new OneWireContainer for communication with a DS28E04.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this DS28E04
See also:
OneWireContainer1C()
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,long) OneWireContainer1C(DSPortAdapter,long)
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,java.lang.String) OneWireContainer1C(DSPortAdapter,String)
OneWireContainer1C ( DSPortAdapter  sourceAdapter,
long  newAddress 
)

Creates a new OneWireContainer for communication with a DS28E04.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this DS28E04
See also:
OneWireContainer1C()
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,byte[]) OneWireContainer1C(DSPortAdapter,byte[])
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,java.lang.String) OneWireContainer1C(DSPortAdapter,String)
OneWireContainer1C ( DSPortAdapter  sourceAdapter,
String  newAddress 
)

Creates a new OneWireContainer for communication with a DS28E04.

Parameters:
sourceAdapteradapter object required to communicate with this 1-Wire device
newAddressaddress of this DS28E04
See also:
OneWireContainer1C()
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,byte[]) OneWireContainer1C(DSPortAdapter,byte[])
OneWireContainer1C(com.dalsemi.onewire.adapter.DSPortAdapter,long) OneWireContainer1C(DSPortAdapter,long)

Member Function Documentation

void andConditionalSearch ( byte[]  register)

Checks if the 'and' Conditional Search is set and if not sets it.

Parameters:
registercurrent register for conditional search, which if returned from readRegister()
void clearActivity ( ) throws OneWireException

Clears the activity latches the next time possible.

For example, on a DS2406/07, this happens the next time the status is read with readDevice().

Exceptions:
OneWireExceptionif this device does not support activity sensing
See also:
com.dalsemi.onewire.container.OneWireSensor.readDevice()
getSensedActivity(int,byte[])

Implements SwitchContainer.

void clearPowerOnReset ( byte[]  register)

Checks if the Power On Reset if on and if so clears it.

Parameters:
registercurrent register for conditional search, which if returned from readRegister()
String getAlternateNames ( )

Retrieves the alternate Maxim Integrated Products part numbers or names.

A 'family' of MicroLAN devices may have more than one part number depending on packaging. There can also be nicknames such as "Crypto iButton".

Returns:
the alternate names for this iButton or 1-Wire device

Reimplemented from OneWireContainer.

boolean getChannelMask ( int  channel,
byte[]  register 
)

Retrieves the information if the channel is masked for the Conditional Search.

Parameters:
channelcurrent channel to set
registercurrent register for conditional search, which if returned from readRegister()
Returns:
true if the channel is masked and false other wise.
boolean getChannelPolarity ( int  channel,
byte[]  register 
)

Retrieves the polarity of the channel for the Conditional Search.

Parameters:
channelcurrent channel to set
registercurrent register for conditional search, which if returned from readRegister()
Returns:
true if the channel is masked and false other wise.
String getDescription ( )

Gets a short description of the function of this iButton or 1-Wire Device type.

Returns:
device description

Reimplemented from OneWireContainer.

boolean getLatchState ( int  channel,
byte[]  state 
)

Checks the latch state of the indicated channel.

Parameters:
channelchannel to execute this operation, in the range [0 to (getNumberChannels(byte[]) - 1)]
statecurrent state of the device returned from readDevice()
Returns:
true if channel latch is 'on' or conducting and false if channel latch is 'off' and not conducting. Note that the actual output when the latch is 'on' is returned from the isHighSideSwitch() method.
See also:
com.dalsemi.onewire.container.OneWireSensor.readDevice()
isHighSideSwitch()
setLatchState(int,boolean,boolean,byte[])

Implements SwitchContainer.

boolean getLevel ( int  channel,
byte[]  state 
)

Checks the sensed level on the indicated channel.

To avoid an exception, verify that this switch has level sensing with the hasLevelSensing(). Level sensing means that the device can sense the logic level on its PIO pin.

Parameters:
channelchannel to execute this operation, in the range [0 to (getNumberChannels(byte[]) - 1)]
statecurrent state of the device returned from readDevice()
Returns:
true if level sensed is 'high' and false if level sensed is 'low'
See also:
com.dalsemi.onewire.container.OneWireSensor.readDevice()
hasLevelSensing()

Implements SwitchContainer.

Enumeration getMemoryBanks ( )

Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank.

Returns:
Enumeration of memory banks

Reimplemented from OneWireContainer.

String getName ( )

Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String.

Returns:
iButton or 1-Wire device name

Reimplemented from OneWireContainer.

int getNumberChannels ( byte[]  state)

Gets the number of channels supported by this switch.

Channel specific methods will use a channel number specified by an integer from [0 to (getNumberChannels(byte[]) - 1)]. Note that all devices of the same family will not necessarily have the same number of channels.

Parameters:
statecurrent state of the device returned from readDevice()
Returns:
the number of channels for this device
See also:
com.dalsemi.onewire.container.OneWireSensor.readDevice()

Implements SwitchContainer.

boolean getSensedActivity ( int  channel,
byte[]  state 
) throws OneWireException

Checks if the indicated channel has experienced activity.

This occurs when the level on the PIO pins changes. To clear the activity that is reported, call clearActivity(). To avoid an exception, verify that this device supports activity sensing by calling the method hasActivitySensing().

Parameters:
channelchannel to execute this operation, in the range [0 to (getNumberChannels(byte[]) - 1)]
statecurrent state of the device returned from readDevice()
Returns:
true if activity was detected and false if no activity was detected
Exceptions:
OneWireExceptionif this device does not have activity sensing
See also:
hasActivitySensing()
clearActivity()

Implements SwitchContainer.

boolean hasActivitySensing ( )

Checks if the channels of this switch support activity sensing.

If this method returns true then the method getSensedActivity(int,byte[]) can be used.

Returns:
true if channels support activity sensing
See also:
getSensedActivity(int,byte[])
clearActivity()

Implements SwitchContainer.

boolean hasLevelSensing ( )

Checks if the channels of this switch support level sensing.

If this method returns true then the method getLevel(int,byte[]) can be used.

Returns:
true if channels support level sensing
See also:
getLevel(int,byte[])

Implements SwitchContainer.

boolean hasSmartOn ( )

Checks if the channels of this switch support 'smart on'.

Smart on is the ability to turn on a channel such that only 1-Wire device on this channel are awake and ready to do an operation. This greatly reduces the time to discover the device down a branch. If this method returns true then the method setLatchState(int,boolean,boolean,byte[]) can be used with the doSmart parameter true.

Returns:
true if channels support 'smart on'
See also:
setLatchState(int,boolean,boolean,byte[])

Implements SwitchContainer.

boolean isHighSideSwitch ( )

Checks if the channels of this switch are 'high side' switches.

This indicates that when 'on' or true, the switch output is connect to the 1-Wire data. If this method returns false then when the switch is 'on' or true, the switch is connected to ground.

Returns:
true if the switch is a 'high side' switch, false if the switch is a 'low side' switch
See also:
getLatchState(int,byte[])

Implements SwitchContainer.

boolean isVccPowered ( byte[]  register) throws OneWireIOException, OneWireException

Retrieves the state of the VCC pin.

If the pin is powered 'TRUE' is returned else 'FALSE' is returned if the pin is grounded.

Returns:
true if VCC is powered and false if it is grounded.
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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 onlySingleChannelOn ( )

Checks if the channels of this switch require that only one channel is on at any one time.

If this method returns true then the method setLatchState(int,boolean,boolean,byte[]) will not only affect the state of the given channel but may affect the state of the other channels as well to insure that only one channel is on at a time.

Returns:
true if only one channel can be on at a time.
See also:
setLatchState(int,boolean,boolean,byte[])

Implements SwitchContainer.

void orConditionalSearch ( byte[]  register)

Checks if the 'or' Condition Search is set and if not sets it.

Parameters:
registercurrent register for conditional search, which if returned from readRegister()
byte [] readDevice ( ) throws OneWireIOException, OneWireException

Retrieves the 1-Wire device sensor state.

This state is returned as a byte array. Pass this byte array to the 'get' and 'set' methods. If the device state needs to be changed then call the 'writeDevice' to finalize the changes.

Returns:
1-Wire device sensor state
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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

Implements OneWireSensor.

byte [] readRegister ( ) throws OneWireIOException, OneWireException

Retrieves the 1-Wire device register mask.

This register is returned as a byte array. Pass this byte array to the 'get' and 'set' methods. If the device register mask needs to be changed then call the 'writeRegister' to finalize the changes.

Returns:
1-Wire device register mask
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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
void setChannelMask ( int  channel,
boolean  set,
byte[]  register 
)

Sets the channel passed to the proper state depending on the set parameter for responding to the Conditional Search.

Parameters:
channelcurrent channel to set
setwhether to turn the channel on/off for Conditional Search
registercurrent register for conditional search, which if returned from readRegister()
void setChannelPolarity ( int  channel,
boolean  set,
byte[]  register 
)

Sets the channel passed to the proper state depending on the set parameter for the correct polarity in the Conditional Search.

Parameters:
channelcurrent channel to set
setwhether to turn the channel on/off for polarity Conditional Search
registercurrent register for conditional search, which if returned from readRegister()
void setConditionalSearchActivity ( byte[]  register)

Checks if the 'PIO Activity latches' are set for Conditional Search and if not sets it.

Parameters:
registercurrent register for conditional search, which if returned from readRegister()
void setConditionalSearchLogicLevel ( byte[]  register)

Checks if the 'PIO Level' Conditional Search is set for input and if not sets it.

Parameters:
pinActivityif true, the activity latch for the pin is used for the conditional search. Otherwise, the sensed level of the pin is used for the conditional search.
registercurrent register for conditional search, which if returned from readRegister()
void setLatchState ( byte  set,
byte[]  state 
)

Sets the latch state for all of the channels.

The method writeDevice() must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice().

Parameters:
setthe state to set all of the channels, in the range [0 to (getNumberChannels(byte[]) - 1)]
statecurrent state of the device returned from readDevice()
See also:
getLatchState(int,byte[])
com.dalsemi.onewire.container.OneWireSensor.writeDevice(byte[])
void setLatchState ( int  channel,
boolean  latchState,
boolean  doSmart,
byte[]  state 
)

Sets the latch state of the indicated channel.

The method writeDevice() must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice().

Parameters:
channelchannel to execute this operation, in the range [0 to (getNumberChannels(byte[]) - 1)]
latchStatetrue to set the channel latch 'on' (conducting) and false to set the channel latch 'off' (not conducting). Note that the actual output when the latch is 'on' is returned from the isHighSideSwitch() method.
doSmartIf latchState is 'on'/true then doSmart indicates if a 'smart on' is to be done. To avoid an exception check the capabilities of this device using the hasSmartOn() method.
statecurrent state of the device returned from readDevice()
See also:
hasSmartOn()
getLatchState(int,byte[])
com.dalsemi.onewire.container.OneWireSensor.writeDevice(byte[])

Implements SwitchContainer.

void writeDevice ( byte[]  state) throws OneWireIOException, OneWireException

Updates the latch state for the 2 general purpose PIO pins.

This has the side-effect of also sampling the PIO pins level after updating the latch, so the state buffer is updated with this new level information.

Parameters:
state1-Wire device sensor state
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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

Implements OneWireSensor.

void writeRegister ( byte[]  register) throws OneWireIOException, OneWireException

Writes the 1-Wire device register mask that have been changed by 'set' methods.

Parameters:
register1-Wire device sensor state
Exceptions:
OneWireIOExceptionon a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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

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