Partial reimplementation of TactilityC GPIO (#469)
* **New Features** * Added a GPIO hardware abstraction layer for reading pin levels from applications. * Applications can now query the number of available GPIO pins so they can adapt to different devices. * **Chores** * Integrations updated so GPIO capabilities are discoverable and exported to running applications.
This commit is contained in:
committed by
GitHub
parent
c9185740d7
commit
399dca5e14
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Logical GPIO pin identifier used by the HAL. Typically maps to the SoC GPIO number. */
|
||||
typedef unsigned int GpioPin;
|
||||
/** Value indicating that no GPIO pin is used/applicable. */
|
||||
#define GPIO_NO_PIN -1
|
||||
|
||||
/** Read the current logic level of a pin.
|
||||
* The pin should be configured for input or input/output.
|
||||
* @param[in] pin The pin to read.
|
||||
* @return true if the level is high, false if low. If the pin is invalid, the
|
||||
* behavior is implementation-defined and may return false.
|
||||
*/
|
||||
bool tt_hal_gpio_get_level(GpioPin pin);
|
||||
|
||||
/** Get the number of GPIO pins available on this platform.
|
||||
* @return The count of valid GPIO pins.
|
||||
*/
|
||||
int tt_hal_gpio_get_pin_count();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user