This section describes the programming interface of the GPIO HAL driver.
|
void | GPIO_HAL_WritePinOutput (GPIO_Type *base, uint32_t pin, uint32_t output) |
| Sets the output level of the individual GPIO pin to logic 1 or 0. More...
|
|
static uint32_t | GPIO_HAL_ReadPinOutput (GPIO_Type *base, uint32_t pin) |
| Reads the current pin output. More...
|
|
static void | GPIO_HAL_SetPinOutput (GPIO_Type *base, uint32_t pin) |
| Sets the output level of the individual GPIO pin to logic 1. More...
|
|
static void | GPIO_HAL_ClearPinOutput (GPIO_Type *base, uint32_t pin) |
| Clears the output level of the individual GPIO pin to logic 0. More...
|
|
static void | GPIO_HAL_TogglePinOutput (GPIO_Type *base, uint32_t pin) |
| Reverses the current output logic of the individual GPIO pin. More...
|
|
static void | GPIO_HAL_WritePortOutput (GPIO_Type *base, uint32_t portOutput) |
| Sets the output of the GPIO port pins to a specific logic value. More...
|
|
static uint32_t | GPIO_HAL_ReadPortOutput (GPIO_Type *base) |
| Reads out all pin output status of the current port. More...
|
|
static void | GPIO_HAL_SetPortOutput (GPIO_Type *base, uint32_t portOutput) |
| Sets the output level of the GPIO port pins to logic 1. More...
|
|
static void | GPIO_HAL_ClearPortOutput (GPIO_Type *base, uint32_t portOutput) |
| Clears the output level of the GPIO port pins to logic 0. More...
|
|
static void | GPIO_HAL_TogglePortOutput (GPIO_Type *base, uint32_t portOutput) |
| Reverses the current output logic of the GPIO port pins. More...
|
|
Enumerator |
---|
kGpioDigitalInput |
Set current pin as digital input.
|
kGpioDigitalOutput |
Set current pin as digital output.
|
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
direction | GPIO directions
- kGpioDigitalInput: set to input
- kGpioDigitalOutput: set to output
|
static void GPIO_HAL_SetPortDir |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pinDirectionMap |
|
) |
| |
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer (PTA, PTB, PTC, etc.) |
pinDirectionMap | GPIO directions bit map
- 0: set to input
- 1: set to output
- LSB: pin 0
- MSB: pin 31
|
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
- Returns
- GPIO directions
- kGpioDigitalInput: corresponding pin is set to input.
- kGpioDigitalOutput: corresponding pin is set to output.
static uint32_t GPIO_HAL_GetPortDir |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
This function gets all 32-pin directions as a 32-bit integer.
- Parameters
-
base | GPIO base pointer (PTA, PTB, PTC, etc.) |
- Returns
- GPIO directions. Each bit represents one pin. For each bit:
- 0: corresponding pin is set to input
- 1: corresponding pin is set to output
- LSB: pin 0
- MSB: pin 31
void GPIO_HAL_WritePinOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin, |
|
|
uint32_t |
output |
|
) |
| |
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
output | pin output logic level |
static uint32_t GPIO_HAL_ReadPinOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | GPIO base pointer (PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
- Returns
- current pin output status. 0 - Low logic, 1 - High logic
static void GPIO_HAL_SetPinOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
static void GPIO_HAL_ClearPinOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
static void GPIO_HAL_TogglePinOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
static void GPIO_HAL_WritePortOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
portOutput |
|
) |
| |
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer (PTA, PTB, PTC, etc.) |
portOutput | data to configure the GPIO output. Each bit represents one pin. For each bit:
- 0: set logic level 0 to pin
- 1: set logic level 1 to pin
- LSB: pin 0
- MSB: pin 31
|
static uint32_t GPIO_HAL_ReadPortOutput |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer (PTA, PTB, PTC, etc.) |
- Returns
- current port output status. Each bit represents one pin. For each bit:
- 0: corresponding pin is outputting logic level 0
- 1: corresponding pin is outputting logic level 1
- LSB: pin 0
- MSB: pin 31
static void GPIO_HAL_SetPortOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
portOutput |
|
) |
| |
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
portOutput | GPIO output port pin mask. Each bit represents one pin. For each bit:
- 0: pin output will not be changed.
- 1: pin output will be set to logic level 1
- LSB: pin 0
- MSB: pin 31
|
static void GPIO_HAL_ClearPortOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
portOutput |
|
) |
| |
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
portOutput | mask of GPIO output pins. Each bit represents one pin. For each bit:
- 0: pin output will not be changed.
- 1: pin output will be set to logic level 0
- LSB: pin 0
- MSB: pin 31
|
static void GPIO_HAL_TogglePortOutput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
portOutput |
|
) |
| |
|
inlinestatic |
This function operates all 32 port pins.
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
portOutput | mask of GPIO output pins. Each bit represents one pin. For each bit:
- 0: pin output will not be changed.
- 1: pin output logic level will be reversed.
- LSB: pin 0
- MSB: pin 31
|
static uint32_t GPIO_HAL_ReadPinInput |
( |
GPIO_Type * |
base, |
|
|
uint32_t |
pin |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
pin | GPIO port pin number |
- Returns
- GPIO port input value
- 0: Pin logic level is 0, or is not configured for use by digital function.
- 1: Pin logic level is 1
static uint32_t GPIO_HAL_ReadPortInput |
( |
GPIO_Type * |
base | ) |
|
|
inlinestatic |
This function gets all 32-pin input as a 32-bit integer.
- Parameters
-
base | GPIO base pointer(PTA, PTB, PTC, etc.) |
- Returns
- GPIO port input data. Each bit represents one pin. For each bit:
- 0: Pin logic level is 0, or is not configured for use by digital function.
- 1: Pin logic level is 1.
- LSB: pin 0
- MSB: pin 31