From patchwork Sun Dec 20 16:10:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1418830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=fke2d5b6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CzSHw6RQsz9sVj for ; Mon, 21 Dec 2020 03:10:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6119A8266E; Sun, 20 Dec 2020 17:10:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="fke2d5b6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 972B9826B1; Sun, 20 Dec 2020 17:10:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DBF5F8266B for ; Sun, 20 Dec 2020 17:10:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608480620; bh=QGYPlh/JqBZnYiHQ87/XKrez3uR4Lzk/7b+aa6NoVhM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=fke2d5b6sK2InzesuWptjda21tw6lEhShYpqAzxfELpF/5EPER48svFKVI+Hwxznu HJqWabvlnGGJmG7+n8wMFsEJTCS/KClxjssxuqk1H+l3DGU5HlITE0LYP/6TSBJiqc p84W8bvLQOlya0xzlffTUBjlSRsHbCoj7znxKhD0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.246.89]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MnJhO-1kPcY33HIS-00jGkk; Sun, 20 Dec 2020 17:10:19 +0100 From: Heinrich Schuchardt To: Tom Rini Cc: Philippe Reynes , Marek Szyprowski , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v2 1/1] doc: button command Date: Sun, 20 Dec 2020 17:10:14 +0100 Message-Id: <20201220161014.18943-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:QEQ2h4bfqM+bwhXvQ0TCoUSojrZQzRfXk1BMKcxLkjVQLUWe0EA GIRdI5v+XLNfWCViY+Z/sGtCT6dYAvZKNyl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+B7hJsDJjlNMC75bD19g== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Provide a description of the 'button' command. Signed-off-by: Heinrich Schuchardt --- v2: Replace ".. code-block::" by "::" as the build-system on Gitlab does not like code-block without language. The problem did not occur locally. --- doc/usage/button.rst | 64 ++++++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 65 insertions(+) create mode 100644 doc/usage/button.rst -- 2.29.2 diff --git a/doc/usage/button.rst b/doc/usage/button.rst new file mode 100644 index 0000000000..ea41762757 --- /dev/null +++ b/doc/usage/button.rst @@ -0,0 +1,64 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +button command +============== + +Synopsis +-------- + +:: + + button list + button + +Description +----------- + +The button command is used to retrieve the status of a button. To show the +status of a button with name 'button1' you would issue the command + +:: + + button button1 + +The status of the button is both written to the console as *ON* or *OFF* and +set in the return value variable *$?* as 0 (true) or 1 (false). To retrieve +the status of a button with name *button1* and to write it to environment +variable *status1* you would execute the commands + +:: + + button button1 + setenv status1 $? + +A list of all available buttons and their status can be displayed using + +:: + + button list + +If a button device has not been probed yet, its status will be shown as +** in the list. + +Configuration +------------- + +To use the button command you must specify CONFIG_CMD_BUTTON=y and enable a +button driver. The available buttons are defined in the device-tree. + +Return value +------------ + +The variable *$?* takes the following values + ++---+-----------------------------+ +| 0 | ON, the button is pressed | ++---+-----------------------------+ +| 1 | OFF, the button is released | ++---+-----------------------------+ +| 0 | button list was shown | ++---+-----------------------------+ +| 1 | button not found | ++---+-----------------------------+ +| 1 | invalid arguments | ++---+-----------------------------+ diff --git a/doc/usage/index.rst b/doc/usage/index.rst index d0f5a9f26e..6c4b5b9240 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -12,4 +12,5 @@ Shell commands :maxdepth: 1 bootmenu + button pstore