Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
General-Purpose IO Utility Functions

Description

These are useful utility functions for the general-purpose input & output module.

Functions

uint32_t alt_gpio_port_idcode_get (ALT_GPIO_PORT_t gpio_pid)
 
uint32_t alt_gpio_port_ver_get (ALT_GPIO_PORT_t gpio_pid)
 
ALT_GPIO_PORT_t alt_gpio_bit_to_pid (ALT_GPIO_1BIT_t pin_num)
 
ALT_GPIO_PORTBIT_t alt_gpio_bit_to_port_pin (ALT_GPIO_1BIT_t pin_num)
 
ALT_GPIO_1BIT_t alt_gpio_port_pin_to_bit (ALT_GPIO_PORT_t pid, uint32_t bitmask)
 

Function Documentation

uint32_t alt_gpio_port_idcode_get ( ALT_GPIO_PORT_t  gpio_pid)

Returns the ID code of the specified GPIO module.

Parameters
gpio_pidThe GPIO port identifier.
Return values
uint32_tThe component code of the module, GPIO_MODULE_IDCODE.
uint32_t alt_gpio_port_ver_get ( ALT_GPIO_PORT_t  gpio_pid)

Returns the version code of the specified GPIO module.

Parameters
gpio_pidThe GPIO port identifier.
Return values
uint32_tThe encoded revision number of the module.
ALT_GPIO_PORT_t alt_gpio_bit_to_pid ( ALT_GPIO_1BIT_t  pin_num)

Extracts the GPIO port ID from the supplied GPIO Signal Index Number.

ALT_GPIO_PORTBIT_t alt_gpio_bit_to_port_pin ( ALT_GPIO_1BIT_t  pin_num)

Extracts the GPIO signal (pin) offset from the supplied GPIO Signal Index Number.

ALT_GPIO_1BIT_t alt_gpio_port_pin_to_bit ( ALT_GPIO_PORT_t  pid,
uint32_t  bitmask 
)

Extracts the GPIO Signal Index Number from the supplied GPIO port ID and signal mask. If passed a bitmask composed of more than one signal, the signal number of the lowest bit in the bitmask presented is returned.