pca9539 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Kernel driver pca9539
  2. =====================
  3. Supported chips:
  4. * Philips PCA9539
  5. Prefix: 'pca9539'
  6. Addresses scanned: 0x74 - 0x77
  7. Datasheet:
  8. http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf
  9. Author: Ben Gardner <bgardner@wabtec.com>
  10. Description
  11. -----------
  12. The Philips PCA9539 is a 16 bit low power I/O device.
  13. All 16 lines can be individually configured as an input or output.
  14. The input sense can also be inverted.
  15. The 16 lines are split between two bytes.
  16. Sysfs entries
  17. -------------
  18. Each is a byte that maps to the 8 I/O bits.
  19. A '0' suffix is for bits 0-7, while '1' is for bits 8-15.
  20. input[01] - read the current value
  21. output[01] - sets the output value
  22. direction[01] - direction of each bit: 1=input, 0=output
  23. invert[01] - toggle the input bit sense
  24. input reads the actual state of the line and is always available.
  25. The direction defaults to input for all channels.
  26. General Remarks
  27. ---------------
  28. Note that each output, direction, and invert entry controls 8 lines.
  29. You should use the read, modify, write sequence.
  30. For example. to set output bit 0 of 1.
  31. val=$(cat output0)
  32. val=$(( $val | 1 ))
  33. echo $val > output0