This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
|
struct | gpio_config_t |
| GPIO Pin configuration covering all configurable fields when GPIO is configured in GPIO mode. More...
|
|
|
enum | gpio_pin_t {
kGPIO_Pin0 = (0x1U << 0U),
kGPIO_Pin1 = (0x1U << 1U),
kGPIO_Pin2 = (0x1U << 2U),
kGPIO_Pin3 = (0x1U << 3U),
kGPIO_Pin4 = (0x1U << 4U),
kGPIO_Pin5 = (0x1U << 5U),
kGPIO_Pin6 = (0x1U << 6U),
kGPIO_Pin7 = (0x1U << 7U),
kGPIO_Pin8 = (0x1U << 8U),
kGPIO_Pin9 = (0x1U << 9U),
kGPIO_Pin10 = (0x1U << 10U),
kGPIO_Pin11 = (0x1U << 11U),
kGPIO_Pin12 = (0x1U << 12U),
kGPIO_Pin13 = (0x1U << 13U),
kGPIO_Pin14 = (0x1U << 14U),
kGPIO_Pin15 = (0x1U << 15U)
} |
| GPIO Pin identifier with each pin get a unique bit thus they can be ORed. More...
|
|
enum | gpio_peripheral_mode_t {
kGPIO_ModeGpio = 0U,
kGPIO_ModePeripheral = 1U
} |
| GPIO Pin peripheral/gpio mode option. More...
|
|
enum | gpio_direction_t {
kGPIO_DigitalInput = 0U,
kGPIO_DigitalOutput = 1U
} |
| GPIO Pin input/output direction option. More...
|
|
enum | gpio_pull_mode_t {
kGPIO_PullDown = 0U,
kGPIO_PullUp = 1U,
kGPIO_PullDisable = 2U
} |
| GPIO Pin pull resistor mode option. More...
|
|
enum | gpio_output_mode_t {
kGPIO_OutputOpenDrain = 0U,
kGPIO_OutputPushPull = 1U
} |
| GPIO Pin output mode option. More...
|
|
enum | gpio_output_level_t {
kGPIO_OutputLow = 0U,
kGPIO_OutputHigh = 1U
} |
| GPIO Pin output High/Low level option. More...
|
|
enum | gpio_output_slew_rate_t {
kGPIO_SlewRateFast = 0U,
kGPIO_SlewRateSlow = 1U
} |
| GPIO Pin output Fast/Slow slew rate option. More...
|
|
enum | gpio_output_drive_strength_t {
kGPIO_DriveStrengthLow = 0U,
kGPIO_DriveStrengthHigh = 1U
} |
| GPIO Pin output High/Low drive strength option. More...
|
|
enum | gpio_interrupt_mode_t {
kGPIO_InterruptRisingEdge = 0x0U,
kGPIO_InterruptFallingEdge = 0x1U,
kGPIO_InterruptDisable = 0x2U
} |
| GPIO Pin interrupt detect option. More...
|
|
|
static void | GPIO_PinSetDirection (GPIO_Type *base, gpio_pin_t ePin, gpio_direction_t eDirection) |
| Configure the GPIO pin as Input or Output for one pin. More...
|
|
static void | GPIO_PinSetOutputMode (GPIO_Type *base, gpio_pin_t ePin, gpio_output_mode_t eOutMode) |
| Configure GPIO pin output as Push-Pull or Open-Drain for one pin. More...
|
|
static void | GPIO_PinSetDriveStrength (GPIO_Type *base, gpio_pin_t ePin, gpio_output_drive_strength_t eDriveStrength) |
| Configure High/Low drive strength when Pin is configured as output for one pin. More...
|
|
static void | GPIO_PinSetSlewRate (GPIO_Type *base, gpio_pin_t ePin, gpio_output_slew_rate_t eSlewRate) |
| Configure GPIO pin Fast/Slow slew rate when pin is configured as output. More...
|
|
static void | GPIO_PinSetPullResistorMode (GPIO_Type *base, gpio_pin_t ePin, gpio_pull_mode_t ePullMode) |
| Configure Pull resistor for GPIO pin to Disable/Pull-Up/Pull-Down. More...
|
|
|
static void | GPIO_PinWrite (GPIO_Type *base, gpio_pin_t ePin, gpio_output_level_t eOutput) |
| Set GPIO Pin as High/Low voltage level on Output. More...
|
|
static void | GPIO_PortSet (GPIO_Type *base, uint16_t u16Pins) |
| Set GPIO multiple pins output High voltage level without impact pins. More...
|
|
static void | GPIO_PinSet (GPIO_Type *base, gpio_pin_t ePin) |
| Output High voltage level for GPIO Pin when configured as Output. More...
|
|
static void | GPIO_PortClear (GPIO_Type *base, uint16_t u16Pins) |
| Set GPIO multiple pins belong to same PORT output Low voltage level when these pins are configured as output. More...
|
|
static void | GPIO_PinClear (GPIO_Type *base, gpio_pin_t ePin) |
| Output Low voltage level for GPIO Pin when configured as Output. More...
|
|
static void | GPIO_PortToggle (GPIO_Type *base, uint16_t u16Pins) |
| Toggle GPIO multiple pins belong to same PORT when these pins are configured as output. More...
|
|
static void | GPIO_PinToggle (GPIO_Type *base, gpio_pin_t ePin) |
| Toggle the GPIO output voltage level when configured as Output. More...
|
|
static uint16_t | GPIO_PortRead (GPIO_Type *base) |
| Read High/Low voltage level for multiple GPIO pins from the pin or the data bus. More...
|
|
static uint8_t | GPIO_PinRead (GPIO_Type *base, gpio_pin_t ePin) |
| Read High/Low voltage level for one GPIO pin from the pin or the data bus. More...
|
|
static uint16_t | GPIO_PortReadRawData (GPIO_Type *base) |
| Read Raw voltage high/low level data from the pins or peripheral bus for multiple pins belong to same PORT. More...
|
|
static uint8_t | GPIO_PinReadRawData (GPIO_Type *base, gpio_pin_t ePin) |
| Read Raw logic level data from the pins or peripheral bus for one pin. More...
|
|
|
static void | GPIO_PinSetInterruptConfig (GPIO_Type *base, gpio_pin_t ePin, gpio_interrupt_mode_t eIntConfig) |
| Configure GPIO Pin interrupt detection condition. More...
|
|
static void | GPIO_PortAssertSWInterrupts (GPIO_Type *base, uint16_t u16Pins) |
| Assert software interrupt for multiple pins belong to same port which will generate interrupt. More...
|
|
static void | GPIO_PortDeassertSWInterrupts (GPIO_Type *base, uint16_t u16Pins) |
| De-Assert software interrupt for multiple pins belong to same port which will stop generating interrupt. More...
|
|
static void | GPIO_PinAssertSWInterrupt (GPIO_Type *base, gpio_pin_t ePin) |
| Assert software interrupt for one pin which will generate interrupt. More...
|
|
static void | GPIO_PinDeassertSWInterrupt (GPIO_Type *base, gpio_pin_t ePin) |
| De-Assert software interrupt for one pin which will stop generating interrupt. More...
|
|
static void | GPIO_PortEnableInterrupts (GPIO_Type *base, uint16_t u16Pins) |
| Enable interrupt detection for multiple pins belong to same port. More...
|
|
static void | GPIO_PortDisableInterrupts (GPIO_Type *base, uint16_t u16Pins) |
| Disable interrupt detection for multiple pins belong to same port. More...
|
|
static void | GPIO_PinEnableInterrupt (GPIO_Type *base, gpio_pin_t ePin) |
| Enable interrupt detection for one pin. More...
|
|
static void | GPIO_PinDisableInterrupt (GPIO_Type *base, gpio_pin_t ePin) |
| Disable interrupt detection for one pin. More...
|
|
#define GPIO_MUX_ENUM_TO_PORT_INDEX |
( |
|
emux | ) |
(((uint16_t)(emux)&0xF00U) >> 0x08U) |
(GPIOA, GPIOB, GPIOC, and so on.) The fields located in bit 8 - bit 11.
#define GPIO_MUX_ENUM_TO_PIN_INDEX |
( |
|
emux | ) |
(((uint16_t)(emux)&0xF0U) >> 0x04U) |
The fields located in bit 4 - bit 7.
#define GPIO_MUX_ENUM_TO_REG_VALUE |
( |
|
emux | ) |
((uint16_t)(emux)&0x3U) |
The fields located in bit 0 - bit 1.
#define GPIO_MUX_ENUM_TO_PIN_MASK |
( |
|
emux | ) |
|
Value:
#define GPIO_MUX_ENUM_TO_PIN_INDEX(emux)
Helper MACRO function to extract Pin Index.
Definition: fsl_gpio.h:242
#define GPIO_MUX_ENUM_TO_PIN_VALUE |
( |
|
emux | ) |
|
Value:
#define GPIO_MUX_ENUM_TO_PIN_INDEX(emux)
Helper MACRO function to extract Pin Index.
Definition: fsl_gpio.h:242
#define GPIO_MUX_ENUM_TO_REG_VALUE(emux)
Helper MACRO function to extract Pin mux config register value.
Definition: fsl_gpio.h:245
Enumerator |
---|
kGPIO_Pin0 |
GPIO PORT Pin 0.
|
kGPIO_Pin1 |
GPIO PORT Pin 1.
|
kGPIO_Pin2 |
GPIO PORT Pin 2.
|
kGPIO_Pin3 |
GPIO PORT Pin 3.
|
kGPIO_Pin4 |
GPIO PORT Pin 4.
|
kGPIO_Pin5 |
GPIO PORT Pin 5.
|
kGPIO_Pin6 |
GPIO PORT Pin 6.
|
kGPIO_Pin7 |
GPIO PORT Pin 7.
|
kGPIO_Pin8 |
GPIO PORT Pin 8.
|
kGPIO_Pin9 |
GPIO PORT Pin 9.
|
kGPIO_Pin10 |
GPIO PORT Pin 10.
|
kGPIO_Pin11 |
GPIO PORT Pin 11.
|
kGPIO_Pin12 |
GPIO PORT Pin 12.
|
kGPIO_Pin13 |
GPIO PORT Pin 13.
|
kGPIO_Pin14 |
GPIO PORT Pin 14.
|
kGPIO_Pin15 |
GPIO PORT Pin 15.
|
Enumerator |
---|
kGPIO_ModeGpio |
Set GPIO pin as GPIO Mode.
|
kGPIO_ModePeripheral |
Set GPIO pin as Peripheral Mode.
|
Enumerator |
---|
kGPIO_DigitalInput |
Set GPIO pin as digital input.
|
kGPIO_DigitalOutput |
Set GPIO pin as digital output.
|
Enumerator |
---|
kGPIO_PullDown |
Internal pull-down resistor is enabled.
|
kGPIO_PullUp |
Internal pull-up resistor is enabled.
|
kGPIO_PullDisable |
Internal pull-up/down resistor is disabled.
|
Enumerator |
---|
kGPIO_OutputOpenDrain |
Open drain output mode.
|
kGPIO_OutputPushPull |
Push pull output mode.
|
Enumerator |
---|
kGPIO_OutputLow |
Set GPIO pin output low voltage level.
|
kGPIO_OutputHigh |
Set GPIO pin output high voltage level.
|
Enumerator |
---|
kGPIO_SlewRateFast |
Set GPIO pin output Fast slew rate.
|
kGPIO_SlewRateSlow |
Set GPIO pin output Slow slew rate.
|
Enumerator |
---|
kGPIO_DriveStrengthLow |
Set GPIO pin output Low-drive strength.
|
kGPIO_DriveStrengthHigh |
Set GPIO pin output High-drive strength.
|
Enumerator |
---|
kGPIO_InterruptRisingEdge |
Interrupt on rising edge.
|
kGPIO_InterruptFallingEdge |
Interrupt on falling edge.
|
kGPIO_InterruptDisable |
Interrupt is disabled.
|
To initialize the GPIO, define a pin configuration, as either input or output, in the user file. Then, call the GPIO_PinInit() function.
- Note
- If GPIO glitch is critical for your application, do not use this API instead using the API in GPIO pin configuration interfaces to do with the glitch during GPIO mode transition in accordance to your board design.
This is function to configure all GPIO Pin configurable fields.
- Parameters
-
base | GPIO peripheral base pointer (GPIOA, GPIOB, GPIOC, and so on.) |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
psConfig | GPIO pin configuration pointer |
Configure GPIO can be configured as Peripheral mode or GPIO mode for one pin.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eMode | Peripheral mode or GPIO mode for this pin. See _gpio_peripheral_mode |
static void GPIO_PinSetPeripheralMux |
( |
gpio_peripheral_mux_t |
eMux | ) |
|
|
inlinestatic |
Configure the MUX of GPIO pins to different peripheral functionality.
- Note
- User still need to call the GPIO_PinSetPeripheralMode.
- Parameters
-
eMux | GPIO peripheral MUX when configured as peripheral mode. See _gpio_peripheral_mux |
Configure the GPIO pin as Input or Output for one pin.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eDirection | Direction of GPIO pin. _gpio_direction |
Configure GPIO pin output as Push-Pull or Open-Drain. This function applies while pin is configured as output. See _gpio_direction and API GPIO_PinSetDirection.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eOutMode | Push-Pull/Open-Drain output mode. See _gpio_output_mode. |
Configure High/Low drive strength when Pin is configured as output. See _gpio_direction and API GPIO_PinSetDirection.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eDriveStrength | High/Low driver strength. See _gpio_output_drive_strength |
Configure GPIO pin Fast/Slow slew rate when pin is configured as output. See _gpio_direction and API GPIO_PinSetDirection.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eSlewRate | Fast/Slow slewrate. See _gpio_output_slew_rate |
Configure Pull resistor for GPIO pin to Disable/Pull-Up/Pull-Down.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
ePullMode | Pull Mode as Disable/Pull-Up/Pull-Down. See _gpio_pull_mode |
Set GPIO Pin as High/Low voltage level on Output.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eOutput | Output as High level or Low Level. See _gpio_output_level. |
static void GPIO_PortSet |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
Set GPIO multiple pins output High voltage level without impact other pins. Multiple pins are configured by OR enumerator from _gpio_pin
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PinSet |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Output High voltage level for GPIO Pin when configured as Output.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static void GPIO_PortClear |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
Set GPIO multiple pins belong to same PORT output Low voltage level when these pins are configured as output. Multiple pins are configured by ORing enumerators from _gpio_pin
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PinClear |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Output Low voltage level for GPIO Pin when configured as Output.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static void GPIO_PortToggle |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
Toggle GPIO multiple pins belong to same PORT when these pins are configured as output. Multiple pins are configured by ORing enumerators from _gpio_pin
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PinToggle |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Toggle the GPIO output voltage level when configured as Output.
- Note
- GPIO peripheral register do not get register to toggle directly. It is implemented by read back the GPIO output level and write to the register with reverted level.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static uint16_t GPIO_PortRead |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
Read High/Low voltage level for multiple GPIO pins from the pin if the pin is configured as input or the data bus. When the device comes out of reset, GPIO pins are configured as inputs with internal pull disabled. As a result, the reset value of this pin is undefined. For different PORT, the available pins number is different. User need use the return value to OR with the _gpio_pin to decide whether that pin is logic high or low.
* {
*
* }
* else
* {
*
* }
*
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
- Returns
- Voltage level for multiple GPIO pins from the pin or the data bus.
static uint8_t GPIO_PinRead |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Read High/Low voltage level from the pin if the pin is configured as input or the data bus.
- Note
- When the device comes out of reset, GPIO pins are configured as inputs with internal pull disabled. As a result, the reset value of this pin is undefined.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
- Return values
-
1 | Voltage level for one GPIO pin from the pin or the data bus is high. |
0 | Voltage level for one GPIO pin from the pin or the data bus is low. |
static uint16_t GPIO_PortReadRawData |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
Read Raw voltage high/low level data from the pins or peripheral bus. Values are not clocked and are subject to change at any time. Read several times to ensure a stable value. The reset value of this register depends on the default PIN state. User need use the return value to OR with the _gpio_pin to decide whether that pin is logic high or low.
* {
*
* }
* else
* {
*
* }
*
- Parameters
-
base | GPIO peripheral base pointer |
- Returns
- Voltage high/low level data from the pins or peripheral bus for multiple pins belong to same PORT.
static uint8_t GPIO_PinReadRawData |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Read Raw voltage high/low level data from the pins or peripheral bus. Values are not clocked and are subject to change at any time. Read several times to ensure a stable value. The reset value of this register depends on the default PIN state.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
- Return values
-
1 | Raw voltage level data from the pins or peripheral bus is high. |
0 | Raw voltage level data from the pins or peripheral bus is low. |
Configure GPIO Pin interrupt detection condition
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
eIntConfig | Interrupt detection condition for rising edge/down edge or no detection. See _gpio_interrupt_mode |
static void GPIO_PortAssertSWInterrupts |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
This API is only for software testing of a software interrupt capability. When the software interrupt is asserted, an interrupt is generated. The interrupt is generated continually until this software interrupt is de-asserted.
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PortDeassertSWInterrupts |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
This API is only for software testing of a software interrupt capability.
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PinAssertSWInterrupt |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
This API is only for software testing of a software interrupt capability. When the software interrupt is asserted, an interrupt is generated. The interrupt is generated continually until this software interrupt is de-asserted.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static void GPIO_PinDeassertSWInterrupt |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
This API is only for software testing of a software interrupt capability.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static void GPIO_PortEnableInterrupts |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
This API is to enable interrupt detection on rising edge or falling edge.
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PortDisableInterrupts |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
This API is to disable interrupt detection on rising edge or falling edge.
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static void GPIO_PinEnableInterrupt |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
This API is to enable interrupt detection on rising edge or falling edge.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static void GPIO_PinDisableInterrupt |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
This API is to disable interrupt detection on rising edge or falling edge.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
static uint16_t GPIO_PortGetInterruptPendingStatusFlags |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
Get interrupt pending status flags for all pins belong to same port. User need to use the _gpio_pin_t to OR with the return value, if the result is not 0, this flag is set. otherwise, this flag is not set.
- Note
- this flags can only be cleared by calling GPIO_PortClearEdgeDetectedStatusFlag if it is caused by edge detected or by calling GPIO_PortEnableSWInterrupt if it is caused by SW interrupt.
* {
*
* }
* else
* {
*
* }
*
- Parameters
-
base | GPIO peripheral base pointer |
- Returns
- Interrupt pending status flags all pins belong to same port.
static uint16_t GPIO_PinGetInterruptPendingStatusFlags |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Get interrupt pending status flags for one pin.
- Note
- this flags can only be cleared by calling GPIO_PortClearEdgeDetectedStatusFlag if it is caused by edge detected or by calling GPIO_PortEnableSWInterrupt if it is caused by SW interrupt.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
- Return values
-
1 | Interrupt occurred. |
0 | No Interrupt. |
static uint16_t GPIO_PortGetEdgeDetectedStatusFlags |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
Get edge detected status flags for all pins in the PORT. This status flag can only be detected when interrupt detection is enabled by GPIO_PortEnableInterrupt or GPIO_PinEnableInterrupt.
* {
*
* }
* else
* {
*
* }
*
- Parameters
-
base | GPIO peripheral base pointer |
- Returns
- Detected edge status flags for all pins belong to same port.
static uint8_t GPIO_PinGetEdgeDetectedStatusFlag |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Get edge detected status flags for one pin. This status flag can only be detected when interrupt detection is enabled by GPIO_PortEnableInterrupt or GPIO_PinEnableInterrupt.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |
- Return values
-
1 | An edge detected. |
0 | No edge detected. |
static uint16_t GPIO_PortClearEdgeDetectedStatusFlags |
( |
GPIO_Type * |
base, |
|
|
uint16_t |
u16Pins |
|
) |
| |
|
inlinestatic |
Clear Edge Detected status flags for multiple pins belong to same port.
- Parameters
-
base | GPIO peripheral base pointer |
u16Pins | GPIO pins which is ORed by _gpio_pin. # kGPIO_Pin0 | kGPIO_Pin3 means Pin 0 and Pin 3. |
static uint16_t GPIO_PinClearEdgeDetectedStatusFlags |
( |
GPIO_Type * |
base, |
|
|
gpio_pin_t |
ePin |
|
) |
| |
|
inlinestatic |
Clear Edge Detected status flags for one pin.
- Parameters
-
base | GPIO peripheral base pointer |
ePin | GPIO pin identifier. User enumerator provided by _gpio_pin. Note that not all Pins existed in SoC and user need to check the data sheet. |