diff --git a/samples/subsys/display/cfb_shell/README.rst b/samples/subsys/display/cfb_shell/README.rst index 4aa53267c299dc..be5047999c5993 100644 --- a/samples/subsys/display/cfb_shell/README.rst +++ b/samples/subsys/display/cfb_shell/README.rst @@ -27,41 +27,61 @@ Shell Module Command Help cfb - Compact Framebuffer Subsystem shell commands Subcommands: - init :[none] - get_device :[none] - get_param : - get_fonts :[none] - set_font : - invert :[none] - print : - scroll : - - clear :[none] + init : [none] + display : [] + pixel_format : [RGB_888|MONO01|MONO10|ARGB_8888|RGB_565|BGR_565] + get_param : + get_fonts : [none] + set_font : + set_kerning : + set_fgcolor : [ [ [ []]] + set_bgcolor : [ [ [ []]] + invert : [ ] + print : "" + 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 @@ -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 @@ -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 @@ -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 @@ -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 : "" + point : + line : + rect : + +**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