drivers: gpio: provide typedefs for flags and devicetree properties

The public API for GPIO flags should use unsigned values, and for
MISRA compliance the size should not be platform-dependent.  Add a
typedef for generic flags.

Also add typedefs for pin indexes and devicetree flags so these can
be safely recorded from devicetree property values without risking
loss of information if more flags are added in the future.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-12-09 06:52:45 -06:00 committed by Carles Cufí
commit 2016cc64aa
2 changed files with 33 additions and 8 deletions

View file

@ -8,7 +8,7 @@
#include <syscall_handler.h>
static inline int z_vrfy_gpio_config(struct device *port, int access_op,
u32_t pin, int flags)
u32_t pin, gpio_flags_t flags)
{
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, config));
return z_impl_gpio_config((struct device *)port, access_op, pin, flags);