doc: video: Add docs for video commands

Add documentation and a simple test for the setcurs and lcdputs
commands.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

Series-changes: 2
- Split out docs into its own patch; use video: tag

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-02 08:16:23 -06:00
parent d378fb4095
commit 4bda6d5454
3 changed files with 115 additions and 0 deletions

57
doc/usage/cmd/lcdputs.rst Normal file
View File

@@ -0,0 +1,57 @@
.. SPDX-License-Identifier: GPL-2.0-or-later
.. index::
single: lcdputs (command)
lcdputs command
===============
Synopsis
--------
::
lcdputs <string>
Description
-----------
The lcdputs command prints a string to the video framebuffer at the current
cursor position.
string
Text string to display on the video console
Examples
--------
Print a simple string::
=> lcdputs "Hello World"
Combine with setcurs to position text::
=> setcurs 10 5
=> lcdputs "Positioned text"
Print multiple lines::
=> setcurs 0 0
=> lcdputs "Line 1"
=> setcurs 0 1
=> lcdputs "Line 2"
Configuration
-------------
The lcdputs command is available if CONFIG_CMD_VIDEO=y.
See also
--------
* :doc:`setcurs` - set cursor position
Return value
------------
The return value $? is 0 (true) on success, 1 (false) on failure.

56
doc/usage/cmd/setcurs.rst Normal file
View File

@@ -0,0 +1,56 @@
.. SPDX-License-Identifier: GPL-2.0-or-later
.. index::
single: setcurs (command)
setcurs command
===============
Synopsis
--------
::
setcurs <col> <row>
Description
-----------
The setcurs command sets the cursor position on the video console.
col
Column position in hex, with 0 being the left side. Note that this is the
text-column position, so the number of pixels per position depends on the
font size.
row
Row position in hex, with 0 being the top edge. Note that this is the
text-row position, so the number of pixels per position depends on the
font size.
Examples
--------
Set cursor to column 0x10, row 5::
=> setcurs 10 5
Move cursor to top left::
=> setcurs 0 0
Configuration
-------------
The setcurs command is available if CONFIG_CMD_VIDEO=y.
See also
--------
* :doc:`lcdputs` - print string on video framebuffer
Return value
------------
The return value $? is 0 (true) on success, 1 (false) on failure.

View File

@@ -85,6 +85,7 @@ Shell commands
cmd/if
cmd/itest
cmd/imxtract
cmd/lcdputs
cmd/load
cmd/loadb
cmd/loadm
@@ -117,6 +118,7 @@ Shell commands
cmd/scmi
cmd/scp03
cmd/seama
cmd/setcurs
cmd/setexpr
cmd/sf
cmd/shim