Skip to content

Commit

Permalink
fb: cfb_shell: Update README.rst
Browse files Browse the repository at this point in the history
Update README to update to current specs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
  • Loading branch information
soburi committed Jul 2, 2024
1 parent 1fd9a94 commit ca6abc6
Showing 1 changed file with 107 additions and 25 deletions.
132 changes: 107 additions & 25 deletions samples/subsys/display/cfb_shell/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,61 @@ Shell Module Command Help
cfb - Compact Framebuffer Subsystem shell commands
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 : [none]
display : [<display_id>]
pixel_format : [RGB_888|MONO01|MONO10|ARGB_8888|RGB_565|BGR_565]
get_param : <all, height, width, ppt, rows, cols>
get_fonts : [none]
set_font : <idx>
set_kerning : <kerning>
set_fgcolor : [<red> [<green> [<blue> [<alpha>]]]
set_bgcolor : [<red> [<green> [<blue> [<alpha>]]]
invert : [<x> <y> <width> <height>]
print : <col: pos> <row: pos> "<text>"
scroll : scroll a text in vertical or horizontal direction
draw : drawing text
clear : [none]
**init**: should be called first to initialize the display.

Command example (reel_board):
Command example:

.. code-block:: console
uart:~$ cfb init
Framebuffer initialized: SSD16XX
Display Cleared
Initialized: ssd1306@3c [128x64@MONO01]
**display**: List and select which display to use.

Command example:

.. code-block:: console
uart:~$ cfb display
Displays:
* 0: ssd1306@3c
1: sh1106@3c
**get_device**: prints the display device name.
.. code-block:: console
uart:~$ cfb display 1
Display: select 1: sh1106@3c
**pixel_format**: Set display pixel format.

Command example (reel_board):
Command example:

.. code-block:: console
uart:~$ cfb get_device
Framebuffer Device: SSD16XX
uart:~$ cfb pixel_format MONO10
Pixel format: MONO10
**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):
Command example:

.. code-block:: console
Expand All @@ -75,7 +95,7 @@ Command example (reel_board):
**get_fonts**: print the index, height and width in pixels of the static
defined fonts presented in the system.

Command example (reel_board):
Command example:

.. code-block:: console
Expand All @@ -87,16 +107,43 @@ Command example (reel_board):
**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):
Command example:

.. code-block:: console
uart:~$ cfb set_font 0
Font idx=0 height=32 width=20 set
**invert**: invert the pixel color of the display.
**set_kerning**: Specify the spacing between characters.

Command example:

Command example (reel_board):
.. code-block:: console
uart:~$ cfb set_kerning 3
**set_fgcolor**: Set foreground color.

Command example:

.. code-block:: console
uart:~$ cfb foreground 0xFF 0 0 0
**set_bgcolor**: Set background color.

Command example:

.. code-block:: console
uart:~$ cfb background 0 0 0xFF 0
**invert**: invert the pixel color of the display.
It inverts the screen colors and swaps the foreground and background
olors if executed without arguments.
Reverses the image partially if you specify the start and end coordinates.
In this case, the foreground color and background color are not swapped.
Command example:

.. code-block:: console
Expand All @@ -108,7 +155,7 @@ 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):
Command example:

.. code-block:: console
Expand All @@ -123,15 +170,50 @@ for vertical direction. The text passed with the scroll command will be moved
vertically or horizontally on the display.


Command example (reel_board):
Command example:

.. code-block:: console
uart:~$ cfb scroll vertical 60 5 ZEPHYR
**draw**: draw text, point, line and rect.

.. code-block:: console
draw - drawing text
Subcommands:
text : <x> <x> "<text>"
point : <x> <y>
line : <x0> <y0> <x1> <y1>
rect : <x0> <y0> <x1> <y1>
**draw text**: Draw text.

.. code-block:: console
uart:~$ cfb draw text 0 0 text
**draw point**: Draw point.

.. code-block:: console
uart:~$ cfb draw point 0 0
**draw line**: Draw line.

.. code-block:: console
uart:~$ cfb draw line 0 0 200 200
**draw rect**: Draw rectanble.

.. code-block:: console
uart:~$ cfb draw rect 0 0 200 200
**clear**: clear the display screen.

Command example (reel_board):
Command example:

.. code-block:: console
Expand Down

0 comments on commit ca6abc6

Please sign in to comment.