Functions | |
cy_en_gpio_status_t | Cy_GPIO_Pin_Init (GPIO_PRT_Type *base, uint32_t pinNum, const cy_stc_gpio_pin_config_t *config) |
Initializes all pin configuration settings for the specified pin. More... | |
cy_en_gpio_status_t | Cy_GPIO_Port_Init (GPIO_PRT_Type *base, const cy_stc_gpio_prt_config_t *config) |
Initialize a complete port of pins from a single init structure. More... | |
void | Cy_GPIO_Pin_FastInit (GPIO_PRT_Type *base, uint32_t pinNum, uint32_t driveMode, uint32_t outVal, en_hsiom_sel_t hsiom) |
Initialize the most common configuration settings for all pin types. More... | |
void | Cy_GPIO_Port_Deinit (GPIO_PRT_Type *base) |
Reset a complete port of pins back to power on reset defaults. More... | |
__STATIC_INLINE void | Cy_GPIO_SetHSIOM (GPIO_PRT_Type *base, uint32_t pinNum, en_hsiom_sel_t value) |
Configures the HSIOM connection to the pin. More... | |
__STATIC_INLINE en_hsiom_sel_t | Cy_GPIO_GetHSIOM (GPIO_PRT_Type *base, uint32_t pinNum) |
Returns the current HSIOM multiplexer connection to the pin. More... | |
__STATIC_INLINE GPIO_PRT_Type * | Cy_GPIO_PortToAddr (uint32_t portNum) |
Retrieves the port address based on the given port number. More... | |
cy_en_gpio_status_t Cy_GPIO_Pin_Init | ( | GPIO_PRT_Type * | base, |
uint32_t | pinNum, | ||
const cy_stc_gpio_pin_config_t * | config | ||
) |
Initializes all pin configuration settings for the specified pin.
base | Pointer to the pin's port register base address |
pinNum | Position of the pin bit-field within the port register |
config | Pointer to the pin config structure base address |
cy_en_gpio_status_t Cy_GPIO_Port_Init | ( | GPIO_PRT_Type * | base, |
const cy_stc_gpio_prt_config_t * | config | ||
) |
Initialize a complete port of pins from a single init structure.
The configuration structure used in this function has a 1:1 mapping to the GPIO and HSIOM registers. Refer to the device Technical Reference Manual (TRM) for the register details on how to populate them.
base | Pointer to the pin's port register base address |
config | Pointer to the pin config structure base address |
void Cy_GPIO_Pin_FastInit | ( | GPIO_PRT_Type * | base, |
uint32_t | pinNum, | ||
uint32_t | driveMode, | ||
uint32_t | outVal, | ||
en_hsiom_sel_t | hsiom | ||
) |
Initialize the most common configuration settings for all pin types.
These include, drive mode, initial output value, and HSIOM connection.
base | Pointer to the pin's port register base address |
pinNum | Position of the pin bit-field within the port register |
driveMode | Pin drive mode. Options are detailed in Pin drive mode macros |
outVal | Logic state of the output buffer driven to the pin (1 or 0) |
hsiom | HSIOM input selection |
void Cy_GPIO_Port_Deinit | ( | GPIO_PRT_Type * | base | ) |
Reset a complete port of pins back to power on reset defaults.
base | Pointer to the pin's port register base address |
__STATIC_INLINE void Cy_GPIO_SetHSIOM | ( | GPIO_PRT_Type * | base, |
uint32_t | pinNum, | ||
en_hsiom_sel_t | value | ||
) |
Configures the HSIOM connection to the pin.
Connects the specified High-Speed Input Output Multiplexer (HSIOM) selection to the pin.
base | Pointer to the pin's port register base address |
pinNum | Position of the pin bit-field within the port register |
value | HSIOM input selection |
__STATIC_INLINE en_hsiom_sel_t Cy_GPIO_GetHSIOM | ( | GPIO_PRT_Type * | base, |
uint32_t | pinNum | ||
) |
Returns the current HSIOM multiplexer connection to the pin.
base | Pointer to the pin's port register base address |
pinNum | Position of the pin bit-field within the port register |
__STATIC_INLINE GPIO_PRT_Type * Cy_GPIO_PortToAddr | ( | uint32_t | portNum | ) |
Retrieves the port address based on the given port number.
This is a helper function to calculate the port base address when given a port number. It is to be used when pin access needs to be calculated at runtime.
portNum | Port number |