Tactility/TactilityC/Include/tt_hal_gpio.h
Ken Van Hoeylandt 399dca5e14
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.
2026-01-31 12:34:45 +01:00

31 lines
799 B
C

#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