From patchwork Thu Oct 2 15:45:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 474 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419984; bh=D0cycKFvX0D81aBW4blUVnnxULYeWlEo7jbEUPUuow4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=stwtGzes4D91lgpzN5j53Pc5lEy899TXNsALIujYhKoc3l/t4AD1nLFJeLfSz4Ion bGWMJMyhB818ldBECJ+EolaC3nk7XXy11X/JLiXA2PvjdxQWVXX0cgteB1zJRFVdYQ Zh/7ifynnZCz76MxLVgLyis3FUKQKBtvcfrYUgnIZnt++oWUlG4pzWqVjnEyyoCFGw 0sEEtLK2fL5rbZ8ir2+u9fbG1+f3VT2rUcJV7oe2C3p6BzjJhvbOU4uouSBfZIlfQN SEzTPpb2nFc9V3zvx3Z4noT3xOJo0HoHqO+W6BTGKut21QBnSbJ9yRpB2z/jBLB7iC NZBpNJd1aqwAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1E8FE67F1A for ; Thu, 2 Oct 2025 09:46:24 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id by68Vu8BPqfK for ; Thu, 2 Oct 2025 09:46:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419984; bh=D0cycKFvX0D81aBW4blUVnnxULYeWlEo7jbEUPUuow4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=stwtGzes4D91lgpzN5j53Pc5lEy899TXNsALIujYhKoc3l/t4AD1nLFJeLfSz4Ion bGWMJMyhB818ldBECJ+EolaC3nk7XXy11X/JLiXA2PvjdxQWVXX0cgteB1zJRFVdYQ Zh/7ifynnZCz76MxLVgLyis3FUKQKBtvcfrYUgnIZnt++oWUlG4pzWqVjnEyyoCFGw 0sEEtLK2fL5rbZ8ir2+u9fbG1+f3VT2rUcJV7oe2C3p6BzjJhvbOU4uouSBfZIlfQN SEzTPpb2nFc9V3zvx3Z4noT3xOJo0HoHqO+W6BTGKut21QBnSbJ9yRpB2z/jBLB7iC NZBpNJd1aqwAg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0E03F67F14 for ; Thu, 2 Oct 2025 09:46:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419982; bh=ftMd5UjT10zpfWiQP5IVp0pLOlZpZczTbfHOcCwtW7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hNpatVsSipSk/7yyrURSJ1Ya4Wgj0AdFdXLdNFLwGdMuHwIpUnkmgPMaY8wdNoCbY 5CfQLl9abCiU5fenXCFHWVIGybswkiuUWydiAQYIirE4B5Vt25i18CsiJMr4ZkMLrb Q2foetkV44P8wvO10kzK8gnUlDvVJH4/ycRKMxGr62GCdBdG8KhCeQZVRx7Cpk6n8h w4XB6xKDYn22qOyk+8FvSBZL/BVaEv8/t9BRtpRAsfbxvnUtL5ZsQoFJMIOOmKozll 9WkBvW+4WBcNYWVvsWPmJlU785jeq9rxsJoKNTtn+9gmNYdgVp1oEXXe6BMFptmHZq xE25wJRKynolg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D6AA67E4D; Thu, 2 Oct 2025 09:46:22 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id mUFMxB3Zc1Q7; Thu, 2 Oct 2025 09:46:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759419978; bh=5c8jxY/stf3JiSym95WpyCTv9LSVeF7xZqWphA5Lt1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1eSt6ImAqNCFLfRJciQhPQSK3AF0XHbqr22YhYAePvhlwxQ0Zs52nslBJDSpFSOq gCQlXFyKir7mHhaCWXzpif4kSoRd+7s8C52kye35HX624kyIOoK637WbUOHE+lHFQZ aAN85BHaYgmwk/c9UGEGBauWIQU/5ol79gBdDBYKdnIZT1hXixMNSbSxlD3x0/K80r uvUvsuSVKsK3bMufPQYNk0LuQF36QQKFoem46k8KUNTvTxNXHyzainUoALlTYlFZ+I 2yvP+/C79o6e78TMOqIySklrg89Qxr2+cvUrRh1hvf3X7DlBCC5lDAKKL6Wf+qVSR7 GJJ3LaKX1Kmng== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 39B8567D8D; Thu, 2 Oct 2025 09:46:18 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 2 Oct 2025 09:45:42 -0600 Message-ID: <20251002154554.4129220-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251002154554.4129220-1-sjg@u-boot.org> References: <20251002154554.4129220-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MHWVO2PUA2VX3V5BH3SIUNHI7MWJT2BM X-Message-ID-Hash: MHWVO2PUA2VX3V5BH3SIUNHI7MWJT2BM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 2/9] doc: video: Add docs for video commands List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add documentation and a simple test for the setcurs and lcdputs commands. Co-developed-by: Claude Signed-off-by: Simon Glass --- Changes in v2: - Split out docs into its own patch; use video: tag doc/usage/cmd/lcdputs.rst | 57 +++++++++++++++++++++++++++++++++++++++ doc/usage/cmd/setcurs.rst | 56 ++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 2 ++ 3 files changed, 115 insertions(+) create mode 100644 doc/usage/cmd/lcdputs.rst create mode 100644 doc/usage/cmd/setcurs.rst diff --git a/doc/usage/cmd/lcdputs.rst b/doc/usage/cmd/lcdputs.rst new file mode 100644 index 00000000000..f34dbb3e3f1 --- /dev/null +++ b/doc/usage/cmd/lcdputs.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: lcdputs (command) + +lcdputs command +=============== + +Synopsis +-------- + +:: + + lcdputs + +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. diff --git a/doc/usage/cmd/setcurs.rst b/doc/usage/cmd/setcurs.rst new file mode 100644 index 00000000000..4619206fb40 --- /dev/null +++ b/doc/usage/cmd/setcurs.rst @@ -0,0 +1,56 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: setcurs (command) + +setcurs command +=============== + +Synopsis +-------- + +:: + + setcurs + +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. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 21d6d120e7c..0f271c1280d 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -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