pcf8575 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. About the PCF8575 chip and the pcf8575 kernel driver
  2. ====================================================
  3. The PCF8575 chip is produced by the following manufacturers:
  4. * Philips NXP
  5. http://www.nxp.com/#/pip/cb=[type=product,path=50807/41735/41850,final=PCF8575_3]|pip=[pip=PCF8575_3][0]
  6. * Texas Instruments
  7. http://focus.ti.com/docs/prod/folders/print/pcf8575.html
  8. Some vendors sell small PCB's with the PCF8575 mounted on it. You can connect
  9. such a board to a Linux host via e.g. an USB to I2C interface. Examples of
  10. PCB boards with a PCF8575:
  11. * SFE Breakout Board for PCF8575 I2C Expander by RobotShop
  12. http://www.robotshop.ca/home/products/robot-parts/electronics/adapters-converters/sfe-pcf8575-i2c-expander-board.html
  13. * Breakout Board for PCF8575 I2C Expander by Spark Fun Electronics
  14. http://www.sparkfun.com/commerce/product_info.php?products_id=8130
  15. Description
  16. -----------
  17. The PCF8575 chip is a 16-bit I/O expander for the I2C bus. Up to eight of
  18. these chips can be connected to the same I2C bus. You can find this
  19. chip on some custom designed hardware, but you won't find it on PC
  20. motherboards.
  21. The PCF8575 chip consists of a 16-bit quasi-bidirectional port and an I2C-bus
  22. interface. Each of the sixteen I/O's can be independently used as an input or
  23. an output. To set up an I/O pin as an input, you have to write a 1 to the
  24. corresponding output.
  25. For more information please see the datasheet.
  26. Detection
  27. ---------
  28. There is no method known to detect whether a chip on a given I2C address is
  29. a PCF8575 or whether it is any other I2C device. So there are two alternatives
  30. to let the driver find the installed PCF8575 devices:
  31. - Load this driver after any other I2C driver for I2C devices with addresses
  32. in the range 0x20 .. 0x27.
  33. - Pass the I2C bus and address of the installed PCF8575 devices explicitly to
  34. the driver at load time via the probe=... or force=... parameters.
  35. /sys interface
  36. --------------
  37. For each address on which a PCF8575 chip was found or forced the following
  38. files will be created under /sys:
  39. * /sys/bus/i2c/devices/<bus>-<address>/read
  40. * /sys/bus/i2c/devices/<bus>-<address>/write
  41. where bus is the I2C bus number (0, 1, ...) and address is the four-digit
  42. hexadecimal representation of the 7-bit I2C address of the PCF8575
  43. (0020 .. 0027).
  44. The read file is read-only. Reading it will trigger an I2C read and will hence
  45. report the current input state for the pins configured as inputs, and the
  46. current output value for the pins configured as outputs.
  47. The write file is read-write. Writing a value to it will configure all pins
  48. as output for which the corresponding bit is zero. Reading the write file will
  49. return the value last written, or -EAGAIN if no value has yet been written to
  50. the write file.
  51. On module initialization the configuration of the chip is not changed -- the
  52. chip is left in the state it was already configured in through either power-up
  53. or through previous I2C write actions.