zephyr/samples/display/cfb_shell
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
..
boards samples/display: Introduce the cfb_shell sample app 2018-12-07 10:21:02 -05:00
src samples/display: Introduce the cfb_shell sample app 2018-12-07 10:21:02 -05:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
README.rst doc: Clean up build instructions and use of variables 2019-02-21 11:46:45 +01:00
frdm_k64f.overlay display: ssd1306: Convert to new DT_<COMPAT>_<INSTANCE> defines 2019-01-29 14:21:32 -06:00
prj.conf samples/display: Introduce the cfb_shell sample app 2018-12-07 10:21:02 -05:00
sample.yaml samples: add test identifier 2019-03-29 17:44:11 -04:00

README.rst

.. _cfb_shell_sample:

Character Framebuffer Shell Module Sample
#########################################

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/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: SSD1673
         Display Cleared

**get_device**: prints the display device name.

Command example (reel_board):

.. code-block:: console

         uart:~$ cfb get_device
         Framebuffer Device: SSD1673

**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 widht=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