w1_ds2413.rst 1.8 KB

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