w1_ds2413 1.5 KB

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