|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Hardware Abstraction Layer interface for GPIO operations. More...
Functions | |
| int | ove_hal_gpio_set (unsigned int port, unsigned int pin, int value) |
| Set the output level of a GPIO pin at the hardware level. | |
| int | ove_hal_gpio_get (unsigned int port, unsigned int pin) |
| Read the current logical level of a GPIO pin at the hardware level. | |
| int | ove_hal_gpio_configure (unsigned int port, unsigned int pin, ove_gpio_mode_t mode) |
| Configure the direction and drive mode of a GPIO pin at the hardware level. | |
| int | ove_hal_gpio_irq_hw_enable (unsigned int port, unsigned int pin, ove_gpio_irq_mode_t mode, ove_gpio_irq_cb callback, void *user_data) |
| Program and enable a GPIO interrupt in hardware. | |
| int | ove_hal_gpio_irq_hw_disable (unsigned int port, unsigned int pin) |
| Disable a GPIO interrupt in hardware without unregistering the callback. | |
Hardware Abstraction Layer interface for GPIO operations.
Declares the low-level GPIO functions that every platform HAL must implement. The portable GPIO layer delegates to these functions after performing parameter validation and IRQ bookkeeping.
| int ove_hal_gpio_set | ( | unsigned int | port, |
| unsigned int | pin, | ||
| int | value | ||
| ) |
Set the output level of a GPIO pin at the hardware level.
Called by ove_gpio_set() after validation.
| [in] | port | GPIO port index. |
| [in] | pin | GPIO pin index within the port. |
| [in] | value | Non-zero to drive high, zero to drive low. |
| int ove_hal_gpio_get | ( | unsigned int | port, |
| unsigned int | pin | ||
| ) |
Read the current logical level of a GPIO pin at the hardware level.
Called by ove_gpio_get() after validation.
| [in] | port | GPIO port index. |
| [in] | pin | GPIO pin index within the port. |
| int ove_hal_gpio_configure | ( | unsigned int | port, |
| unsigned int | pin, | ||
| ove_gpio_mode_t | mode | ||
| ) |
Configure the direction and drive mode of a GPIO pin at the hardware level.
Called by ove_gpio_configure() after validation.
| [in] | port | GPIO port index. |
| [in] | pin | GPIO pin index within the port. |
| [in] | mode | Desired pin mode (ove_gpio_mode_t). |
| int ove_hal_gpio_irq_hw_enable | ( | unsigned int | port, |
| unsigned int | pin, | ||
| ove_gpio_irq_mode_t | mode, | ||
| ove_gpio_irq_cb | callback, | ||
| void * | user_data | ||
| ) |
Program and enable a GPIO interrupt in hardware.
Called by ove_gpio_irq_enable() after the callback has been registered via ove_gpio_irq_register(). The HAL must configure the edge detector for mode and arm the interrupt controller.
| [in] | port | GPIO port index. |
| [in] | pin | GPIO pin index within the port. |
| [in] | mode | Edge(s) that should trigger the interrupt. |
| [in] | callback | Function to invoke when the interrupt fires. |
| [in] | user_data | Opaque pointer forwarded to callback. |
| int ove_hal_gpio_irq_hw_disable | ( | unsigned int | port, |
| unsigned int | pin | ||
| ) |
Disable a GPIO interrupt in hardware without unregistering the callback.
Called by ove_gpio_irq_disable(). The interrupt controller entry for this pin must be masked so no further callbacks are dispatched.
| [in] | port | GPIO port index. |
| [in] | pin | GPIO pin index within the port. |