![]() |
PDK API Guide for J721E
|
Sub Modules | |
GPIO AUX | |
Files | |
file | gpio.h |
File provides functional level API prototypes for GPIO interface. | |
Data Structures | |
struct | gpioContext_t |
Structure holding the GPIO context. More... | |
Functions | |
void | GPIOSetDirMode_v0 (uint32_t baseAddr, uint32_t pinNumber, uint32_t pinDirection) |
This API configures the direction of a specified GPIO pin as being either input or output. More... | |
void | GPIOPinWrite_v0 (uint32_t baseAddr, uint32_t pinNumber, uint32_t pinValue) |
This API drives an output GPIO pin to a logic HIGH or a logic LOW state. More... | |
uint32_t | GPIOPinRead_v0 (uint32_t baseAddr, uint32_t pinNumber) |
This API determines the logic level(value) on a specified GPIO pin. More... | |
uint32_t | GPIOPinOutValueRead_v0 (uint32_t baseAddr, uint32_t pinNumber) |
This API determines the output logic level(value) on a specified GPIO pin. More... | |
void | GPIOSetIntrType_v0 (uint32_t baseAddr, uint32_t pinNumber, uint32_t eventType) |
This API configures the event type for a specified input GPIO pin. Whenever the selected event occurs on that GPIO pin and if interrupt generation is enabled for that pin, the GPIO module will send an interrupt to CPU. More... | |
void | GPIOIntrEnable_v0 (uint32_t baseAddr, uint32_t pinNumber, uint32_t eventType) |
This API enables the configured interrupt event on a specified input GPIO pin to trigger an interrupt request. More... | |
void | GPIOIntrDisable_v0 (uint32_t baseAddr, uint32_t pinNumber) |
This API disables interrupt generation due to the detection of any event on a specified input GPIO pin. More... | |
uint32_t | GPIOIntrStatus_v0 (uint32_t baseAddr, uint32_t pinNumber) |
This API determines the enabled interrupt status of a specified pin. More... | |
void | GPIOIntrStatusMask_v0 (uint32_t baseAddr, uint32_t bankIdx, uint32_t *intrStatusMask) |
This API determines the enabled interrupt status of a specified pin. More... | |
void | GPIOIntrClear_v0 (uint32_t baseAddr, uint32_t pinNumber) |
This API clears the enabled interrupt status of a specified GPIO pin. More... | |
void | GPIOIntrClearMask_v0 (uint32_t baseAddr, uint32_t bankIdx, uint32_t pinMask) |
This API clears the enabled interrupt status of specified GPIO pins. More... | |
Macros | |
#define | GPIO_PIN_LOW (0x0U) |
GPIO pin is at logic low. More... | |
#define | GPIO_PIN_HIGH (0x1U) |
GPIO pin is at logic high. More... | |
#define | GPIO_OE_OUTPUTEN_N_ENABLED (0U) |
Macro to configure GPIO pin as output. More... | |
#define | GPIO_OE_OUTPUTEN_N_DISABLED (1U) |
Macro to configure GPIO pin as input. More... | |
#define | GPIO_PIN_MASK_ALL 0xFF |
Mask for all pins of single gpio port. More... | |
GPIO Interrupt mask | |
typedef uint32_t | gpioIntrMask_t |
Enumerates the possible GPIO interrupt generation events. More... | |
#define | GPIO_INTR_MASK_NO_EDGE (0x01U) |
#define | GPIO_INTR_MASK_RISE_EDGE (0x02U) |
#define | GPIO_INTR_MASK_FALL_EDGE (0x04U) |
#define | GPIO_INTR_MASK_BOTH_EDGE (0x08U) |
GPIO Direction | |
typedef uint32_t | gpioDirection_t |
Enumerates the direction of GPIO pin. More... | |
#define | GPIO_DIRECTION_INPUT (GPIO_OE_OUTPUTEN_N_DISABLED) |
#define | GPIO_DIRECTION_OUTPUT (GPIO_OE_OUTPUTEN_N_ENABLED) |
#define GPIO_PIN_LOW (0x0U) |
GPIO pin is at logic low.
#define GPIO_PIN_HIGH (0x1U) |
GPIO pin is at logic high.
#define GPIO_OE_OUTPUTEN_N_ENABLED (0U) |
Macro to configure GPIO pin as output.
#define GPIO_OE_OUTPUTEN_N_DISABLED (1U) |
Macro to configure GPIO pin as input.
#define GPIO_PIN_MASK_ALL 0xFF |
Mask for all pins of single gpio port.
#define GPIO_INTR_MASK_NO_EDGE (0x01U) |
No interrupt request on either rising or falling edges on the pin.
#define GPIO_INTR_MASK_RISE_EDGE (0x02U) |
Interrupt request on occurrence of a rising edge on the input GPIO pin.
#define GPIO_INTR_MASK_FALL_EDGE (0x04U) |
Interrupt request on occurrence of a falling edge on the input GPIO pin.
#define GPIO_INTR_MASK_BOTH_EDGE (0x08U) |
Interrupt request on occurrence of both a rising and a falling edge on the pin.
#define GPIO_DIRECTION_INPUT (GPIO_OE_OUTPUTEN_N_DISABLED) |
Input pin.
#define GPIO_DIRECTION_OUTPUT (GPIO_OE_OUTPUTEN_N_ENABLED) |
Output pin.
typedef uint32_t gpioIntrMask_t |
Enumerates the possible GPIO interrupt generation events.
typedef uint32_t gpioDirection_t |
Enumerates the direction of GPIO pin.
void GPIOSetDirMode_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber, | ||
uint32_t | pinDirection | ||
) |
This API configures the direction of a specified GPIO pin as being either input or output.
baseAddr | The memory address of the GPIO instance being used. |
pinNumber | The number of the pin in the GPIO instance. 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63). |
pinDirection | The required direction for the GPIO pin. pinDirection' can take one of the value from the following enum: |
void GPIOPinWrite_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber, | ||
uint32_t | pinValue | ||
) |
This API drives an output GPIO pin to a logic HIGH or a logic LOW state.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63). |
pinValue | This specifies whether a logic HIGH or a logic LOW should be driven on the output pin. 'pinValue' can take one of the following values:
|
uint32_t GPIOPinRead_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber | ||
) |
This API determines the logic level(value) on a specified GPIO pin.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
GPIO_PIN_LOW | - indicating to drive a logic LOW(0) on the pin. |
GPIO_PIN_HIGH | - indicating to drive a logic HIGH(1) on the pin. |
uint32_t GPIOPinOutValueRead_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber | ||
) |
This API determines the output logic level(value) on a specified GPIO pin.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
GPIO_PIN_LOW | - indicating to drive a logic LOW(0) on the pin. |
GPIO_PIN_HIGH | - indicating to drive a logic HIGH(1) on the pin. |
void GPIOSetIntrType_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber, | ||
uint32_t | eventType | ||
) |
This API configures the event type for a specified input GPIO pin. Whenever the selected event occurs on that GPIO pin and if interrupt generation is enabled for that pin, the GPIO module will send an interrupt to CPU.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63). |
eventType | This specifies the event type on whose detection, the GPIO module will send an interrupt to CPU, provided interrupt generation for that pin is enabled. 'eventType' can take one of the following values following enum:
|
void GPIOIntrEnable_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber, | ||
uint32_t | eventType | ||
) |
This API enables the configured interrupt event on a specified input GPIO pin to trigger an interrupt request.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
eventType | This specifies the event type on whose detection, the GPIO module will send an interrupt to CPU, provided interrupt generation for that pin is enabled. 'eventType' can take one of the following values following enum:
|
void GPIOIntrDisable_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber | ||
) |
This API disables interrupt generation due to the detection of any event on a specified input GPIO pin.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
uint32_t GPIOIntrStatus_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber | ||
) |
This API determines the enabled interrupt status of a specified pin.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
int_status | The enabled interrupt status of the pin on the specified interrupt line. This could either be a non-zero or a zero value. |
void GPIOIntrStatusMask_v0 | ( | uint32_t | baseAddr, |
uint32_t | bankIdx, | ||
uint32_t * | intrStatusMask | ||
) |
This API determines the enabled interrupt status of a specified pin.
baseAddr | The memory address of the GPIO instance being used |
bankIdx | Bank index of the GPIO instance |
intrStatusMask | pointer of the interrupt status for the GPIO bank |
void GPIOIntrClear_v0 | ( | uint32_t | baseAddr, |
uint32_t | pinNumber | ||
) |
This API clears the enabled interrupt status of a specified GPIO pin.
baseAddr | The memory address of the GPIO instance being used |
pinNumber | The number of the pin in the GPIO instance 'pinNumber' can take one of the following values: (0 <= pinNumber <= 63) |
void GPIOIntrClearMask_v0 | ( | uint32_t | baseAddr, |
uint32_t | bankIdx, | ||
uint32_t | pinMask | ||
) |
This API clears the enabled interrupt status of specified GPIO pins.
baseAddr | The memory address of the GPIO instance being used |
bankIdx | Bank index of the GPIO instance |
pinMask | Mask of pins whose interrupts need to be cleared for the GPIO bank. |