cfag12864b.rst 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ===================================
  2. cfag12864b LCD Driver Documentation
  3. ===================================
  4. :License: GPLv2
  5. :Author & Maintainer: Miguel Ojeda <ojeda@kernel.org>
  6. :Date: 2006-10-27
  7. .. INDEX
  8. 1. DRIVER INFORMATION
  9. 2. DEVICE INFORMATION
  10. 3. WIRING
  11. 4. USERSPACE PROGRAMMING
  12. 1. Driver Information
  13. ---------------------
  14. This driver supports a cfag12864b LCD.
  15. 2. Device Information
  16. ---------------------
  17. :Manufacturer: Crystalfontz
  18. :Device Name: Crystalfontz 12864b LCD Series
  19. :Device Code: cfag12864b
  20. :Webpage: http://www.crystalfontz.com
  21. :Device Webpage: http://www.crystalfontz.com/products/12864b/
  22. :Type: LCD (Liquid Crystal Display)
  23. :Width: 128
  24. :Height: 64
  25. :Colors: 2 (B/N)
  26. :Controller: ks0108
  27. :Controllers: 2
  28. :Pages: 8 each controller
  29. :Addresses: 64 each page
  30. :Data size: 1 byte each address
  31. :Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte
  32. 3. Wiring
  33. ---------
  34. The cfag12864b LCD Series don't have official wiring.
  35. The common wiring is done to the parallel port as shown::
  36. Parallel Port cfag12864b
  37. Name Pin# Pin# Name
  38. Strobe ( 1)------------------------------(17) Enable
  39. Data 0 ( 2)------------------------------( 4) Data 0
  40. Data 1 ( 3)------------------------------( 5) Data 1
  41. Data 2 ( 4)------------------------------( 6) Data 2
  42. Data 3 ( 5)------------------------------( 7) Data 3
  43. Data 4 ( 6)------------------------------( 8) Data 4
  44. Data 5 ( 7)------------------------------( 9) Data 5
  45. Data 6 ( 8)------------------------------(10) Data 6
  46. Data 7 ( 9)------------------------------(11) Data 7
  47. (10) [+5v]---( 1) Vdd
  48. (11) [GND]---( 2) Ground
  49. (12) [+5v]---(14) Reset
  50. (13) [GND]---(15) Read / Write
  51. Line (14)------------------------------(13) Controller Select 1
  52. (15)
  53. Init (16)------------------------------(12) Controller Select 2
  54. Select (17)------------------------------(16) Data / Instruction
  55. Ground (18)---[GND] [+5v]---(19) LED +
  56. Ground (19)---[GND]
  57. Ground (20)---[GND] E A Values:
  58. Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm
  59. Ground (22)---[GND] | - P1 = Preset = 10 Kohm
  60. Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm
  61. Ground (24)---[GND] | |
  62. Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED -
  63. 4. Userspace Programming
  64. ------------------------
  65. The cfag12864bfb describes a framebuffer device (/dev/fbX).
  66. It has a size of 1024 bytes = 1 Kbyte.
  67. Each bit represents one pixel. If the bit is high, the pixel will
  68. turn on. If the pixel is low, the pixel will turn off.
  69. You can use the framebuffer as a file: fopen, fwrite, fclose...
  70. Although the LCD won't get updated until the next refresh time arrives.
  71. Also, you can mmap the framebuffer: open & mmap, munmap & close...
  72. which is the best option for most uses.
  73. Check samples/auxdisplay/cfag12864b-example.c
  74. for a real working userspace complete program with usage examples.