XCORE SDK
XCORE Software Development Kit
Functions
rtos_gpio_driver_core

Functions

void rtos_gpio_port_enable (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
uint32_t rtos_gpio_port_in (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_out (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, uint32_t value)
 
void rtos_gpio_isr_callback_set (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, rtos_gpio_isr_cb_t cb, void *app_data)
 
void rtos_gpio_interrupt_enable (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_interrupt_disable (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_drive (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_drive_low (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_drive_high (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_pull_none (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_pull_up (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_port_pull_down (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
 
void rtos_gpio_write_control_word (rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, uint32_t value)
 

Detailed Description

The core functions for using an RTOS GPIO driver instance after it has been initialized and started. These functions may be used by both the host and any client tiles that RPC has been enabled for.

Function Documentation

◆ rtos_gpio_interrupt_disable()

void rtos_gpio_interrupt_disable ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Disables interrupts on a GPIO port.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to disable interrupts on.

◆ rtos_gpio_interrupt_enable()

void rtos_gpio_interrupt_enable ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Enables interrupts on a GPIO port. Interrupts are triggered whenever the value on the port changes.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to enable interrupts on.

◆ rtos_gpio_isr_callback_set()

void rtos_gpio_isr_callback_set ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id,
rtos_gpio_isr_cb_t  cb,
void *  app_data 
)
inline

Sets the application callback function to be called when there is an interrupt on a GPIO port.

This must be called prior to enabling interrupts on port_id. It is also safe to be called while interrupts are enabled on it.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idInterrupts triggered by this port will call the application callback function cb.
cbThe application callback function to call when there is an interrupt triggered by the port port_id.
app_dataA pointer to application specific data to pass to the application callback function cb.

◆ rtos_gpio_port_drive()

void rtos_gpio_port_drive ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Configures a port in drive mode. Output values will be driven on the pins. This is the default drive state of a port. This has the side effect of disabling the port's internal pull-up and pull down resistors.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to drive mode.

◆ rtos_gpio_port_drive_high()

void rtos_gpio_port_drive_high ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Configures a port in drive high mode. When the output value is 1 the pin is driven high, otherwise no value is driven. This has the side effect of enabled the port's internal pull-down resistor.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to drive mode high.

◆ rtos_gpio_port_drive_low()

void rtos_gpio_port_drive_low ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Configures a port in drive low mode. When the output value is 0 the pin is driven low, otherwise no value is driven. This has the side effect of enabled the port's internal pull-up resistor.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to drive mode low.

◆ rtos_gpio_port_enable()

void rtos_gpio_port_enable ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Enables a GPIO port. This must be called on a port before using it with any other GPIO driver function.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to enable.

◆ rtos_gpio_port_in()

uint32_t rtos_gpio_port_in ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Inputs the value present on a GPIO port's pins.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to read from.
Returns
the value on the port's pins.

◆ rtos_gpio_port_out()

void rtos_gpio_port_out ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id,
uint32_t  value 
)
inline

Outputs a value to a GPIO port's pins.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to write to.
valueThe value to write to the GPIO port.

◆ rtos_gpio_port_pull_down()

void rtos_gpio_port_pull_down ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Enables the port's internal pull-down resistor.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to pull down mode.

◆ rtos_gpio_port_pull_none()

void rtos_gpio_port_pull_none ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Disables the port's internal pull-up and pull down resistors.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to pull none mode.

◆ rtos_gpio_port_pull_up()

void rtos_gpio_port_pull_up ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id 
)
inline

Enables the port's internal pull-up resistor.

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to set to pull up mode.

◆ rtos_gpio_write_control_word()

void rtos_gpio_write_control_word ( rtos_gpio_t ctx,
rtos_gpio_port_id_t  port_id,
uint32_t  value 
)
inline

Configures the port control word value

Parameters
ctxA pointer to the GPIO driver instance to use.
port_idThe GPIO port to modify
valueThe value to set the control word to