← Documents Documentation/admin-guide/auxdisplay/cfag12864b.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Auxiliary display

cfag12864b LCD Driver Documentation

CFAG12864B의 128x64 framebuffer geometry, parallel-port 배선과 file I/O·mmap userspace programming을 설명합니다.

Source pathDocumentation/admin-guide/auxdisplay/cfag12864b.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Driver

cfag12864b.rst:1-23

CFAG12864B LCD driver의 범위와 문서 정보를 소개합니다.

Device geometry

cfag12864b.rst:24-43

KS0108 controller 두 개가 만드는 1-Kbyte monochrome framebuffer를 정리합니다.

Parallel wiring

cfag12864b.rst:44-81

Data·control signal과 전원·contrast·backlight 회로를 pin별로 연결합니다.

Userspace access

cfag12864b.rst:82-98

/dev/fbX를 file I/O 또는 mmap으로 갱신합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

CFAG12864B driver 정보

1-23

이 GPLv2 문서는 Miguel Ojeda <[email protected]>가 2006년 10월 27일 작성·관리한 `cfag12864b` LCD driver 설명서입니다. Driver information, device information, wiring, userspace programming의 네 부분으로 구성됩니다.

이 driver는 CFAG12864B LCD를 지원합니다.

CFAG12864B device 사양

24-43

제조사는 Crystalfontz이고 제품명은 Crystalfontz 12864b LCD Series, device code는 `cfag12864b`입니다. 제조사와 제품 page는 각각 `http://www.crystalfontz.com`, `http://www.crystalfontz.com/products/12864b/`입니다.

CFAG12864B geometry and memory
PropertyValue
TypeLCD (Liquid Crystal Display)
Resolution128 x 64
Colors2 (B/N)
Controller2 x KS0108
Pages8 per controller
Addresses64 per page
Data per address1 byte
Total memory2 x 8 x 64 x 1 = 1024 bytes = 1 Kbyte

두 KS0108 controller가 128x64 monochrome framebuffer를 나눠 담당합니다.

Parallel port와 CFAG12864B 배선

44-81

CFAG12864B LCD Series에는 공식 배선 방식이 없습니다. 일반적으로는 다음 원문 ASCII 회로처럼 parallel port에 연결합니다.

The common wiring is done to the parallel port as shown::

  Parallel Port                          cfag12864b

    Name Pin#                            Pin# Name

  Strobe ( 1)------------------------------(17) Enable
  Data 0 ( 2)------------------------------( 4) Data 0
  Data 1 ( 3)------------------------------( 5) Data 1
  Data 2 ( 4)------------------------------( 6) Data 2
  Data 3 ( 5)------------------------------( 7) Data 3
  Data 4 ( 6)------------------------------( 8) Data 4
  Data 5 ( 7)------------------------------( 9) Data 5
  Data 6 ( 8)------------------------------(10) Data 6
  Data 7 ( 9)------------------------------(11) Data 7
         (10)                      [+5v]---( 1) Vdd
         (11)                      [GND]---( 2) Ground
         (12)                      [+5v]---(14) Reset
         (13)                      [GND]---(15) Read / Write
    Line (14)------------------------------(13) Controller Select 1
         (15)
    Init (16)------------------------------(12) Controller Select 2
  Select (17)------------------------------(16) Data / Instruction
  Ground (18)---[GND]              [+5v]---(19) LED +
  Ground (19)---[GND]
  Ground (20)---[GND]              E    A             Values:
  Ground (21)---[GND]       [GND]---[P1]---(18) Vee    - R = Resistor = 22 ohm
  Ground (22)---[GND]                |                 - P1 = Preset = 10 Kohm
  Ground (23)---[GND]       ----   S ------( 3) V0     - P2 = Preset = 1 Kohm
  Ground (24)---[GND]       |  |
  Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED -
Parallel-port signal mapping
Parallel portPinCFAG12864B pinLCD signal
Strobe117Enable
Data 024Data 0
Data 135Data 1
Data 246Data 2
Data 357Data 3
Data 468Data 4
Data 579Data 5
Data 6810Data 6
Data 7911Data 7
Line1413Controller Select 1
Init1612Controller Select 2
Select1716Data / Instruction

원문의 신호선을 parallel-port pin과 LCD pin 단위로 구조화했습니다.

Power, contrast and backlight wiring
Source/componentCFAG12864B pinPurpose
+5 V1 VddLogic supply
GND2 GroundLogic ground
+5 V14 ResetHold reset high
GND15 Read / WriteWrite mode
+5 V19 LED +Backlight positive
GND through P118 VeeContrast reference
P1 wiper3 V0LCD contrast input
GND through P2 and R20 LED -Backlight current path
Parallel pins 18-25GNDCommon ground
undefinedundefined
undefinedundefined
undefinedundefined

전원·ground·preset·resistor 연결과 원문 component 값을 분리했습니다.

Framebuffer userspace programming

82-98

`cfag12864bfb`는 `/dev/fbX` framebuffer device를 제공합니다. 크기는 1024 bytes, 즉 1 Kbyte입니다. 각 bit가 pixel 하나를 나타내며 bit가 high면 pixel이 켜지고 low면 꺼집니다.

Framebuffer를 file처럼 `fopen`, `fwrite`, `fclose`로 사용할 수 있지만 다음 refresh time이 와야 LCD가 갱신됩니다.

`open`과 `mmap`, `munmap`과 `close`로 framebuffer를 memory-map할 수도 있으며 대부분의 용도에는 이 방식이 가장 좋습니다.

실제로 동작하는 완전한 userspace program과 사용 예제는 `samples/auxdisplay/cfag12864b-example.c`를 확인합니다.

Framebuffer update paths
fopenfwrite pixelsfcloseWait for next refreshLCD updates
open /dev/fbXmmap 1024 bytesModify bitsmunmap and closeLCD updates

File I/O와 memory mapping이 같은 1-Kbyte framebuffer를 거쳐 refresh됩니다.