Definitions for the pinout for each supported device
|
| enum | cyhal_port_t {
CYHAL_PORT_0 = 0x0,
CYHAL_PORT_1 = 0x1,
CYHAL_PORT_2 = 0x2,
CYHAL_PORT_3 = 0x3,
CYHAL_PORT_4 = 0x4,
CYHAL_PORT_5 = 0x5,
CYHAL_PORT_6 = 0x6,
CYHAL_PORT_7 = 0x7,
CYHAL_PORT_8 = 0x8,
CYHAL_PORT_9 = 0x9,
CYHAL_PORT_10 = 0xA,
CYHAL_PORT_11 = 0xB,
CYHAL_PORT_12 = 0xC,
CYHAL_PORT_13 = 0xD,
CYHAL_PORT_14 = 0xE,
CYHAL_PORT_15 = 0xF
} |
| |
◆ CY_GPIO_CFG_GET_MODE
| #define CY_GPIO_CFG_GET_MODE |
( |
|
x | ) |
((uint8_t)((x) & 0xFF)) |
Extract the GPIO mode setting from a cyhal_gpio_mapping_cfg_t
◆ CY_GPIO_CFG_GET_HSIOM
| #define CY_GPIO_CFG_GET_HSIOM |
( |
|
x | ) |
((en_hsiom_sel_t)(((x) >> 8) & 0xFF)) |
Extract the HSIOM selection from a cyhal_gpio_mapping_cfg_t
◆ CYHAL_GET_PIN
| #define CYHAL_GET_PIN |
( |
|
pin | ) |
((uint8_t)(pin & 0xFFFFUL)) |
Macro to extract the pin number
◆ CYHAL_GET_PORT
| #define CYHAL_GET_PORT |
( |
|
pin | ) |
((uint8_t)((uint32_t)(pin >> 16) & 0xFFUL)) |
Macro to extract the port number
◆ CY_UTILS_GET_RESOURCE
| #define CY_UTILS_GET_RESOURCE |
( |
|
pin, |
|
|
|
mappings |
|
) |
| cyhal_utils_get_resource(pin, mappings, sizeof(mappings)/sizeof(cyhal_resource_pin_mapping_t)) |
Looks up the resource block that connects to the specified pins from the provided resource pin mapping table. This is a convinience utility for cyhal_utils_get_resource() if the mappings is an array of known size.
- Parameters
-
| [in] | pin | The pin to lookup the hardware block for |
| [in] | mappings | The mappings of pin to hardware block |
- Returns
- The entry for the specified pin if it exists, or null if it doesn't.
◆ cyhal_gpio_mapping_cfg_t
Bitfield representing the configuration of a GPIO (hsiom selection and mode). Use the CY_GPIO_CFG_GET_MODE and CY_GPIO_CFG_GET_HSIOM to extract the individual field values.
◆ cyhal_port_t
◆ cyhal_utils_get_gpio_resource()
Converts the provided gpio pin to a resource instance object
- Parameters
-
| [in] | pin | The pin to get a resource object for |
- Returns
- The equivilant resource instance object for the provided pin.
◆ cyhal_utils_get_resource()
| const cyhal_resource_pin_mapping_t* cyhal_utils_get_resource |
( |
cyhal_gpio_t |
pin, |
|
|
const cyhal_resource_pin_mapping_t * |
mappings, |
|
|
size_t |
count |
|
) |
| |
Looks up the resource block that connects to the specified pins from the provided resource pin mapping table.
- Parameters
-
| [in] | pin | The pin to lookup the hardware block for |
| [in] | mappings | The mappings of pin to hardware block |
| [in] | count | The number of items in the mappings table |
- Returns
- The entry for the specified pin if it exists, or null if it doesn't.
◆ cyhal_utils_disconnect_and_free()
| void cyhal_utils_disconnect_and_free |
( |
cyhal_gpio_t |
pin | ) |
|
Disconnects any routing for the pin from the interconnect driver and then free's the pin from the hwmgr.
- Parameters
-
| [in] | pin | The pin to disconnect and free |