|
static uint32_t | GpioUnpackPin (uint32_t Pin) |
| Name: GpioUnpackPin
Converts packed pin number to the format, accepted by hardware blocks. More...
|
|
|
void | GpioInit (void) |
| Name: GpioInit
Initializes ports to default values based on port-init.h.
|
|
static void | GpioPinConfig (unsigned Pin, enum gpio_mode_t Mode) |
| Name: GpioPinConfig
Configures a GPIO pin to the desired mode, sets value for the pin. More...
|
|
static bool | GpioPinGet (unsigned Pin) |
| Name: GpioPinGet
Reads the pad value for a single pin in a GPIO port. More...
|
|
static void | GpioPinClear (unsigned Pin) |
| Name: GpioPinClear
Sets the pad value for a single pin in a GPIO port to 0. More...
|
|
static void | GpioPinSet (unsigned Pin) |
| Name: GpioPinSet
Sets the pad value for a single pin in a GPIO port to 1. More...
|
|
static void | GpioPinToggle (unsigned Pin) |
| Name: GpioPinToggle
Toggles a single pin in a GPIO port. More...
|
|
static void | GpioPinSetValue (unsigned Pin, bool Value) |
| Name: GpioPinSetValue
Sets the pad value for a single pin in a GPIO port to the value provided. More...
|
|
static uint32_t | GpioPortGet (void) |
| Name: GpioPortGet
Reads the pad values for all the pins in a GPIO port. More...
|
|
static void | GpioPortClear (uint32_t Mask) |
| Name: GpioPortClear
Sets the pad values for pins specified by a mask to 0. More...
|
|
static void | GpioPortSet (uint32_t Mask) |
| Name: GpioPortSet
Sets the pad values for pins specified by a mask to 1. More...
|
|
static void | GpioPortToggle (uint32_t Mask) |
| Name: GpioPortToggle
Toggles pins specified by a mask in a GPIO port. More...
|
|
static void | GpioPortSetValue (uint32_t Value, uint32_t Mask) |
| Name: GpioPortSetValue
Sets the pad value for a single pin in a GPIO port to the value provided. More...
|
|
uint32_t | GpioGetDebouncedInput (uint32_t BitMask, uint32_t BitInvert, uint8_t Count, uint8_t ShiftRightCount) |
| Name: GpioGetDebouncedInput Reads and debounces input pins. More...
|
|
This GPIO driver has functions for:
- initialization of ports with default values.
- debouncing of input pins
#define GPIO_PIN_NC (32UL) |
Not connected
Definition at line 63 of file gpio.h.
Pin mode.
Enumerator |
---|
GpioModeDisabled |
Input disabled.
|
GpioModeDisabledPullDown |
Input disabled and pulled down
|
GpioModeDisabledPullUp |
Input disabled and pulled up
|
GpioModeInput |
Input enabled.
|
GpioModeInputPullDown |
Input enabled and pulled down.
|
GpioModeInputPullUp |
Input enabled and pulled up.
|
GpioModePushPull |
Push-pull output
|
GpioModePushPullDrive |
Push-pull output with drive-strength set by DRIVEMODE
|
GpioModeWiredOr |
Wired-or output
|
GpioModeWiredOrHigh |
Wired-or output high-drive
|
GpioModeWiredOrPullDown |
Wired-or output with pull-down
|
GpioModeWiredAnd |
Open-drain output
|
GpioModeWiredAndPullUp |
Open-drain output with pullup
|
GpioModeWiredAndDrive |
Open-drain output with drive-strength set by DRIVEMODE
|
GpioModeWiredAndDrivePullUp |
Open-drain output with pullup and drive-strength set by DRIVEMODE
|
Definition at line 97 of file gpio.h.
static uint32_t GpioUnpackPin |
( |
uint32_t |
Pin | ) |
|
|
inlinestatic |
Name: GpioUnpackPin
Converts packed pin number to the format, accepted by hardware blocks.
- Parameters
-
Pin | Pin number or GPIO_PIN_NC if not connected |
- Returns
- Pin number or 0x8XXXXXXX if not connected
Definition at line 73 of file gpio.h.
static void GpioPinConfig |
( |
unsigned |
Pin, |
|
|
enum gpio_mode_t |
Mode |
|
) |
| |
|
inlinestatic |
Name: GpioPinConfig
Configures a GPIO pin to the desired mode, sets value for the pin.
- Parameters
-
Pin | The pin number to read. |
Mode | Pin mode. |
Definition at line 196 of file gpio.h.
static bool GpioPinGet |
( |
unsigned |
Pin | ) |
|
|
inlinestatic |
Name: GpioPinGet
Reads the pad value for a single pin in a GPIO port.
- Parameters
-
Pin | The pin number to read. |
- Returns
- The pin value, 0 or 1.
Definition at line 209 of file gpio.h.
static void GpioPinClear |
( |
unsigned |
Pin | ) |
|
|
inlinestatic |
Name: GpioPinClear
Sets the pad value for a single pin in a GPIO port to 0.
- Parameters
-
Pin | The pin number to modify. |
Definition at line 221 of file gpio.h.
static void GpioPinSet |
( |
unsigned |
Pin | ) |
|
|
inlinestatic |
Name: GpioPinSet
Sets the pad value for a single pin in a GPIO port to 1.
- Parameters
-
Pin | The pin number to modify. |
Definition at line 233 of file gpio.h.
static void GpioPinToggle |
( |
unsigned |
Pin | ) |
|
|
inlinestatic |
Name: GpioPinToggle
Toggles a single pin in a GPIO port.
- Parameters
-
Pin | The pin number to modify. |
Definition at line 245 of file gpio.h.
static void GpioPinSetValue |
( |
unsigned |
Pin, |
|
|
bool |
Value |
|
) |
| |
|
inlinestatic |
Name: GpioPinSetValue
Sets the pad value for a single pin in a GPIO port to the value provided.
- Parameters
-
Pin | The pin number to modify. |
Value | Value to be set. |
Definition at line 258 of file gpio.h.
static uint32_t GpioPortGet |
( |
void |
| ) |
|
|
inlinestatic |
Name: GpioPortGet
Reads the pad values for all the pins in a GPIO port.
- Returns
- 32-bit bitmap, where LSB stands for the pin 0.
Definition at line 270 of file gpio.h.
static void GpioPortClear |
( |
uint32_t |
Mask | ) |
|
|
inlinestatic |
Name: GpioPortClear
Sets the pad values for pins specified by a mask to 0.
- Parameters
-
Mask | The bitmaps of the pins to modify. |
Definition at line 282 of file gpio.h.
static void GpioPortSet |
( |
uint32_t |
Mask | ) |
|
|
inlinestatic |
Name: GpioPortSet
Sets the pad values for pins specified by a mask to 1.
- Parameters
-
Mask | The bitmaps of the pins to modify. |
Definition at line 294 of file gpio.h.
static void GpioPortToggle |
( |
uint32_t |
Mask | ) |
|
|
inlinestatic |
Name: GpioPortToggle
Toggles pins specified by a mask in a GPIO port.
- Parameters
-
Mask | The bitmaps of the pins to modify. |
Definition at line 306 of file gpio.h.
static void GpioPortSetValue |
( |
uint32_t |
Value, |
|
|
uint32_t |
Mask |
|
) |
| |
|
inlinestatic |
Name: GpioPortSetValue
Sets the pad value for a single pin in a GPIO port to the value provided.
- Parameters
-
Value | The bitmap, containing values for the pins. |
Mask | The bitmaps of the pins to modify. |
Definition at line 319 of file gpio.h.
References GpioGetDebouncedInput().
uint32_t GpioGetDebouncedInput |
( |
uint32_t |
BitMask, |
|
|
uint32_t |
BitInvert, |
|
|
uint8_t |
Count, |
|
|
uint8_t |
ShiftRightCount |
|
) |
| |
Name: GpioGetDebouncedInput Reads and debounces input pins.
- Parameters
-
BitMask | BitMask for actual bits to read |
BitInvert | Bits to be inverted (for example if active 'L' input should return 'H', then resp. bit in BitInvert must be set) |
Count | Required number of equal readings |
ShiftRightCount | Spesifies right adjustment (0-31) |
- Returns
- Returns port input status after Count equal readings.
Referenced by GpioPortSetValue().