XCORE SDK
XCORE Software Development Kit
|
Modules | |
rtos_gpio_driver_core | |
rtos_gpio_driver_rpc | |
Classes | |
struct | rtos_gpio_isr_info_t |
struct | rtos_gpio_struct |
Macros | |
#define | RTOS_GPIO_ISR_CALLBACK_ATTR __attribute__((fptrgroup("rtos_gpio_isr_cb_fptr_grp"))) |
Typedefs | |
typedef struct rtos_gpio_struct | rtos_gpio_t |
typedef void(* | rtos_gpio_isr_cb_t) (rtos_gpio_t *ctx, void *app_data, rtos_gpio_port_id_t port_id, uint32_t value) |
Enumerations | |
enum | rtos_gpio_port_id_t { rtos_gpio_port_none = -1 , rtos_gpio_port_1A , rtos_gpio_port_1B , rtos_gpio_port_1C , rtos_gpio_port_1D , rtos_gpio_port_1E , rtos_gpio_port_1F , rtos_gpio_port_1G , rtos_gpio_port_1H , rtos_gpio_port_1I , rtos_gpio_port_1J , rtos_gpio_port_1K , rtos_gpio_port_1L , rtos_gpio_port_1M , rtos_gpio_port_1N , rtos_gpio_port_1O , rtos_gpio_port_1P , rtos_gpio_port_4A , rtos_gpio_port_4B , rtos_gpio_port_4C , rtos_gpio_port_4D , rtos_gpio_port_4E , rtos_gpio_port_4F , rtos_gpio_port_8A , rtos_gpio_port_8B , rtos_gpio_port_8C , rtos_gpio_port_8D , rtos_gpio_port_16A , rtos_gpio_port_16B , rtos_gpio_port_16C , rtos_gpio_port_16D , rtos_gpio_port_32A , rtos_gpio_port_32B , RTOS_GPIO_TOTAL_PORT_CNT } |
Functions | |
rtos_gpio_port_id_t | rtos_gpio_port (port_t p) |
void | rtos_gpio_start (rtos_gpio_t *ctx) |
void | rtos_gpio_init (rtos_gpio_t *ctx) |
The public API for using the RTOS GPIO driver.
#define RTOS_GPIO_ISR_CALLBACK_ATTR __attribute__((fptrgroup("rtos_gpio_isr_cb_fptr_grp"))) |
This attribute must be specified on all RTOS GPIO interrupt callback functions provided by the application.
typedef void(* rtos_gpio_isr_cb_t) (rtos_gpio_t *ctx, void *app_data, rtos_gpio_port_id_t port_id, uint32_t value) |
Function pointer type for application provided RTOS GPIO interrupt callback functions.
These callback functions are called when there is a GPIO port interrupt.
ctx | A pointer to the associated GPIO driver instance. |
app_data | A pointer to application specific data provided by the application. Used to share data between this callback function and the application. |
port_id | The GPIO port that triggered the interrupt. |
value | The value on the GPIO port that caused the interrupt. |
typedef struct rtos_gpio_struct rtos_gpio_t |
Typedef to the RTOS GPIO driver instance struct.
enum rtos_gpio_port_id_t |
void rtos_gpio_init | ( | rtos_gpio_t * | ctx | ) |
Initializes an RTOS GPIO driver instance. There should only be one per tile. This instance represents all the GPIO ports owned by the calling tile. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before calling rtos_gpio_start() or any of the core GPIO driver functions with this instance.
ctx | A pointer to the GPIO driver instance to initialize. |
|
inline |
Helper function to convert an xcore I/O port resource ID to an RTOS GPIO driver port ID.
p | An xcore I/O port resource ID. |
void rtos_gpio_start | ( | rtos_gpio_t * | ctx | ) |
Starts an RTOS GPIO driver instance. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before any of the core GPIO driver functions are called with this instance.
rtos_gpio_init() must be called on this GPIO driver instance prior to calling this.
ctx | A pointer to the GPIO driver instance to start. |