0001 Kernel driver w1_ds2438
0002 =======================
0003
0004 Supported chips:
0005
0006 * Maxim DS2438 Smart Battery Monitor
0007
0008 supported family codes:
0009 ================ ====
0010 W1_FAMILY_DS2438 0x26
0011 ================ ====
0012
0013 Author: Mariusz Bialonczyk <manio@skyboo.net>
0014
0015 Description
0016 -----------
0017
0018 The DS2438 chip provides several functions that are desirable to carry in
0019 a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
0020 Because the ability of temperature, current and voltage measurement, the chip
0021 is also often used in weather stations and applications such as: rain gauge,
0022 wind speed/direction measuring, humidity sensing, etc.
0023
0024 Current support is provided through the following sysfs files (all files
0025 except "iad" and "offset" are readonly):
0026
0027 "iad"
0028 -----
0029 This file controls the 'Current A/D Control Bit' (IAD) in the
0030 Status/Configuration Register.
0031 Writing a zero value will clear the IAD bit and disables the current
0032 measurements.
0033 Writing value "1" is setting the IAD bit (enables the measurements).
0034 The IAD bit is enabled by default in the DS2438.
0035
0036 When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
0037 An I/O error is returned when there is a problem setting the new value.
0038
0039 "page0"
0040 -------
0041 This file provides full 8 bytes of the chip Page 0 (00h).
0042 This page contains the most frequently accessed information of the DS2438.
0043 Internally when this file is read, the additional CRC byte is also obtained
0044 from the slave device. If it is correct, the 8 bytes page data are passed
0045 to userspace, otherwise an I/O error is returned.
0046
0047 "page1"
0048 -------
0049 This file provides full 8 bytes of the chip Page 1 (01h).
0050 This page contains the ICA, elapsed time meter and current offset data of the DS2438.
0051 Internally when this file is read, the additional CRC byte is also obtained
0052 from the slave device. If it is correct, the 8 bytes page data are passed
0053 to userspace, otherwise an I/O error is returned.
0054
0055 "offset"
0056 --------
0057 This file controls the 2-byte Offset Register of the chip.
0058 Writing a 2-byte value will change the Offset Register, which changes the
0059 current measurement done by the chip. Changing this register to the two's complement
0060 of the current register while forcing zero current through the load will calibrate
0061 the chip, canceling offset errors in the current ADC.
0062
0063
0064 "temperature"
0065 -------------
0066 Opening and reading this file initiates the CONVERT_T (temperature conversion)
0067 command of the chip, afterwards the temperature is read from the device
0068 registers and provided as an ASCII decimal value.
0069
0070 Important: The returned value has to be divided by 256 to get a real
0071 temperature in degrees Celsius.
0072
0073 "vad", "vdd"
0074 ------------
0075 Opening and reading this file initiates the CONVERT_V (voltage conversion)
0076 command of the chip.
0077
0078 Depending on a sysfs filename a different input for the A/D will be selected:
0079
0080 vad:
0081 general purpose A/D input (VAD)
0082 vdd:
0083 battery input (VDD)
0084
0085 After the voltage conversion the value is returned as decimal ASCII.
0086 Note: To get a volts the value has to be divided by 100.