pca9539 1.3 KB

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