Diego Rondini dd2b8c1155 cmd: gpio: Add gpio read subcommand
As explained in commit 4af2a33ee5b9 ("cmd: gpio: Make `gpio input`
return pin value again") the `gpio input` is used in scripts to obtain
the value of a pin, despite the fact that CMD_RET_FAILURE is
indistinguishable from a valid pin value.
To be able to detect failures and properly use the value of a GPIO in
scripts we introduce the `gpio read` command that sets the variable
`name` to the value of the pin. Return code of the `gpio read` command
can be used to check for CMD_RET_SUCCESS or CMD_RET_FAILURE.
CONFIG_CMD_GPIO_READ is used to enable the `gpio read` command.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
2022-04-20 11:14:39 -04:00
..
2022-01-19 18:11:34 +01:00
2022-04-20 11:14:39 -04:00
2021-07-23 13:36:20 -04:00
2022-01-19 18:11:34 +01:00
2021-07-23 13:36:14 -04:00
2021-07-23 13:36:20 -04:00
2022-03-10 08:28:36 -05:00