Part 1
요약·해설
11개 exact command block과 각 parameter·화면 경계 동작을 보존합니다.
cfb init
SSD16XX
9 operations
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
D5A08A9D2DB1DC639A55D6D09CFFDD27E90C3D3D416DAD6C9DCF9CCB4C002604
.. zephyr:code-sample:: cfb-shell-sample
:name: Character Framebuffer shell module
:relevant-api: monochrome_character_framebuffer
Use the CFB shell module to interact with a monochrome display.
Overview
********
This is a simple shell module that exercises displays using the Character
Framebuffer subsystem.
Building and Running
********************
Build the sample app by choosing the target board, for example:
.. zephyr-app-commands::
:zephyr-app: samples/subsys/display/cfb_shell
:board: reel_board
:goals: build
Shell Module Command Help
=========================
.. code-block:: console
cfb - Character Framebuffer shell commands
Options:
-h, --help :Show command help.
Subcommands:
init :[none]
get_device :[none]
get_param :<all, height, width, ppt, rows, cols>
get_fonts :[none]
set_font :<idx>
invert :[none]
print :<col: pos> <row: pos> <text>
scroll :<dir: (vertical|horizontal)> <col: pos> <row: pos>
<text>
clear :[none]
**init**: should be called first to initialize the display.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb init
Framebuffer initialized: SSD16XX
Display Cleared
**get_device**: prints the display device name.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb get_device
Framebuffer Device: SSD16XX
**get_param**: get the display parameters where height, width and ppt
(pixel per tile) are in pixels and the number of rows and columns. The row
position is incremented by a multiple of the ppt.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb get_param all
param: height=120
param: width=250
param: ppt=8
param: rows=15
param: cols=250
**get_fonts**: print the index, height and width in pixels of the static
defined fonts presented in the system.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb get_fonts
idx=0 height=32 width=20
idx=1 height=24 width=15
idx=2 height=16 width=10
**set_font**: choose the font to be used by passing the font index. Only one
font can be used at a time.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb set_font 0
Font idx=0 height=32 width=20 set
**invert**: invert the pixel color of the display.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb invert
Framebuffer Inverted
**print**: pass the initial column and row positions and the text in
double quotation marks when it contains spaces. If text hits the edge
of the display the remaining characters will be displayed on the next line. The
previous printed text will be overwritten.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb print 60 5 ZEPHYR
**scroll**: pass the scroll direction, vertical or horizontal, the initial
column and row positions, and the text to be displayed in double quotation
marks when it contains spaces. If the text hits the edge of the display, the
remaining characters will be displayed in the next line. The text will scroll
until it hits the display boundary, last column for horizontal and last row
for vertical direction. The text passed with the scroll command will be moved
vertically or horizontally on the display.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb scroll vertical 60 5 ZEPHYR
**clear**: clear the display screen.
Command example (reel_board):
.. code-block:: console
uart:~$ cfb clear
Display Cleared
Part 3
한국어 전문 번역
개요
Character Framebuffer(CFB) subsystem을 shell에서 조작해 monochrome display의 기능을 시험하는 간단한 module입니다. Application을 다시 작성하지 않고도 초기화, 장치·화면 parameter 조회, font 선택, 반전, 출력, scroll, 지우기를 차례로 확인할 수 있습니다.
빌드 및 실행
대상 board를 선택해 sample application을 build합니다. 다음 예시는 reel_board를 사용합니다.
# From the root of the zephyr repository
west build -b reel_board samples/subsys/display/cfb_shell
Shell module command 도움말
CFB shell이 제공하는 전체 command와 argument 형식은 다음과 같습니다.
cfb - Character Framebuffer shell commands
Options:
-h, --help :Show command help.
Subcommands:
init :[none]
get_device :[none]
get_param :<all, height, width, ppt, rows, cols>
get_fonts :[none]
set_font :<idx>
invert :[none]
print :<col: pos> <row: pos> <text>
scroll :<dir: (vertical|horizontal)> <col: pos> <row: pos>
<text>
clear :[none]
init은 display를 초기화하므로 다른 command보다 먼저 호출해야 합니다. reel_board에서는 SSD16XX framebuffer를 준비하고 화면을 지웁니다.
uart:~$ cfb init
Framebuffer initialized: SSD16XX
Display Cleared
get_device는 현재 framebuffer에 연결된 display device 이름을 출력합니다.
uart:~$ cfb get_device
Framebuffer Device: SSD16XX
get_param은 화면의 height, width, tile당 pixel 수인 ppt, 그리고 row·column 수를 조회합니다. Height·width·ppt의 단위는 pixel이며, row position은 ppt의 배수로 증가합니다.
uart:~$ cfb get_param all
param: height=120
param: width=250
param: ppt=8
param: rows=15
param: cols=250
get_fonts는 system에 정적으로 정의된 font 각각의 index와 pixel 단위 height·width를 표시합니다.
uart:~$ cfb get_fonts
idx=0 height=32 width=20
idx=1 height=24 width=15
idx=2 height=16 width=10
set_font에 font index를 넘기면 이후 출력에 사용할 font가 선택됩니다. 동시에 사용할 수 있는 font는 하나뿐입니다.
uart:~$ cfb set_font 0
Font idx=0 height=32 width=20 set
invert는 display의 pixel color를 반전합니다.
uart:~$ cfb invert
Framebuffer Inverted
print에는 시작 column, 시작 row, text를 전달합니다. Text에 공백이 있으면 큰따옴표로 묶어야 합니다. Text가 화면 가장자리에 닿으면 남은 문자는 다음 줄에 표시되며, 전에 출력한 text는 덮어씁니다.
uart:~$ cfb print 60 5 ZEPHYR
scroll에는 vertical 또는 horizontal 방향, 시작 column·row, 표시할 text를 전달합니다. 공백이 든 text는 큰따옴표로 묶습니다. 가장자리에 닿은 나머지 문자는 다음 줄로 넘어가고, 수평 이동은 마지막 column, 수직 이동은 마지막 row의 경계에 닿을 때까지 계속됩니다.
uart:~$ cfb scroll vertical 60 5 ZEPHYR
clear는 display 화면 전체를 지웁니다.
uart:~$ cfb clear
Display Cleared
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.