pca9539 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: none
  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. Detection
  19. ---------
  20. The PCA9539 is difficult to detect and not commonly found in PC machines,
  21. so you have to pass the I2C bus and address of the installed PCA9539
  22. devices explicitly to the driver at load time via the force=... parameter.
  23. Sysfs entries
  24. -------------
  25. Each is a byte that maps to the 8 I/O bits.
  26. A '0' suffix is for bits 0-7, while '1' is for bits 8-15.
  27. input[01] - read the current value
  28. output[01] - sets the output value
  29. direction[01] - direction of each bit: 1=input, 0=output
  30. invert[01] - toggle the input bit sense
  31. input reads the actual state of the line and is always available.
  32. The direction defaults to input for all channels.
  33. General Remarks
  34. ---------------
  35. Note that each output, direction, and invert entry controls 8 lines.
  36. You should use the read, modify, write sequence.
  37. For example. to set output bit 0 of 1.
  38. val=$(cat output0)
  39. val=$(( $val | 1 ))
  40. echo $val > output0