2.49 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

NameDescription
GPIO_InitializeInitialize the GPIO library
GPIO_PortReadRead all the I/O lines of the selected port port
GPIO_PortWriteWrite the value on the masked I/O lines of the selected port
GPIO_PortLatchReadRead the latch register value of the selected I/O port
GPIO_PortSetSet the selected IO pins of a port
GPIO_PortClearClear the selected IO pins of a port
GPIO_PortToggleToggles the selected IO pins of a port
GPIO_PortInputEnableEnables selected IO pins of a port as input
GPIO_PortOutputEnableEnables selected IO pins of a port as output(s)
GPIO_PortInterruptEnableEnables IO interrupt on selected IO pins of a port
GPIO_PortInterruptDisableDisables IO interrupt on selected IO pins of a port
GPIO_PinInterruptEnableEnables CN interrupt on selected change notice pins
GPIO_PinInterruptDisableDisables CN interrupt on selected change notice pins
GPIO_PinWriteSet the logic level of the selected pin
GPIO_PinReadRead the selected pin value
GPIO_PinLatchReadRead the value driven on the selected pin
GPIO_PinDirConfigSets the direction of the given GPIO Pin
GPIO_PinInputEnableEnables the input mode of the given GPIO Pin
GPIO_PinInputDisableDisables the input mode of the given GPIO Pin
GPIO_PinInputConfigEnables or disables input on the given GPIO pin
GPIO_PinGroupOutputEnableEnables the group output of the given GPIO pin
GPIO_PinGroupOutputDisableDisables the group output of the given GPIO pin
GPIO_PinGroupOutputConfigEither enables or disables control of the GPIO pin using the Group output register
GPIO_PinToggleToggles the selected pin
GPIO_PinSetSets the selected pin
GPIO_PinClearClears the selected pin
GPIO_PinInputEnableEnables selected IO pin as Digital input
GPIO_PinOutputEnableEnables selected IO pin as Digital output
GPIO_PinInterruptEnableEnables IO interrupt on selected IO pin
GPIO_PinInterruptDisableDisables IO interrupt on selected IO pin
GPIO_PinIntEnableEnables IO interrupt on selected IO pin
GPIO_PinIntDisableDisables IO interrupt on selected IO pin
GPIO_GroupSetSets the value in the given Group output register
GPIO_GroupClearClears the value in the given Group output register
GPIO_GroupToggleToggles the value in the given Group output register
GPIO_GroupReadReturns the state of the pins in the given GPIO group
GPIO_GroupPinSetSets the value of the given pin in the Group output register
GPIO_GroupPinClearClears the value of the given pin in the Group output register
GPIO_GroupPinToggleToggles the value of the given pin in the Group output register
GPIO_GroupPinReadReturns the value of the given pin by reading it from the Group GPIO input register
vGPIO_PinMUXConfigConfigures the signal function on the given pin
GPIO_PinPolarityConfigConfigures the polarity of the given GPIO pin
GPIO_PinOuputBufferTypeConfigConfigures the buffer type of the given GPIO pin
GPIO_PinPullUpPullDownConfigConfigures the pull type on the given GPIO pin
GPIO_PinSlewRateConfigConfigures the slew rate on the given GPIO pin
GPIO_PinIntDetectConfigConfigures the event that generates interrupt on the GPIO pin
GPIO_PinPwrGateConfigConfigures the power well to use for the given GPIO pin
GPIO_DrvStrConfigConfigures the drive strength on the given GPIO pin
GPIO_PropertySetConfigures various parameters of the given GPIO pin
GPIO_PinInterruptCallbackRegisterAllows application to register callback for every pin

Data types and constants

NameTypeDescription
GPIO_ALT_OUTEnumThis enum is used to specify whether to enable alternate output for a GPIO pin
GPIO_DIREnumThis enum is used to specify the GPIO pin direction
GPIO_DRVEnumThis enum is used to specify the pin drive strength
GPIO_FUNCTIONEnumThis enum is used to specify the GPIO pin function
GPIO_GROUPEnumIdentifies the available GPIO groups
GPIO_INP_READEnumThis enum is used to enable or disable input for a pin
GPIO_INTDET_TYPEEnumThis enum is used to specify the interrupt detect event type
GPIO_OUTPUT_BUFFER_TYPEEnumThis enum is used to specify the pin output buffer type
GPIO_POLARITYEnumThis enum is used to specify the pin polarity
GPIO_PROPERTYEnumThis enum is used to specify the property of the pin to set
GPIO_PULL_TYPEEnumThis enum is used to specify the pin pull type
GPIO_PWRGATEEnumThis enum is used to specify the power well for the pin
GPIO_SLEW_RATEEnumThis enum is used to specify the pin slew rate type
GPIO_PORTEnumIdentifies the available GPIO Ports
GPIO_PINEnumIdentifies the available GPIO port pins
CN_PINEnumIdentifies the available Change Notice pins
GPIO_INTERRUPT_STYLEEnumIdentifies different GPIO interrupt types
GPIO_PIN_CALLBACKTypedefPointer to a GPIO Pin-Event handler function
Note: Not all APIs maybe implemented. See the specific device family section for available APIs.