diff options
author | Keith Short <keithshort@chromium.org> | 2019-10-31 13:40:53 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-01 04:36:51 +0000 |
commit | 65294881b3aee9f47b649cc9a2320a1c3f5ab9f9 (patch) | |
tree | 43fedd12c77876ec7996325f9867f0e3b00429c8 /include/gpio.h | |
parent | 28b8d229927d285043fcdaf5043456cf20865a7e (diff) | |
download | chrome-ec-65294881b3aee9f47b649cc9a2320a1c3f5ab9f9.tar.gz |
gpio: add function to set a GPIO and log to the console
Add a common function gpio_set_level_verbose() to generate a cprints()
statement prior to changing the GPIO pin level.
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: I6b3a9e89604fb721d8fa5208ce96df9e9414cdf9
Signed-off-by: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1893633
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h index e5e8afe24a..3b1763ae9d 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -9,6 +9,7 @@ #define __CROS_EC_GPIO_H #include "common.h" +#include "console.h" /* Flag definitions for gpio_info and gpio_alt_func */ #define GPIO_FLAG_NONE 0 /* No flag needed, default setting */ @@ -216,6 +217,16 @@ int gpio_get_default_flags(enum gpio_signal signal); void gpio_set_level(enum gpio_signal signal, int value); /** + * Set the value of a signal and log to the console. + * + * @param channel Output channel + * @param signal Signal to set + * @param value New value for signal (0 = low, 1 = high) + */ +void gpio_set_level_verbose(enum console_channel channel, + enum gpio_signal signal, int value); + +/** * Set the value of a signal that could be either a local GPIO or an IO * expander GPIO. * |