pcf8574 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Kernel driver pcf8574
  2. =====================
  3. Supported chips:
  4. * Philips PCF8574
  5. Prefix: 'pcf8574'
  6. Addresses scanned: I2C 0x20 - 0x27
  7. Datasheet: Publicly available at the Philips Semiconductors website
  8. http://www.semiconductors.philips.com/pip/PCF8574P.html
  9. * Philips PCF8574A
  10. Prefix: 'pcf8574a'
  11. Addresses scanned: I2C 0x38 - 0x3f
  12. Datasheet: Publicly available at the Philips Semiconductors website
  13. http://www.semiconductors.philips.com/pip/PCF8574P.html
  14. Authors:
  15. Frodo Looijaard <frodol@dds.nl>,
  16. Philip Edelbrock <phil@netroedge.com>,
  17. Dan Eaton <dan.eaton@rocketlogix.com>,
  18. Aurelien Jarno <aurelien@aurel32.net>,
  19. Jean Delvare <khali@linux-fr.org>,
  20. Description
  21. -----------
  22. The PCF8574(A) is an 8-bit I/O expander for the I2C bus produced by Philips
  23. Semiconductors. It is designed to provide a byte I2C interface to up to 16
  24. separate devices (8 x PCF8574 and 8 x PCF8574A).
  25. This device consists of a quasi-bidirectional port. Each of the eight I/Os
  26. can be independently used as an input or output. To setup an I/O as an
  27. input, you have to write a 1 to the corresponding output.
  28. For more informations see the datasheet.
  29. Accessing PCF8574(A) via /sys interface
  30. -------------------------------------
  31. ! Be careful !
  32. The PCF8574(A) is plainly impossible to detect ! Stupid chip.
  33. So every chip with address in the interval [20..27] and [38..3f] are
  34. detected as PCF8574(A). If you have other chips in this address
  35. range, the workaround is to load this module after the one
  36. for your others chips.
  37. On detection (i.e. insmod, modprobe et al.), directories are being
  38. created for each detected PCF8574(A):
  39. /sys/bus/i2c/devices/<0>-<1>/
  40. where <0> is the bus the chip was detected on (e. g. i2c-0)
  41. and <1> the chip address ([20..27] or [38..3f]):
  42. (example: /sys/bus/i2c/devices/1-0020/)
  43. Inside these directories, there are two files each:
  44. read and write (and one file with chip name).
  45. The read file is read-only. Reading gives you the current I/O input
  46. if the corresponding output is set as 1, otherwise the current output
  47. value, that is to say 0.
  48. The write file is read/write. Writing a value outputs it on the I/O
  49. port. Reading returns the last written value.
  50. On module initialization the chip is configured as eight inputs (all
  51. outputs to 1), so you can connect any circuit to the PCF8574(A) without
  52. being afraid of short-circuit.