1 Wire Software Resource Guide Device Description - kr1spyK/DS1991SecureViewer GitHub Wiki
Abstract: There are over 30 different 1-Wire® devices, including iButton® devices, that Maxim currently produces. Navigating the available APIs, software examples, and other resources to communicate with this array of devices or finding the correct resource for a single device type can be a daunting task. This document provides an overview of the available resources and a selection guide. The current 1-Wire devices are also presented in a convenient table, providing device descriptions and family code lookup.
Available APIs include TMEX (an API for Microsoft Windows®), 1-Wire Public Domain Kit (a cross-platform API), the 1-Wire API for Java™ (OWAPI) and its variant 1-Wire API for .NET (OW.NET), and 1-Wire API for .NET Compact (OW.NET.Compact). All of the APIs described in this document are free to use without restriction and, in most cases, include the complete source code.
The 1-Wire API for Java was designed from the ground up to be a very robust, highly object-oriented foundation for building 1-Wire applications in Java. It extends the ability of programmers to develop portable, cross-platform software and shortens the time to market for their 1-Wire integrated products.
The API consists of many Java classes and interfaces. One special group of Java classes in the 1-Wire API is the container (class OneWireContainer). Support for particular 1-Wire devices, including iButtons, is provided through containers. The API has over 30 different container types, representing most 1-Wire devices. Each container encapsulates and implements the functionality of an individual device.
A container interacts with a 1-Wire device through a 1-Wire adapter class that represents a physical 1-Wire adapter (class DSPortAdapter). The instance of the adapter is produced from the provider class (class OneWireAccessProvider). The actual implementations of the 1-Wire adapters vary from platform to platform, but they all have the same interface. Some platforms use native drivers, but most at least support the DS9097U-XXX serial adapters using RXTX (a cross-platform serial COM port API). This API is available from RXTX's GitHub page.
The 1-Wire API for Java Software Development Kit is available on the iButton web site. Like the 1-Wire PD Kit, the complete Java source to OWAPI is provided under a public-domain-style license.
Figure 8 shows the methods provided by the base OWAPI classes. The class or package is displayed in bold. Note that, because each container has high level methods to manipulate each device type, the LINK level methods in the adapter are not usually called directly.
com.dalsemi.onewire.adapter.DSPortAdapter
beginExclusive - Acquires exclusive use of the 1-Wire net.
endExclusive - Releases the exclusive lock on the 1-Wire net.
com.dalsemi.onewire.adapter.DSPortAdapter
canBreak - Checks if a 1-Wire 'break' (long low) operation is supported by the adapter.
canDeliverPower - Checks if 'strong-pullup' power delivery is supported by the adapter.
canDeliverSmartPower - Checks if 'smart' power delivery is supported by the adapter. 'Smart' power delivery is the ability to sense when power consumption has reduced and automatically stop the power delivery.
canFlex - Checks if flexible long-line communication timing is supported by the adapter.
canHyperdrive - Checks if hyperdrive communication speed is supported by the adapter.
canOverdrive - Checks if overdrive communication speed is supported by the adapter.
canProgram - Checks if 12V EPROM programming voltage is supported by the adapter.
dataBlock - Sends and receives a block of data to the 1-Wire net.
getBit - Reads a single bit from the 1-Wire net.
getBlock - Reads a block from the 1-Wire net by sending all (0xFF)s.
getByte - Reads a byte from the 1-Wire net by sending all 1's (0xFF).
getSpeed - Reads the current 1-Wire communication speed.
putBit - Writes a bit to the 1-Wire net.
putByte - Writes a byte to the 1-Wire net and verifies the echo is correct.
reset - Resets all of the 1-Wire net devices.
setPowerDuration - Sets the power delivery duration.
setPowerNormal - Turns off the power delivery.
setProgramPulseDuration - Sets the program pulse duration.
setSpeed - Sets the 1-Wire communication speed.
startBreak - Starts a break (low) on the 1-Wire net.
startPowerDelivery - Starts the power delivery.
startProgramPulse - Starts the program pulse.
com.dalsemi.onewire.adapter.DSPortAdapter
excludeFamily - Excludes a family group from the search.
findFirstDevice - Finds the first device on the 1-Wire net without auto container creation.
findNextDevice - Finds the next device on the 1-Wire net without auto container creation.
getAllDeviceContainers - Searches and finds all devices on the 1-Wire net with containers.
getDeviceContainer - Gets a device container for the 'current' device found.
getFirstDeviceContainer - Finds the first device and create a container for it.
getNextDeviceContainer - Finds the next device and create a container for it.
setNoResetSearch - Sets the 1-Wire net search to not issue a 1-Wire reset.
setSearchAllDevices - Sets the 1-Wire net search to include all devices (remove alarm-only).
setSearchOnlyAlarmingDevices - Sets the 1-Wire net search to only include alarming devices.
targetAllFamilies - Sets the 1-Wire net search to include all devices (remove exclusions).
targetFamily - Targets a particular family group in the 1-Wire net search.
(also in com.dalsemi.onewire.container.*)
isAlarming - Checks to see if the device is in an alarm state.
isPresent - Checks to see if the device is present on the 1-Wire net.
select - Selects the 1-Wire net device to ready it for a device-specific operation command.
com.dalsemi.onewire.container.MemoryBank
getBankDescription - Returns a text description of the memory bank.
getSize - Gets the size of the memory bank in bytes.
getStartPhysicalAddress - Gets the starting physical address of the memory bank.
isGeneralPurposeMemory - Checks if the memory bank is general purpose (not memory mapped).
isNonVolatile - Checks if the memory bank is nonvolatile.
isReadOnly - Checks if the memory bank is read-only.
isReadWrite - Checks if the memory bank is read and write capable.
isWriteOnce - Checks if the memory bank is write once, such as EPROM.
needsPowerDelivery - Checks if this memory bank requires power delivery to write.
needsProgramPulse - Checks if this memory bank requires program pulse to write.
read - Reads the memory bank without interpretation (no packet structure).
setWriteVerification - Sets the API to do an extra verification after writes.
write - Writes the memory bank raw (no packet structure).
com.dalsemi.onewire.container.PagedMemoryBank
getExtraInfoDescription - Gets a description of extra information associated with this bank.
getExtraInfoLength - Gets the length in bytes of the extra information in each page.
getMaxPacketDataLength - Gets the maximum length of data that can be contained in the 'packet' structure that will fit in each page of this memory bank.
getNumberPages - Gets the number of pages in this memory bank.
getPageLength - Gets the length in byte of the raw page in this memory bank.
hasExtraInfo - Checks if this memory bank has extra information associated with each page.
hasPageAutoCRC - Checks if the pages in this memory bank have CRC verification that is supplied by the device.
readPage - Reads a page from the memory bank.
readPageCRC - Reads a page from the memory bank utilizing the device-generated CRC.
readPagePacket - Reads a packet structure from a page in the memory bank.
writePagePacket - Writes a packet structure to a page in the memory bank.
com.dalsemi.onewire.container.OTPMemoryBank
canLockPage - Checks if the pages in the memory bank can be locked from further writes.
canLockRedirectPage - Checks to see if the redirection facilities in the memory bank can be locked to prevent further redirection.
canRedirectPage - Checks to see if the memory bank can have pages redirected as a way to update write-once pages.
getRedirectedPage - Gets the page number that a page is redirected to.
isPageLocked - Checks if the page is locked from further writes.
isRedirectPageLocked - Checks if the page is locked from further redirection.
lockPage - Locks a page.
lockRedirectPage - Locks the page from being redirected.
redirectPage - Redirects a page to a new page. This is used to update a write-once device.
com.dalsemi.onewire.utils.OWFile
Same methods in java.io.File (for version 1.2 of the JDK) plus the following extra methods:
close - Closes the file and releases any resources associated with it.
format - Formats the 1-Wire File System associated with the device(s) provided to this OWFile.
getFD - Gets a OWFileDescriptor for this file so the file can be synchronized with the device.
getFreeMemory - Gets the available free memory in the 1-Wire File System.
getLocalPage - Gets a memory bank local page reference from the 1-Wire File System page.
getMemoryBankForPage - Gets the memory bank instance that can be used to read/write the provided 1-Wire File System page.
getOneWireContainer - Gets the container(s) that make up the file system.
getPageList - Gets a list of 1-Wire File System pages that comprise the file.
com.dalsemi.onewire.utils.OWFileDescriptor
Same methods as in java.io.FileDescriptor (for version 1.2 of the JDK).
com.dalsemi.onewire.utils.OWFileOutputStream
Same methods as in java.io.FileOutputStream (for version 1.2 of the JDK).
com.dalsemi.onewire.utils.OWFileInputStream
Same methods as in java.io.FileInputStream (for version 1.2 of the JDK).
com.dalsemi.onewire.container.*
Over 30 different device-specific container implementations including six different sensor-type interfaces:
ADContainer - Analog-to-digital converter
ClockContainer - Clock
SwitchContainer - Switch
TemperatureContainer - Temperature sensor
PotentiometerContainer - Digital potentiometer
HumidityContainer - Humidity sensor
MissionContainer - For missioning temperature and humidity loggers
OneWireSensor - 1-Wire sensors
PasswordContainer - Password-protected memory
com.dalsemi.onewire.application.*
SHA and 1-Wire tagging utility classes.
Figure 8. OWAPI functions.
© Maxim Integrated Products, Inc. (2008). 1-Wire Software Resource Guide Device Description. AN155. https://www.maximintegrated.com/en/design/technical-documents/app-notes/1/155.html