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