2.51 General Purpose I/O (GPIO)
This Plib implements software abstraction for GPIO Peripheral.
Library Interface
General Purpose I/O peripheral library provides the following interfaces:
Functions
| Name | Description |
|---|---|
| GPIO_Initialize | Initialize the GPIO library |
| GPIO_PortRead | Read all the I/O lines of the selected port port |
| GPIO_PortWrite | Write the value on the masked I/O lines of the selected port |
| GPIO_PortLatchRead | Read the latch register value of the selected I/O port |
| GPIO_PortSet | Set the selected IO pins of a port |
| GPIO_PortClear | Clear the selected IO pins of a port |
| GPIO_PortToggle | Toggles the selected IO pins of a port |
| GPIO_PortInputEnable | Enables selected IO pins of a port as input |
| GPIO_PortOutputEnable | Enables selected IO pins of a port as output(s) |
| GPIO_PortInterruptEnable | Enables IO interrupt on selected IO pins of a port |
| GPIO_PortInterruptDisable | Disables IO interrupt on selected IO pins of a port |
| GPIO_PinInterruptEnable | Enables CN interrupt on selected change notice pins |
| GPIO_PinInterruptDisable | Disables CN interrupt on selected change notice pins |
| GPIO_PinWrite | Set the logic level of the selected pin |
| GPIO_PinRead | Read the selected pin value |
| GPIO_PinLatchRead | Read the value driven on the selected pin |
| GPIO_PinDirConfig | Sets the direction of the given GPIO Pin |
| GPIO_PinInputEnable | Enables the input mode of the given GPIO Pin |
| GPIO_PinInputDisable | Disables the input mode of the given GPIO Pin |
| GPIO_PinInputConfig | Enables or disables input on the given GPIO pin |
| GPIO_PinGroupOutputEnable | Enables the group output of the given GPIO pin |
| GPIO_PinGroupOutputDisable | Disables the group output of the given GPIO pin |
| GPIO_PinGroupOutputConfig | Either enables or disables control of the GPIO pin using the Group output register |
| GPIO_PinToggle | Toggles the selected pin |
| GPIO_PinSet | Sets the selected pin |
| GPIO_PinClear | Clears the selected pin |
| GPIO_PinInputEnable | Enables selected IO pin as Digital input |
| GPIO_PinOutputEnable | Enables selected IO pin as Digital output |
| GPIO_PinInterruptEnable | Enables IO interrupt on selected IO pin |
| GPIO_PinInterruptDisable | Disables IO interrupt on selected IO pin |
| GPIO_PinIntEnable | Enables IO interrupt on selected IO pin |
| GPIO_PinIntDisable | Disables IO interrupt on selected IO pin |
| GPIO_GroupSet | Sets the value in the given Group output register |
| GPIO_GroupClear | Clears the value in the given Group output register |
| GPIO_GroupToggle | Toggles the value in the given Group output register |
| GPIO_GroupRead | Returns the state of the pins in the given GPIO group |
| GPIO_GroupPinSet | Sets the value of the given pin in the Group output register |
| GPIO_GroupPinClear | Clears the value of the given pin in the Group output register |
| GPIO_GroupPinToggle | Toggles the value of the given pin in the Group output register |
| GPIO_GroupPinRead | Returns the value of the given pin by reading it from the Group GPIO input register |
| vGPIO_PinMUXConfig | Configures the signal function on the given pin |
| GPIO_PinPolarityConfig | Configures the polarity of the given GPIO pin |
| GPIO_PinOuputBufferTypeConfig | Configures the buffer type of the given GPIO pin |
| GPIO_PinPullUpPullDownConfig | Configures the pull type on the given GPIO pin |
| GPIO_PinSlewRateConfig | Configures the slew rate on the given GPIO pin |
| GPIO_PinIntDetectConfig | Configures the event that generates interrupt on the GPIO pin |
| GPIO_PinPwrGateConfig | Configures the power well to use for the given GPIO pin |
| GPIO_DrvStrConfig | Configures the drive strength on the given GPIO pin |
| GPIO_PropertySet | Configures various parameters of the given GPIO pin |
| GPIO_PinInterruptCallbackRegister | Allows application to register callback for every pin |
Data types and constants
| Name | Type | Description |
|---|---|---|
| GPIO_ALT_OUT | Enum | This enum is used to specify whether to enable alternate output for a GPIO pin |
| GPIO_DIR | Enum | This enum is used to specify the GPIO pin direction |
| GPIO_DRV | Enum | This enum is used to specify the pin drive strength |
| GPIO_FUNCTION | Enum | This enum is used to specify the GPIO pin function |
| GPIO_GROUP | Enum | Identifies the available GPIO groups |
| GPIO_INP_READ | Enum | This enum is used to enable or disable input for a pin |
| GPIO_INTDET_TYPE | Enum | This enum is used to specify the interrupt detect event type |
| GPIO_OUTPUT_BUFFER_TYPE | Enum | This enum is used to specify the pin output buffer type |
| GPIO_POLARITY | Enum | This enum is used to specify the pin polarity |
| GPIO_PROPERTY | Enum | This enum is used to specify the property of the pin to set |
| GPIO_PULL_TYPE | Enum | This enum is used to specify the pin pull type |
| GPIO_PWRGATE | Enum | This enum is used to specify the power well for the pin |
| GPIO_SLEW_RATE | Enum | This enum is used to specify the pin slew rate type |
| GPIO_PORT | Enum | Identifies the available GPIO Ports |
| GPIO_PIN | Enum | Identifies the available GPIO port pins |
| CN_PIN | Enum | Identifies the available Change Notice pins |
| GPIO_INTERRUPT_STYLE | Enum | Identifies different GPIO interrupt types |
| GPIO_PIN_CALLBACK | Typedef | Pointer to a GPIO Pin-Event handler function |
Note: Not all APIs maybe implemented. See the specific device family
section for available APIs.
