The GPIO driver provides an API to configure and access the device Input/Output pins. More...
Modules | |
Macros | |
Functions | |
Data Structures | |
Enumerated Types | |
The GPIO driver provides an API to configure and access the device Input/Output pins.
The Peripheral Driver Library(PDL) GPIO functions and other declarations used in this driver are located in cy_gpio.h. You can optionally include cy_pdl.h to get access to all the functions and declarations in the PDL.
IO pins include all general purpose types such as GPIO, HSIO, AUXIO, and their variants.
Initialization can be performed either at the port level or by configuring individual pins. Use the port configuration to efficiently use the code space. For the list of supported ports and pins, refer to the product device header files
Once the pin/port initialization is complete, each pin can be accessed by specifying the port (GPIO_PRT_Type) and the pin (0-7) in the provided API functions.
If multiple pins on a port are updated at the same time, using direct port register writes with an appropriate port mask is more efficient than using the PDL single-pin functions. An example is shown below. Highlighted - different ways of configuring Port 1 pins using:
Refer to the technical reference manual (TRM) and the device datasheet.
Version | Changes | Reason for Change |
---|---|---|
3.0 | Fixed Cy_GPIO_MscControlEnable() and Cy_GPIO_MscControlDisable() implementation. | Defect fix. |
Removed reserved fields from cy_stc_gpio_prt_config_t and cy_stc_gpio_pin_config_t. | Memory usage optimization. | |
2.0 | Fixed Cy_GPIO_Pin_Init() to configure input buffer voltage trip and output buffer slew rate properly. | Defect fix. |
Update the paths to the code snippets. | PDL structure update. | |
Minor documentation updates. Code snippets were updated. | Documentation enhancement. | |
Added functions for altering MSCV3LP IP block control for supported devices. | Driver enhancement. | |
1.20 | Added Cy_GPIO_AmuxPumpEnable(), Cy_GPIO_AmuxPumpDisable, and Cy_GPIO_AmuxPumpIsEnabled() function. | The AMUXBUS charge pump support. For detail, refer to the device TRM. |
1.10 | Removed SIO functions. Structures cy_stc_gpio_prt_config_t and cy_stc_gpio_pin_config_t updated to drop SIO features. | No hardware support for removed features. |
Minor documentation updates. | Documentation enhancement. | |
1.0 | Initial version |