Zephyr Project API 4.2.99
A Scalable Open Source RTOS
|
Raspberry Pi Pico PIO driver APIs. More...
Files | |
file | pio_rpi_pico.h |
Header file for Raspberry Pi Pico PIO driver. | |
Macros | |
#define | RPI_PICO_PIO_DEFINE_PROGRAM(name, wrap_target, wrap, ...) |
Utility macro to define a PIO program. | |
#define | RPI_PICO_PIO_GET_WRAP_TARGET(name) name ## _wrap_target |
Utility macro to get the wrap target of a program. | |
#define | RPI_PICO_PIO_GET_WRAP(name) name ## _wrap |
Utility macro to get the wrap source of a program. | |
#define | RPI_PICO_PIO_GET_PROGRAM(name) &name ## _program |
Utility macro to get a pointer to a PIO program. | |
#define | DT_RPI_PICO_PIO_PIN_BY_NAME(node_id, p_name, p_idx, g_name, g_idx) |
Get a pin number from a pinctrl / group name and index. | |
#define | DT_INST_RPI_PICO_PIO_PIN_BY_NAME(inst, p_name, p_idx, g_name, g_idx) DT_RPI_PICO_PIO_PIN_BY_NAME(DT_DRV_INST(inst), p_name, p_idx, g_name, g_idx) |
Get a pin number from a pinctrl / group name and index. | |
#define | DT_INST_PIO_PIN_BY_NAME(inst, name) DT_PIO_PIN_BY_NAME(DT_DRV_INST(inst), name) |
Get the pin number of a pin by its name. | |
Functions | |
PIO | pio_rpi_pico_get_pio (const struct device *dev) |
Get PIO object. | |
int | pio_rpi_pico_allocate_sm (const struct device *dev, size_t *sm) |
Allocate a state machine. | |
Raspberry Pi Pico PIO driver APIs.
#define DT_INST_PIO_PIN_BY_NAME | ( | inst, | |
name | |||
) | DT_PIO_PIN_BY_NAME(DT_DRV_INST(inst), name) |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Get the pin number of a pin by its name.
inst | instance number |
name | name of the pin (e.g. tx, rx, sck). |
#define DT_INST_RPI_PICO_PIO_PIN_BY_NAME | ( | inst, | |
p_name, | |||
p_idx, | |||
g_name, | |||
g_idx | |||
) | DT_RPI_PICO_PIO_PIN_BY_NAME(DT_DRV_INST(inst), p_name, p_idx, g_name, g_idx) |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Get a pin number from a pinctrl / group name and index.
inst | instance number |
p_name | pinctrl name |
p_idx | pinctrl index |
g_name | group name |
g_idx | group index |
#define DT_RPI_PICO_PIO_PIN_BY_NAME | ( | node_id, | |
p_name, | |||
p_idx, | |||
g_name, | |||
g_idx | |||
) |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Get a pin number from a pinctrl / group name and index.
Example devicetree fragment(s):
Example usage:
node_id | node identifier |
p_name | pinctrl name |
p_idx | pinctrl index |
g_name | group name |
g_idx | group index |
#define RPI_PICO_PIO_DEFINE_PROGRAM | ( | name, | |
wrap_target, | |||
wrap, | |||
... | |||
) |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Utility macro to define a PIO program.
The program is a list of 16 bit instructions, generated by the pioasm tool.
name | Name of the program. |
wrap_target | Wrap target as specified by the PIO program. |
wrap | Wrap source as specified by the PIO program. |
... | Comma separated list of PIO instructions. |
#define RPI_PICO_PIO_GET_PROGRAM | ( | name | ) | &name ## _program |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Utility macro to get a pointer to a PIO program.
name | Name of the program. |
#define RPI_PICO_PIO_GET_WRAP | ( | name | ) | name ## _wrap |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Utility macro to get the wrap source of a program.
name | Name of the program. |
#define RPI_PICO_PIO_GET_WRAP_TARGET | ( | name | ) | name ## _wrap_target |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Utility macro to get the wrap target of a program.
name | Name of the program. |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Allocate a state machine.
dev | Pointer to device structure for rpi_pio device instance |
sm | Pointer to store allocated state machine |
0 | on success |
-EBUSY | if no state machines were available |
PIO pio_rpi_pico_get_pio | ( | const struct device * | dev | ) |
#include <include/zephyr/drivers/misc/pio_rpi_pico/pio_rpi_pico.h>
Get PIO object.
dev | Pointer to device structure for rpi_pio device instance |