i2c-parport 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Kernel driver i2c-parport
  2. Author: Jean Delvare <khali@linux-fr.org>
  3. This is a unified driver for several i2c-over-parallel-port adapters,
  4. such as the ones made by Philips, Velleman or ELV. This driver is
  5. meant as a replacement for the older, individual drivers:
  6. * i2c-philips-par
  7. * i2c-elv
  8. * i2c-velleman
  9. * video/i2c-parport (NOT the same as this one, dedicated to home brew
  10. teletext adapters)
  11. It currently supports the following devices:
  12. * (type=0) Philips adapter
  13. * (type=1) home brew teletext adapter
  14. * (type=2) Velleman K8000 adapter
  15. * (type=3) ELV adapter
  16. * (type=4) Analog Devices ADM1032 evaluation board
  17. * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
  18. * (type=6) Barco LPT->DVI (K5800236) adapter
  19. These devices use different pinout configurations, so you have to tell
  20. the driver what you have, using the type module parameter. There is no
  21. way to autodetect the devices. Support for different pinout configurations
  22. can be easily added when needed.
  23. Earlier kernels defaulted to type=0 (Philips). But now, if the type
  24. parameter is missing, the driver will simply fail to initialize.
  25. Building your own adapter
  26. -------------------------
  27. If you want to build you own i2c-over-parallel-port adapter, here is
  28. a sample electronics schema (credits go to Sylvain Munaut):
  29. Device PC
  30. Side ___________________Vdd (+) Side
  31. | | |
  32. --- --- ---
  33. | | | | | |
  34. |R| |R| |R|
  35. | | | | | |
  36. --- --- ---
  37. | | |
  38. | | /| |
  39. SCL ----------x--------o |-----------x------------------- pin 2
  40. | \| | |
  41. | | |
  42. | |\ | |
  43. SDA ----------x----x---| o---x--------------------------- pin 13
  44. | |/ |
  45. | |
  46. | /| |
  47. ---------o |----------------x-------------- pin 3
  48. \| | |
  49. | |
  50. --- ---
  51. | | | |
  52. |R| |R|
  53. | | | |
  54. --- ---
  55. | |
  56. ### ###
  57. GND GND
  58. Remarks:
  59. - This is the exact pinout and electronics used on the Analog Devices
  60. evaluation boards.
  61. /|
  62. - All inverters -o |- must be 74HC05, they must be open collector output.
  63. \|
  64. - All resitors are 10k.
  65. - Pins 18-25 of the parallel port connected to GND.
  66. - Pins 4-9 (D2-D7) could be used as VDD is the driver drives them high.
  67. The ADM1032 evaluation board uses D4-D7. Beware that the amount of
  68. current you can draw from the parallel port is limited. Also note that
  69. all connected lines MUST BE driven at the same state, else you'll short
  70. circuit the output buffers! So plugging the I2C adapter after loading
  71. the i2c-parport module might be a good safety since data line state
  72. prior to init may be unknown.
  73. - This is 5V!
  74. - Obviously you cannot read SCL (so it's not really standard-compliant).
  75. Pretty easy to add, just copy the SDA part and use another input pin.
  76. That would give (ELV compatible pinout):
  77. Device PC
  78. Side ______________________________Vdd (+) Side
  79. | | | |
  80. --- --- --- ---
  81. | | | | | | | |
  82. |R| |R| |R| |R|
  83. | | | | | | | |
  84. --- --- --- ---
  85. | | | |
  86. | | |\ | |
  87. SCL ----------x--------x--| o---x------------------------ pin 15
  88. | | |/ |
  89. | | |
  90. | | /| |
  91. | ---o |-------------x-------------- pin 2
  92. | \| | |
  93. | | |
  94. | | |
  95. | |\ | |
  96. SDA ---------------x---x--| o--------x------------------- pin 10
  97. | |/ |
  98. | |
  99. | /| |
  100. ---o |------------------x--------- pin 3
  101. \| | |
  102. | |
  103. --- ---
  104. | | | |
  105. |R| |R|
  106. | | | |
  107. --- ---
  108. | |
  109. ### ###
  110. GND GND
  111. If possible, you should use the same pinout configuration as existing
  112. adapters do, so you won't even have to change the code.
  113. Similar (but different) drivers
  114. -------------------------------
  115. This driver is NOT the same as the i2c-pport driver found in the i2c
  116. package. The i2c-pport driver makes use of modern parallel port features so
  117. that you don't need additional electronics. It has other restrictions
  118. however, and was not ported to Linux 2.6 (yet).
  119. This driver is also NOT the same as the i2c-pcf-epp driver found in the
  120. lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as
  121. an I2C bus directly. Instead, it uses it to control an external I2C bus
  122. master. That driver was not ported to Linux 2.6 (yet) either.
  123. Legacy documentation for Velleman adapter
  124. -----------------------------------------
  125. Useful links:
  126. Velleman http://www.velleman.be/
  127. Velleman K8000 Howto http://howto.htlw16.ac.at/k8000-howto.html
  128. The project has lead to new libs for the Velleman K8000 and K8005:
  129. LIBK8000 v1.99.1 and LIBK8005 v0.21
  130. With these libs, you can control the K8000 interface card and the K8005
  131. stepper motor card with the simple commands which are in the original
  132. Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and
  133. many more, using /dev/velleman.
  134. http://home.wanadoo.nl/hihihi/libk8000.htm
  135. http://home.wanadoo.nl/hihihi/libk8005.htm
  136. http://struyve.mine.nu:8080/index.php?block=k8000
  137. http://sourceforge.net/projects/libk8005/