^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Kernel driver w1_ds2438
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Maxim DS2438 Smart Battery Monitor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) supported family codes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) ================ ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) W1_FAMILY_DS2438 0x26
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ================ ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Author: Mariusz Bialonczyk <manio@skyboo.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) The DS2438 chip provides several functions that are desirable to carry in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) a battery pack. It also has a 40 bytes of nonvolatile EEPROM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Because the ability of temperature, current and voltage measurement, the chip
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) is also often used in weather stations and applications such as: rain gauge,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) wind speed/direction measuring, humidity sensing, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Current support is provided through the following sysfs files (all files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) except "iad" are readonly):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) "iad"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) -----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) This file controls the 'Current A/D Control Bit' (IAD) in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Status/Configuration Register.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Writing a zero value will clear the IAD bit and disables the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) measurements.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Writing value "1" is setting the IAD bit (enables the measurements).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) The IAD bit is enabled by default in the DS2438.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) When writing to sysfs file bits 2-7 are ignored, so it's safe to write ASCII.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) An I/O error is returned when there is a problem setting the new value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) "page0"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) This file provides full 8 bytes of the chip Page 0 (00h).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) This page contains the most frequently accessed information of the DS2438.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Internally when this file is read, the additional CRC byte is also obtained
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) from the slave device. If it is correct, the 8 bytes page data are passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) to userspace, otherwise an I/O error is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) "temperature"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Opening and reading this file initiates the CONVERT_T (temperature conversion)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) command of the chip, afterwards the temperature is read from the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) registers and provided as an ASCII decimal value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Important: The returned value has to be divided by 256 to get a real
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) temperature in degrees Celsius.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) "vad", "vdd"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) Opening and reading this file initiates the CONVERT_V (voltage conversion)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) command of the chip.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) Depending on a sysfs filename a different input for the A/D will be selected:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) vad:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) general purpose A/D input (VAD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) vdd:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) battery input (VDD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) After the voltage conversion the value is returned as decimal ASCII.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Note: To get a volts the value has to be divided by 100.