GPIO Driver API/interface file.
The GIO module supports up to eight 8-bit ports for a total of up to 64 GIO terminals. Each of these 64 terminals can be independently configured as input or output.
Go to the source code of this file.
Macros | |
#define | GPIO_MAX_PORT (8U) |
This is the maximum number of ports. More... | |
#define | GPIO_MAX_INTERRUPT_PORT (4U) |
This is the maximum number of interrupt ports which can be supported. Only Ports A, B, C and D are capable of interrupts. More... | |
#define | GPIO_MAX_PINS_PER_PORT (8U) |
This is the maximum number of pins per GPIO port This is a system limit on the GPIO IP Block. More... | |
#define | GPIO_MAX_PINS (GPIO_MAX_PORT * GPIO_MAX_PINS_PER_PORT) |
Maximum number of pins More... | |
#define | GPIO_MAX_INTERRUPT (GPIO_MAX_INTERRUPT_PORT * GPIO_MAX_PINS_PER_PORT) |
This is the maximum number of interrupts which can be supported. Only Ports A, B, C and D are capable of interrupts. Also since each port can have a maximum of 8 pins this is the maximum number of interrupts which can be supported. More... | |
#define | GPIO_GET_PIN_OFFSET(pinNum) (((uint32_t)pinNum) % (GPIO_MAX_PORT * GPIO_MAX_PINS_PER_PORT)) |
Returns the GPIO pin offset based on pin number. More... | |
#define | GPIO_GET_PORT_NUM(pinNum) ((GPIO_GET_PIN_OFFSET(pinNum)) / GPIO_MAX_PINS_PER_PORT) |
Returns the GPIO port number based on pin number. More... | |
#define | GPIO_GET_PIN_INDEX(pinNum) ((GPIO_GET_PIN_OFFSET(pinNum)) % GPIO_MAX_PINS_PER_PORT) |
Returns the pin Index based on pin number. More... | |
GPIO Pin Value | |
#define | GPIO_PIN_LOW (0U) |
GPIO pin is at logic low. More... | |
#define | GPIO_PIN_HIGH (1U) |
GPIO pin is at logic high. More... | |
GPIO Direction | |
#define | GPIO_DIRECTION_OUTPUT (1U) |
Set GPIO direction as output. More... | |
#define | GPIO_DIRECTION_INPUT (0U) |
Set GPIO direction as input. More... | |
GPIO OpenDrain | |
#define | GPIO_OPEN_DRAIN_ENABLE (1U) |
GPIO OpenDrain Enable. More... | |
#define | GPIO_OPEN_DRAIN_DISABLE (0U) |
GPIO OpenDrain Disable. More... | |
GPIO Trigger Type | |
#define | GPIO_TRIG_TYPE_NONE (0U) |
No interrupt request on either rising or falling edges on the pin. More... | |
#define | GPIO_TRIG_TYPE_RISE_EDGE (1U) |
Interrupt request on occurrence of a rising edge on the input pin. More... | |
#define | GPIO_TRIG_TYPE_FALL_EDGE (2U) |
Interrupt request on occurrence of a falling edge on the input pin. More... | |
#define | GPIO_TRIG_TYPE_BOTH_EDGE (3U) |
Interrupt request on occurrence of a rising/falling edge on the input pin. More... | |
GPIO Interrupt Level | |
#define | GPIO_INTR_LEVEL_LOW (0U) |
GPIO low interrupt level. More... | |
#define | GPIO_INTR_LEVEL_HIGH (1U) |
GPIO high interrupt level. More... | |
Functions | |
void | GPIO_moduleEnable (uint32_t baseAddr) |
This API performs the module enable of the GPIO module. More... | |
int32_t | GPIO_ignoreOrHonorPolarity (uint32_t baseAddr, uint32_t pinNum, uint32_t polLevel) |
The function is used to configure the GPIO Pin to ignore or honor polarity. More... | |
int32_t | GPIO_setTrigType (uint32_t baseAddr, uint32_t pinNum, uint32_t polLevel) |
The function is used to configure the GPIO Pin to control the interrupt polarity. More... | |
int32_t | GPIO_enableInterrupt (uint32_t baseAddr, uint32_t pinNum) |
The function is used to enable the interrupt on the GPIO Pin. More... | |
int32_t | GPIO_disableInterrupt (uint32_t baseAddr, uint32_t pinNum) |
The function is used to disable the interrupt on the GPIO Pin. More... | |
int32_t | GPIO_clearInterrupt (uint32_t baseAddr, uint32_t pinNum) |
The function is used to clear the interrupt on the GPIO Pin. More... | |
int32_t | GPIO_markHighLowLevelInterrupt (uint32_t baseAddr, uint32_t pinNum, uint32_t interruptLevel) |
The function is used to mark the interrupt as high level or low level for the specific GPIO Pin. More... | |
uint32_t | GPIO_getHighLowLevelPendingInterrupt (uint32_t baseAddr, uint32_t interruptLevel) |
The function is used to get the high level or low level interrupt pending. The driver will need to cycle through all the pending interrupts before the processing of the interrupt is over. More... | |
void | GPIO_setDirMode (uint32_t baseAddr, uint32_t pinNum, uint32_t pinDir) |
The function is used to set the output data direction associated with a GPIO Pin. More... | |
uint32_t | GPIO_pinRead (uint32_t baseAddr, uint32_t pinNum) |
The function is used to get the data input for a specific GPIO Port/Pin. More... | |
void | GPIO_pinWriteHigh (uint32_t baseAddr, uint32_t pinNum) |
The function is used to write logic HIGH state to a to a specific GPIO Pin. More... | |
void | GPIO_pinWriteLow (uint32_t baseAddr, uint32_t pinNum) |
The function is used to write logic LOW state to a specific GPIO Port/Pin. More... | |
void | GPIO_setOpenDrainStatus (uint32_t baseAddr, uint32_t pinNum, uint32_t openDrainStatus) |
The function is used to enable/disable open drain functionality for a specific GPIO Port/Pin. This function is applicable for GPIO pins which are configured as output. More... | |