Class OneWireContainer27
- java.lang.Object
-
- com.dalsemi.onewire.container.OneWireContainer
-
- com.dalsemi.onewire.container.OneWireContainer24
-
- com.dalsemi.onewire.container.OneWireContainer27
-
- All Implemented Interfaces:
ClockContainer
,OneWireSensor
public class OneWireContainer27 extends OneWireContainer24 implements ClockContainer
1-Wire container for Real-Time Clock with Interrupt, DS2417. The DS2417 is similar to the DS2415 with the addition of a hardware interrupt pin. This container encapsulates the functionality of the iButton family type 27 (hex)
Features
- Real-Time Clock with fully compatible 1-Wire MicroLAN interface
- Programmable interrupt output for system wakeup
- Uses the same binary time/date representation as the DS2404 but with 1 second resolution
- Clock accuracy @htmlonly ± @endhtmlonly 2 minutes per month at 25@htmlonly °C @endhtmlonly
- Operating temperature range from -40@htmlonly °C @endhtmlonly to +85@htmlonly °C @endhtmlonly
- Low power, 200 nA typical with oscillator running
Clock
The clock methods can be organized into the following categories. Note that methods that are implemented for the
ClockContainer
interface are marked with (*):- Information
- Read
- Clock
- Misc
- Write
- Clock
- Misc
Usage
- See the usage example in
ClockContainer
for clock specific operations.
DataSheet
- See Also:
ClockContainer
-
-
Field Summary
Fields Modifier and Type Field Description static byte
INTERRUPT_INTERVAL_1
Passed to setInterruptInterval to set the interrupt interval to 1 second.static byte
INTERRUPT_INTERVAL_131072
Passed to setInterruptInterval to set the interrupt interval to 131072 seconds.static byte
INTERRUPT_INTERVAL_2048
Passed to setInterruptInterval to set the interrupt interval to 2048 seconds.static byte
INTERRUPT_INTERVAL_32
Passed to setInterruptInterval to set the interrupt interval to 32 seconds.static byte
INTERRUPT_INTERVAL_4
Passed to setInterruptInterval to set the interrupt interval to 4 seconds.static byte
INTERRUPT_INTERVAL_4096
Passed to setInterruptInterval to set the interrupt interval to 1 seconds.static byte
INTERRUPT_INTERVAL_64
Passed to setInterruptInterval to set the interrupt interval to 64 seconds.static byte
INTERRUPT_INTERVAL_65536
Passed to setInterruptInterval to set the interrupt interval to 65536 seconds.-
Fields inherited from class com.dalsemi.onewire.container.OneWireContainer24
CONTROL_OFFSET, READ_CLOCK_COMMAND, RTC_OFFSET, WRITE_CLOCK_COMMAND
-
Fields inherited from class com.dalsemi.onewire.container.OneWireContainer
adapter, address, speed, speedFallBackOK
-
-
Constructor Summary
Constructors Constructor Description OneWireContainer27()
Create an empty container that is not complete until after a call tosetupContainer
.OneWireContainer27(DSPortAdapter sourceAdapter, byte[] newAddress)
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.OneWireContainer27(DSPortAdapter sourceAdapter, long newAddress)
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.OneWireContainer27(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Create a container with the provided adapter instance 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()
Get the alternate Maxim Integrated Products part numbers or names.java.lang.String
getDescription()
Get a short description of the function of this iButton or 1-Wire Device type.long
getInterruptInterval(byte[] state)
Returns the interval, in seconds, that the device will interrupt on.java.lang.String
getName()
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as a string.boolean
isInterruptEnabled(byte[] state)
Checks to see if interrupt mode is turned on.void
setInterruptEnable(boolean iEnable, byte[] state)
Enables or disables hardware interrupting.void
setInterruptInterval(byte intervalValue, byte[] state)
Sets the interval at which interrupting will occur.-
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer24
canDisableClock, getClock, getClockAlarm, getClockResolution, hasClockAlarm, isClockAlarmEnabled, isClockAlarming, isClockRunning, readDevice, setClock, setClockAlarm, setClockAlarmEnable, setClockRunEnable, writeDevice
-
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer
doSpeed, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMaxSpeed, getMemoryBanks, hashCode, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.dalsemi.onewire.container.ClockContainer
canDisableClock, getClock, getClockAlarm, getClockResolution, hasClockAlarm, isClockAlarmEnabled, isClockAlarming, isClockRunning, setClock, setClockAlarm, setClockAlarmEnable, setClockRunEnable
-
Methods inherited from interface com.dalsemi.onewire.container.OneWireSensor
readDevice, writeDevice
-
-
-
-
Field Detail
-
INTERRUPT_INTERVAL_1
public static final byte INTERRUPT_INTERVAL_1
Passed to setInterruptInterval to set the interrupt interval to 1 second.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_4
public static final byte INTERRUPT_INTERVAL_4
Passed to setInterruptInterval to set the interrupt interval to 4 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_32
public static final byte INTERRUPT_INTERVAL_32
Passed to setInterruptInterval to set the interrupt interval to 32 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_64
public static final byte INTERRUPT_INTERVAL_64
Passed to setInterruptInterval to set the interrupt interval to 64 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_2048
public static final byte INTERRUPT_INTERVAL_2048
Passed to setInterruptInterval to set the interrupt interval to 2048 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_4096
public static final byte INTERRUPT_INTERVAL_4096
Passed to setInterruptInterval to set the interrupt interval to 1 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_65536
public static final byte INTERRUPT_INTERVAL_65536
Passed to setInterruptInterval to set the interrupt interval to 65536 seconds.- See Also:
- Constant Field Values
-
INTERRUPT_INTERVAL_131072
public static final byte INTERRUPT_INTERVAL_131072
Passed to setInterruptInterval to set the interrupt interval to 131072 seconds.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OneWireContainer27
public OneWireContainer27()
Create an empty container that is not complete until after a call tosetupContainer
.This is one of the methods to construct a container. The others are through creating a OneWireContainer with parameters.
- See Also:
super.setupContainer()
-
OneWireContainer27
public OneWireContainer27(DSPortAdapter sourceAdapter, byte[] newAddress)
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
- Parameters:
sourceAdapter
- adapter instance used to communicate with this iButtonnewAddress
-Address
of this 1-Wire device- See Also:
OneWireContainer27
,utils.Address
-
OneWireContainer27
public OneWireContainer27(DSPortAdapter sourceAdapter, long newAddress)
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
- Parameters:
sourceAdapter
- adapter instance used to communicate with this 1-Wire devicenewAddress
-Address
of this 1-Wire device- See Also:
OneWireContainer27
,utils.Address
-
OneWireContainer27
public OneWireContainer27(DSPortAdapter sourceAdapter, java.lang.String newAddress)
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
- Parameters:
sourceAdapter
- adapter instance used to communicate with this 1-Wire devicenewAddress
-Address
of this 1-Wire device- See Also:
OneWireContainer27
,utils.Address
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as a string. For example 'DS1992'.- Overrides:
getName
in classOneWireContainer24
- Returns:
- iButton or 1-Wire device name
-
getAlternateNames
public java.lang.String getAlternateNames()
Get the alternate Maxim Integrated Products part numbers or names. A 'family' of 1-Wire Network devices may have more than one part number depending on packaging. There can also be nicknames such as 'Crypto iButton'.- Overrides:
getAlternateNames
in classOneWireContainer24
- Returns:
- 1-Wire device alternate names
-
getDescription
public java.lang.String getDescription()
Get a short description of the function of this iButton or 1-Wire Device type.- Overrides:
getDescription
in classOneWireContainer24
- Returns:
- device description
-
getInterruptInterval
public long getInterruptInterval(byte[] state)
Returns the interval, in seconds, that the device will interrupt on.- Parameters:
state
- current state of the device returned fromreadDevice()
- Returns:
- number of seconds in between interrupts.
- See Also:
OneWireSensor.writeDevice(byte[])
,OneWireContainer24.getClock(byte[])
-
isInterruptEnabled
public boolean isInterruptEnabled(byte[] state)
Checks to see if interrupt mode is turned on. If so, pulses will be generated at an interval selected by setInterruptInterval.- Parameters:
state
- current state of the device returned fromreadDevice()
- Returns:
- true if interrupts are enabled
- See Also:
OneWireSensor.readDevice()
,OneWireContainer24.canDisableClock()
,OneWireContainer24.setClockRunEnable(boolean,byte[])
-
setInterruptInterval
public void setInterruptInterval(byte intervalValue, byte[] state)
Sets the interval at which interrupting will occur. Note that this feature must be enabled first using setInterruptEnable(true,state). The methodwriteDevice(byte[])
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call towriteDevice(byte[])
.- Parameters:
intervalValue
- One of the following variables should be passed, representing different time intervals to interrupt at:INTERRUPT_INTERVAL_1
1 secondINTERRUPT_INTERVAL_4
4 secondsINTERRUPT_INTERVAL_32
32 secondsINTERRUPT_INTERVAL_32
64 secondsINTERRUPT_INTERVAL_64
2048 secondsINTERRUPT_INTERVAL_2048
4096 secondsINTERRUPT_INTERVAL_4096
65536 secondsINTERRUPT_INTERVAL_131072
131072 secondsstate
- current state of the device returned fromreadDevice()
- See Also:
OneWireSensor.writeDevice(byte[])
,OneWireContainer24.getClock(byte[])
-
setInterruptEnable
public void setInterruptEnable(boolean iEnable, byte[] state)
Enables or disables hardware interrupting. If enabled, the device sends an interrupt at intervals defined by using the setInterruptInterval function.- Parameters:
runEnable
- true to enable interval interrupts.state
- current state of the device returned fromreadDevice()
- See Also:
OneWireSensor.writeDevice(byte[])
,OneWireContainer24.canDisableClock()
,OneWireContainer24.isClockRunning(byte[])
-
-