gpio: add new functions to set/get pin/port values
This commit adds following functions which work with pin logical levels (take into account GPIO_ACTIVE_LOW flag): - gpio_port_get, gpio_port_set_masked, gpio_port_set_bits, gpio_port_clear_bits, gpio_port_set_clr_bits - gpio_pin_get, gpio_pin_set Functions which work with pin physical levels: - gpio_port_get_raw, gpio_port_set_masked_raw, gpio_port_set_bits_raw, gpio_port_clear_bits_raw, gpio_port_set_clr_bits_raw - gpio_pin_get_raw, gpio_pin_set_raw As well as functions: - gpio_port_toggle_bits, gpio_pin_toggle_bits Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
parent
af972c2c47
commit
d6191b5781
2 changed files with 452 additions and 3 deletions
|
@ -33,6 +33,49 @@ static inline int z_vrfy_gpio_read(struct device *port, int access_op,
|
|||
}
|
||||
#include <syscalls/gpio_read_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_get_raw(struct device *port,
|
||||
gpio_pins_t *value)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_pins_t)));
|
||||
return z_impl_gpio_port_get_raw((struct device *)port,
|
||||
(gpio_pins_t *)value);
|
||||
}
|
||||
#include <syscalls/gpio_port_get_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_set_masked_raw(struct device *port,
|
||||
gpio_pins_t mask, gpio_pins_t value)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_masked_raw));
|
||||
return z_impl_gpio_port_set_masked_raw((struct device *)port, mask,
|
||||
value);
|
||||
}
|
||||
#include <syscalls/gpio_port_set_masked_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_set_bits_raw(struct device *port,
|
||||
gpio_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_bits_raw));
|
||||
return z_impl_gpio_port_set_bits_raw((struct device *)port, pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_set_bits_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_clear_bits_raw(struct device *port,
|
||||
gpio_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_clear_bits_raw));
|
||||
return z_impl_gpio_port_clear_bits_raw((struct device *)port, pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_clear_bits_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_toggle_bits(struct device *port,
|
||||
gpio_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_toggle_bits));
|
||||
return z_impl_gpio_port_toggle_bits((struct device *)port, pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_toggle_bits_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_enable_callback(struct device *port,
|
||||
int access_op, u32_t pin)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue