Class OneWireContainer26

java.lang.Object
com.dalsemi.onewire.container.OneWireContainer
com.dalsemi.onewire.container.OneWireContainer26
All Implemented Interfaces:
ADContainer, ClockContainer, HumidityContainer, OneWireSensor, TemperatureContainer

public class OneWireContainer26 extends OneWireContainer implements ADContainer, TemperatureContainer, ClockContainer, HumidityContainer

1-Wire® container that encapsulates the functionality of the 1-Wire family type 26 (hex), Maxim Integrated Products part number: DS2438, Smart Battery Monitor.

Features

  • direct-to-digital temperature sensor
  • A/D converters which measures the battery voltage and current
  • integrated current accumulator which keeps a running total of all current going into and out of the battery
  • elapsed time meter
  • 40 bytes of nonvolatile EEPROM memory for storage of important parameters
  • Operating temperature range from -40@htmlonly invalid input: '&#176'C @endhtmlonly to +85@htmlonly invalid input: '&#176'C @endhtmlonlyi

Note

Sometimes the VAD input will report 10.23 V even if nothing is attached. This value is also the maximum voltage that part can report.

DataSheet

http://pdfserv.maxim-ic.com/arpdf/DS2438.pdf (not active yet, Sep-06-2001)
http://www.ibutton.com/weather/humidity.html
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    Flag to set/check the voltage A/D Input Select Bit with setFlag/getFlag When this bit is true the battery input is (VDD) is selected as input for the voltage A/D input.
    static final byte
    Flag to check whether or not the A/D converter is busy using getFlag().
    static final byte
    Flag to set/check the Current Accumulator bit with setFlag/getFlag.
    static final int
    Channel selector for the VAD input.
    static final int
    Channel selector for the VDD input.
    static final int
    Channel selectro the the IAD input.
    static final byte
    Flag to set/check the Current Accumulator Shadow Selector bit with setFlag/getFlag.
    static final byte
    Flag to set/check the Current A/D Control bit with setFlag/getFlag.
    static final byte
    Flag to check whether or not an operation is being performed on the nonvolatile memory using getFlag.
    static final byte
    Flag to check whether or not a temperature conversion is in progress using getFlag().

    Fields inherited from class com.dalsemi.onewire.container.OneWireContainer

    adapter, address, speed, speedFallBackOK

    Fields inherited from interface com.dalsemi.onewire.container.ADContainer

    ALARM_HIGH, ALARM_LOW

    Fields inherited from interface com.dalsemi.onewire.container.HumidityContainer

    ALARM_HIGH, ALARM_LOW

    Fields inherited from interface com.dalsemi.onewire.container.TemperatureContainer

    ALARM_HIGH, ALARM_LOW
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
    OneWireContainer26(DSPortAdapter sourceAdapter, byte[] newAddress)
    Create a container with a provided adapter object and the address of the 1-Wire device.
    OneWireContainer26(DSPortAdapter sourceAdapter, long newAddress)
    Create a container with a provided adapter object and the address of the 1-Wire device.
    OneWireContainer26(DSPortAdapter sourceAdapter, String newAddress)
    Create a container with a provided adapter object and the address of the 1-Wire device.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Calibrate the current ADC.
    boolean
    Query to see if this A/D supports doing multiple voltage conversions at the same time.
    boolean
    Query to see if the clock can be disabled.
    void
    doADConvert(boolean[] doConvert, byte[] state)
    This method is used to perform voltage conversion on all specified channels.
    void
    doADConvert(int channel, byte[] state)
    This method is used to perform voltage conversion on all specified channels.
    void
    doHumidityConvert(byte[] state)
    Performs a Humidity conversion.
    void
    doTemperatureConvert(byte[] state)
    Perform an temperature conversion.
    double
    getADAlarm(int channel, int alarmType, byte[] state)
    This method is used to extract the alarm voltage value of the specified channel from the provided state buffer.
    boolean
    getADAlarmEnable(int channel, int alarmType, byte[] state)
    This method is used to extract the alarm enable value of the specified channel from the provided state buffer.
    double
    getADRange(int channel, byte[] state)
    This method is used to extract the input voltage range of the specified channel from the provided state buffer.
    double[]
    getADRanges(int channel)
    Query to get an array of available ranges for the specified A/D channel.
    double
    getADResolution(int channel, byte[] state)
    This method is used to extract the conversion resolution of the specified channel from the provided state buffer expressed in volts.
    double[]
    getADResolutions(int channel, double range)
    Query to get an array of available resolutions based on the specified range on the specified A/D channel.
    double[]
    getADVoltage(byte[] state)
    This method is used to read the voltage values.
    double
    getADVoltage(int channel, byte[] state)
    This method is used to read a channels voltage value.
    Return the alternate Maxim Integrated Products part number or name.
    int
    Retrieves the current CCA value in mVHr.
    long
    getClock(byte[] state)
    This method extracts the Clock Value in milliseconds from the state data retrieved from the readDevice() method.
    long
    getClockAlarm(byte[] state)
    This method extracts the Clock Alarm Value from the provided state data retrieved from the readDevice() method.
    long
    Query to get the clock resolution in milliseconds
    double
    getCurrent(byte[] state)
    Get the instantaneous current.
    int
    Retrieves the value of the DCA in mVHr.
    Return a short description of the function of this 1-Wire device type.
    long
    getDisconnectTime(byte[] state)
    This method extracts the Clock Value in milliseconds from the state data retrieved from the readDevice() method.
    long
    getEndOfChargeTime(byte[] state)
    This method extracts the Clock Value in milliseconds from the state data retrieved from the readDevice() method.
    boolean
    getFlag(byte flagToGet)
    Checks the specified flag in the status/configuration register and returns its status as a boolean.
    double
    getHumidity(byte[] state)
    Gets the humidity expressed as a percent value (0.0 to 100.0) of humidity.
    double
    getHumidityAlarm(int alarmType, byte[] state)
    Gets the specified Humidity alarm value in percent from the state data retrieved from the readDevice() method.
    double
    Gets the Humidity alarm resolution in percent.
    double
    getHumidityResolution(byte[] state)
    Gets the current Humidity resolution in percent from the state data retrieved from the readDevice() method.
    double[]
    Get an array of available Humidity resolutions in percent humidity (0 to 100).
    int
    Retrieves the current ICA value in mVHr.
    double
    Query to get the maximum temperature in degrees C.
    Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank.
    double
    Query to get the minimum temperature in degrees C.
    Returns the Maxim Integrated Products part number of this 1-Wire device as a string.
    int
    Query to get the number of channels supported by this A/D.
    double
    Calculate the remaining capacity in mAH as outlined in the data sheet.
    double
    Get the value used for the sense resistor in the getCurrent() calculations.
    double
    getTemperature(byte[] state)
    This method extracts the Temperature Value in degrees C from the state data retrieved from the readDevice() method.
    double
    getTemperatureAlarm(int alarmType, byte[] state)
    This method extracts the specified Alarm value in degrees C from the state data retrieved from the readDevice() method.
    double
    Query to get the high/low resolution in degrees C.
    double
    This method extracts the current resolution in degrees C from the state data retrieved from the readDevice() method.
    double[]
    Query to get an array of available resolutions in degrees C.
    boolean
    hasADAlarmed(int channel, int alarmType, byte[] state)
    This method is used to check the alarm event value of the specified channel from the provided state buffer.
    boolean
    Query to see if this A/D measuring device has high/low alarms.
    boolean
    Query to see if the clock has an alarm feature.
    boolean
    Checks to see if this Humidity measuring device has high/low trip alarms.
    boolean
    Checks to see if this device has selectable Humidity resolution.
    boolean
    Query to see if this device has selectable resolution.
    boolean
    Query to see if this temperature measuring device has high/low trip alarms.
    boolean
    isCharging(byte[] state)
    Determines if the battery is charging and returns a boolean.
    boolean
    isClockAlarmEnabled(byte[] state)
    This method checks if the Clock Alarm is enabled from the provided state data retrieved from the readDevice() method.
    boolean
    isClockAlarming(byte[] state)
    This method checks if the Clock Alarm flag has been set from the state data retrieved from the readDevice() method.
    boolean
    isClockRunning(byte[] state)
    This method checks if the device's oscillator is enabled.
    boolean
    Checks to see if humidity value given is a 'relative' humidity value.
    byte[]
    This method retrieves the 1-Wire device sensor state.
    byte[]
    readPage(int page)
    Reads the specified 8 byte page and returns the data in an array.
    void
    setADAlarm(int channel, int alarmType, double alarm, byte[] state)
    This method is used to set the alarm voltage value of the specified channel in the provided state buffer.
    void
    setADAlarmEnable(int channel, int alarmType, boolean alarmEnable, byte[] state)
    This method is used to set the alarm enable value of the specified channel in the provided state buffer.
    void
    setADRange(int channel, double range, byte[] state)
    This method is used to set the input range for the specified channel in the provided state buffer.
    void
    setADResolution(int channel, double resolution, byte[] state)
    This method is used to set the conversion resolution value for the specified channel in the provided state buffer.
    void
    setCCA(int ccaValue)
    Set the value of the CCA.
    void
    setClock(long time, byte[] state)
    This method sets the Clock time in the provided state data Use the method writeDevice() with this data to finalize the change to the device.
    void
    setClockAlarm(long time, byte[] state)
    This method sets the Clock Alarm in the provided state data.
    void
    setClockAlarmEnable(boolean alarmEnable, byte[] state)
    This method sets the Clock Alarm enable.
    void
    setClockRunEnable(boolean runEnable, byte[] state)
    This method sets the oscillator enable to the specified value.
    void
    setDCA(int dcaValue)
    Set the value of the DCA.
    void
    setFlag(byte flagToSet, boolean flagValue)
    Set one of the flags in the STATUS/CONFIGURATION register.
    void
    setHumidityAlarm(int alarmType, double alarmValue, byte[] state)
    Sets the Humidity alarm value in percent in the provided state data.
    void
    setHumidityResolution(double resolution, byte[] state)
    Sets the current Humidity resolution in percent in the provided state data.
    void
    setICA(int icaValue)
    Set the value of the ICA.
    void
    setSenseResistor(double resistance)
    Set the value of the sense resistor used to determine battery current.
    void
    setSpeedCheck(boolean doSpeedCheck)
    Directs the container to avoid the calls to doSpeed() in methods that communicate with the Thermocron.
    void
    setTemperatureAlarm(int alarmType, double alarmValue, byte[] state)
    This method sets the alarm value in degrees C in the provided state data.
    void
    setTemperatureResolution(double resolution, byte[] state)
    This method sets the current resolution in degrees C in the provided state data.
    void
    setThreshold(byte thresholdValue)
    Set the minimum current measurement magnitude for which the ICA/CCA/DCA are incremented.
    void
    writeDevice(byte[] state)
    This method write the 1-Wire device sensor state that have been changed by the 'set' methods.
    void
    writePage(int page, byte[] source, int offset)
    Writes a page of memory to this device.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait