XCORE SDK
XCORE Software Development Kit
Modules | Classes | Macros | Typedefs | Enumerations | Functions
rtos_gpio_driver

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)
 

Detailed Description

The public API for using the RTOS GPIO driver.

Macro Definition Documentation

◆ RTOS_GPIO_ISR_CALLBACK_ATTR

#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 Documentation

◆ rtos_gpio_isr_cb_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)

Function pointer type for application provided RTOS GPIO interrupt callback functions.

These callback functions are called when there is a GPIO port interrupt.

Parameters
ctxA pointer to the associated GPIO driver instance.
app_dataA pointer to application specific data provided by the application. Used to share data between this callback function and the application.
port_idThe GPIO port that triggered the interrupt.
valueThe value on the GPIO port that caused the interrupt.
Note
this is the latched value that triggered the interrupt, not the current value.

◆ rtos_gpio_t

typedef struct rtos_gpio_struct rtos_gpio_t

Typedef to the RTOS GPIO driver instance struct.

Enumeration Type Documentation

◆ rtos_gpio_port_id_t

Enumerator type representing each available GPIO port.

To be used with the RTOS GPIO driver functions.

Enumerator
RTOS_GPIO_TOTAL_PORT_CNT 

Total number of I/O ports

Function Documentation

◆ rtos_gpio_init()

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.

Parameters
ctxA pointer to the GPIO driver instance to initialize.

◆ rtos_gpio_port()

rtos_gpio_port_id_t rtos_gpio_port ( port_t  p)
inline

Helper function to convert an xcore I/O port resource ID to an RTOS GPIO driver port ID.

Parameters
pAn xcore I/O port resource ID.
Returns
the equivalent RTOS GPIO driver port ID.

◆ rtos_gpio_start()

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.

Parameters
ctxA pointer to the GPIO driver instance to start.