Lines Matching +full:int +full:- +full:pin
4 * SPDX-License-Identifier: Apache-2.0
28 * Behaviour of emulated GPIO is application-defined. As-such, each
31 * - define a Device Tree overlay file to indicate the number of GPIO
33 * - register a callback with the GPIO controller using
35 * - asynchronously call @ref gpio_emul_input_set and / or
54 * @return -EINVAL if an invalid argument is provided
56 int gpio_emul_input_set_masked(const struct device *port, gpio_port_pins_t pins,
60 * @brief Modify the value of one emulated GPIO input @p pin
63 * @param pin The pin to modify
64 * @param value New values to assign to @p pin
67 * @return -EINVAL if an invalid argument is provided
69 static inline int gpio_emul_input_set(const struct device *port, gpio_pin_t pin, in gpio_emul_input_set() argument
70 int value) in gpio_emul_input_set()
72 return gpio_emul_input_set_masked(port, BIT(pin), value ? BIT(pin) : 0); in gpio_emul_input_set()
83 * @return -EINVAL if an invalid argument is provided
85 int gpio_emul_output_get_masked(const struct device *port, gpio_port_pins_t pins,
89 * @brief Read the value of one emulated GPIO output @p pin
92 * @param pin The pin to read
95 * @return -EINVAL if an invalid argument is provided
97 static inline int gpio_emul_output_get(const struct device *port, gpio_pin_t pin) in gpio_emul_output_get() argument
99 int ret; in gpio_emul_output_get()
102 ret = gpio_emul_output_get_masked(port, BIT(pin), &values); in gpio_emul_output_get()
104 ret = (values & BIT(pin)) ? 1 : 0; in gpio_emul_output_get()
111 * @brief Get @p flags for a given emulated GPIO @p pin
116 * @param pin The pin to retrieve @p flags for
117 * @param flags a pointer to where the flags for @p pin will be stored
120 * @return -EINVAL if an invalid argument is provided
122 int gpio_emul_flags_get(const struct device *port, gpio_pin_t pin, gpio_flags_t *flags);