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