diff options
author | Bartosz Golaszewski <bartekgola@gmail.com> | 2018-02-19 10:06:07 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bartekgola@gmail.com> | 2018-02-19 10:06:07 +0100 |
commit | 783ff2e3c70788cdd1c65cba9ee0398bda5ebcda (patch) | |
tree | 67ddaab3e7e30630bca2347cab4093c08e7a0321 /include | |
parent | 8078a4a2ad90caf95ef6426c2b5cddeeddc9dc57 (diff) | |
download | external_libgpiod-783ff2e3c70788cdd1c65cba9ee0398bda5ebcda.tar.gz external_libgpiod-783ff2e3c70788cdd1c65cba9ee0398bda5ebcda.tar.bz2 external_libgpiod-783ff2e3c70788cdd1c65cba9ee0398bda5ebcda.zip |
API: start certain enums from 1
For enums describing direction & active state, event types etc. use 1
as the first value as it's easier to debug when all valid values are
different than in a zero-initialized data structure.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpiod.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/gpiod.h b/include/gpiod.h index d37e60c..eb3f81c 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -155,7 +155,7 @@ int gpiod_ctxless_set_value_multiple(const char *device, * @brief Event types that can be passed to the ctxless event callback. */ enum { - GPIOD_CTXLESS_EVENT_CB_TIMEOUT, + GPIOD_CTXLESS_EVENT_CB_TIMEOUT = 1, /**< Waiting for events timed out. */ GPIOD_CTXLESS_EVENT_CB_RISING_EDGE, /**< Rising edge event occured. */ @@ -531,7 +531,7 @@ gpiod_line_bulk_num_lines(struct gpiod_line_bulk *bulk) * @brief Possible direction settings. */ enum { - GPIOD_LINE_DIRECTION_INPUT, + GPIOD_LINE_DIRECTION_INPUT = 1, /**< Direction is input - we're reading the state of a GPIO line. */ GPIOD_LINE_DIRECTION_OUTPUT, /**< Direction is output - we're driving the GPIO line. */ @@ -541,7 +541,7 @@ enum { * @brief Possible active state settings. */ enum { - GPIOD_LINE_ACTIVE_STATE_HIGH, + GPIOD_LINE_ACTIVE_STATE_HIGH = 1, /**< The active state of a GPIO is active-high. */ GPIOD_LINE_ACTIVE_STATE_LOW, /**< The active state of a GPIO is active-low. */ @@ -649,7 +649,7 @@ bool gpiod_line_needs_update(struct gpiod_line *line) GPIOD_API; * @brief Available types of requests. */ enum { - GPIOD_LINE_REQUEST_DIRECTION_AS_IS, + GPIOD_LINE_REQUEST_DIRECTION_AS_IS = 1, /**< Request the line(s), but don't change current direction. */ GPIOD_LINE_REQUEST_DIRECTION_INPUT, /**< Request the line(s) for reading the GPIO line state. */ @@ -1019,7 +1019,7 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk, * @brief Event types. */ enum { - GPIOD_LINE_EVENT_RISING_EDGE, + GPIOD_LINE_EVENT_RISING_EDGE = 1, /**< Rising edge event. */ GPIOD_LINE_EVENT_FALLING_EDGE, /**< Falling edge event. */ |