README.rst
1.. _cfb_shell_sample:
2
3Character Framebuffer Shell Module Sample
4#########################################
5
6Overview
7********
8This is a simple shell module that exercises displays using the Character
9Framebuffer subsystem.
10
11Building and Running
12********************
13
14Build the sample app by choosing the target board, for example:
15
16.. zephyr-app-commands::
17 :zephyr-app: samples/display/cfb_shell
18 :board: reel_board
19 :goals: build
20
21
22Shell Module Command Help
23=========================
24
25.. code-block:: console
26
27 cfb - Character Framebuffer shell commands
28 Options:
29 -h, --help :Show command help.
30 Subcommands:
31 init :[none]
32 get_device :[none]
33 get_param :<all, height, width, ppt, rows, cols>
34 get_fonts :[none]
35 set_font :<idx>
36 invert :[none]
37 print :<col: pos> <row: pos> <text>
38 scroll :<dir: (vertical|horizontal)> <col: pos> <row: pos>
39 <text>
40 clear :[none]
41
42**init**: should be called first to initialize the display.
43
44Command example (reel_board):
45
46.. code-block:: console
47
48 uart:~$ cfb init
49 Framebuffer initialized: SSD16XX
50 Display Cleared
51
52**get_device**: prints the display device name.
53
54Command example (reel_board):
55
56.. code-block:: console
57
58 uart:~$ cfb get_device
59 Framebuffer Device: SSD16XX
60
61**get_param**: get the display parameters where height, width and ppt
62(pixel per tile) are in pixels and the number of rows and columns. The row
63position is incremented by a multiple of the ppt.
64
65Command example (reel_board):
66
67.. code-block:: console
68
69 uart:~$ cfb get_param all
70 param: height=120
71 param: width=250
72 param: ppt=8
73 param: rows=15
74 param: cols=250
75
76**get_fonts**: print the index, height and width in pixels of the static
77defined fonts presented in the system.
78
79Command example (reel_board):
80
81.. code-block:: console
82
83 uart:~$ cfb get_fonts
84 idx=0 height=32 width=20
85 idx=1 height=24 width=15
86 idx=2 height=16 width=10
87
88**set_font**: choose the font to be used by passing the font index. Only one
89font can be used at a time.
90
91Command example (reel_board):
92
93.. code-block:: console
94
95 uart:~$ cfb set_font 0
96 Font idx=0 height=32 widht=20 set
97
98**invert**: invert the pixel color of the display.
99
100Command example (reel_board):
101
102.. code-block:: console
103
104 uart:~$ cfb invert
105 Framebuffer Inverted
106
107**print**: pass the initial column and row positions and the text in
108double quotation marks when it contains spaces. If text hits the edge
109of the display the remaining characters will be displayed on the next line. The
110previous printed text will be overwritten.
111
112Command example (reel_board):
113
114.. code-block:: console
115
116 uart:~$ cfb print 60 5 ZEPHYR
117
118**scroll**: pass the scroll direction, vertical or horizontal, the initial
119column and row positions, and the text to be displayed in double quotation
120marks when it contains spaces. If the text hits the edge of the display, the
121remaining characters will be displayed in the next line. The text will scroll
122until it hits the display boundary, last column for horizontal and last row
123for vertical direction. The text passed with the scroll command will be moved
124vertically or horizontally on the display.
125
126
127Command example (reel_board):
128
129.. code-block:: console
130
131 uart:~$ cfb scroll vertical 60 5 ZEPHYR
132
133**clear**: clear the display screen.
134
135Command example (reel_board):
136
137.. code-block:: console
138
139 uart:~$ cfb clear
140 Display Cleared
141