Based on kernel version 4.16.1. Page generated on 2018-04-09 11:53 EST.
1 Kernel driver w1_ds2413 2 ======================= 3 4 Supported chips: 5 * Maxim DS2413 1-Wire Dual Channel Addressable Switch 6 7 supported family codes: 8 W1_FAMILY_DS2413 0x3A 9 10 Author: Mariusz Bialonczyk <manio@skyboo.net> 11 12 Description 13 ----------- 14 15 The DS2413 chip has two open-drain outputs (PIO A and PIO B). 16 Support is provided through the sysfs files "output" and "state". 17 18 Reading state 19 ------------- 20 The "state" file provides one-byte value which is in the same format as for 21 the chip PIO_ACCESS_READ command (refer the datasheet for details): 22 23 Bit 0: PIOA Pin State 24 Bit 1: PIOA Output Latch State 25 Bit 2: PIOB Pin State 26 Bit 3: PIOB Output Latch State 27 Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) 28 29 This file is readonly. 30 31 Writing output 32 -------------- 33 You can set the PIO pins using the "output" file. 34 It is writable, you can write one-byte value to this sysfs file. 35 Similarly the byte format is the same as for the PIO_ACCESS_WRITE command: 36 37 Bit 0: PIOA 38 Bit 1: PIOB 39 Bit 2-7: No matter (driver will set it to "1"s) 40 41 42 The chip has some kind of basic protection against transmission errors. 43 When reading the state, there is a four complement bits. 44 The driver is checking this complement, and when it is wrong then it is 45 returning I/O error. 46 47 When writing output, the master must repeat the PIO Output Data byte in 48 its inverted form and it is waiting for a confirmation. 49 If the write is unsuccessful for three times, the write also returns 50 I/O error.