|
Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
|
Emulated GPIO backend API. More...
Functions | |
| int | gpio_emul_input_set_masked (const struct device *port, gpio_port_pins_t pins, gpio_port_value_t values) |
Modify the values of one or more emulated GPIO input pins. | |
| static int | gpio_emul_input_set (const struct device *port, gpio_pin_t pin, int value) |
Modify the value of one emulated GPIO input pin. | |
| static int | gpio_emul_input_set_dt (const struct gpio_dt_spec *spec, int value) |
Modify the value of one emulated GPIO input pin from a gpio_dt_spec. | |
| int | gpio_emul_output_get_masked (const struct device *port, gpio_port_pins_t pins, gpio_port_value_t *values) |
Read the value of one or more emulated GPIO output pins. | |
| static int | gpio_emul_output_get (const struct device *port, gpio_pin_t pin) |
Read the value of one emulated GPIO output pin. | |
| static int | gpio_emul_output_get_dt (const struct gpio_dt_spec *spec) |
Read the value of one emulated GPIO output pin from a gpio_dt_spec. | |
| int | gpio_emul_flags_get (const struct device *port, gpio_pin_t pin, gpio_flags_t *flags) |
Get flags for a given emulated GPIO pin. | |
| static int | gpio_emul_flags_get_dt (const struct gpio_dt_spec *spec, gpio_flags_t *flags) |
Get flags for a given emulated GPIO pin from a gpio_dt_spec. | |
Emulated GPIO backend API.
Behaviour of emulated GPIO is application-defined. As-such, each application may
An example of an appropriate Device Tree overlay file is in tests/drivers/gpio/gpio_basic_api/boards/native_sim.overlay.
An example of registering a callback to emulate "wiring" as well as an example of calling gpio_emul_input_set is in the file tests/drivers/gpio/gpio_basic_api/src/main.c .
| int gpio_emul_flags_get | ( | const struct device * | port, |
| gpio_pin_t | pin, | ||
| gpio_flags_t * | flags ) |
#include <zephyr/drivers/gpio/gpio_emul.h>
Get flags for a given emulated GPIO pin.
For more information on available flags, see GPIO.
| port | The emulated GPIO port |
| pin | The pin to retrieve flags for |
| flags | a pointer to where the flags for pin will be stored |
|
inlinestatic |
#include <zephyr/drivers/gpio/gpio_emul.h>
Get flags for a given emulated GPIO pin from a gpio_dt_spec.
This is equivalent to:
gpio_emul_flags_get(spec->port, spec->pin, flags);
For more information on available flags, see GPIO.
| spec | The emulated GPIO specification from devicetree |
| flags | a pointer to where the flags for the pin will be stored |
|
inlinestatic |
#include <zephyr/drivers/gpio/gpio_emul.h>
Modify the value of one emulated GPIO input pin.
| port | The emulated GPIO port |
| pin | The pin to modify |
| value | New values to assign to pin |
|
inlinestatic |
#include <zephyr/drivers/gpio/gpio_emul.h>
Modify the value of one emulated GPIO input pin from a gpio_dt_spec.
This is equivalent to:
gpio_emul_input_set(spec->port, spec->pin, value);
| spec | The emulated GPIO specification from devicetree |
| value | New values to assign to the pin |
| int gpio_emul_input_set_masked | ( | const struct device * | port, |
| gpio_port_pins_t | pins, | ||
| gpio_port_value_t | values ) |
#include <zephyr/drivers/gpio/gpio_emul.h>
Modify the values of one or more emulated GPIO input pins.
| port | The emulated GPIO port |
| pins | The mask of pins that have changed |
| values | New values to assign to pins |
|
inlinestatic |
#include <zephyr/drivers/gpio/gpio_emul.h>
Read the value of one emulated GPIO output pin.
| port | The emulated GPIO port |
| pin | The pin to read |
|
inlinestatic |
#include <zephyr/drivers/gpio/gpio_emul.h>
Read the value of one emulated GPIO output pin from a gpio_dt_spec.
This is equivalent to:
gpio_emul_output_get(spec->port, spec->pin);
| spec | The emulated GPIO specification from devicetree |
| int gpio_emul_output_get_masked | ( | const struct device * | port, |
| gpio_port_pins_t | pins, | ||
| gpio_port_value_t * | values ) |
#include <zephyr/drivers/gpio/gpio_emul.h>
Read the value of one or more emulated GPIO output pins.
| port | The emulated GPIO port |
| pins | The mask of pins that have changed |
| values | A pointer to where the value of pins will be stored |