0001 =======================
0002 Kernel driver w1_ds2413
0003 =======================
0004
0005 Supported chips:
0006
0007 * Maxim DS2413 1-Wire Dual Channel Addressable Switch
0008
0009 supported family codes:
0010
0011 ================ ====
0012 W1_FAMILY_DS2413 0x3A
0013 ================ ====
0014
0015 Author: Mariusz Bialonczyk <manio@skyboo.net>
0016
0017 Description
0018 -----------
0019
0020 The DS2413 chip has two open-drain outputs (PIO A and PIO B).
0021 Support is provided through the sysfs files "output" and "state".
0022
0023 Reading state
0024 -------------
0025 The "state" file provides one-byte value which is in the same format as for
0026 the chip PIO_ACCESS_READ command (refer the datasheet for details):
0027
0028 ======== =============================================================
0029 Bit 0: PIOA Pin State
0030 Bit 1: PIOA Output Latch State
0031 Bit 2: PIOB Pin State
0032 Bit 3: PIOB Output Latch State
0033 Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
0034 ======== =============================================================
0035
0036 This file is readonly.
0037
0038 Writing output
0039 --------------
0040 You can set the PIO pins using the "output" file.
0041 It is writable, you can write one-byte value to this sysfs file.
0042 Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
0043
0044 ======== ======================================
0045 Bit 0: PIOA
0046 Bit 1: PIOB
0047 Bit 2-7: No matter (driver will set it to "1"s)
0048 ======== ======================================
0049
0050
0051 The chip has some kind of basic protection against transmission errors.
0052 When reading the state, there is a four complement bits.
0053 The driver is checking this complement, and when it is wrong then it is
0054 returning I/O error.
0055
0056 When writing output, the master must repeat the PIO Output Data byte in
0057 its inverted form and it is waiting for a confirmation.
0058 If the write is unsuccessful for three times, the write also returns
0059 I/O error.