TactilityKernel improvements and more (#459)

This commit is contained in:
Ken Van Hoeylandt
2026-01-25 23:54:33 +01:00
committed by GitHub
parent 96eccbdc8d
commit dfe2c865d1
36 changed files with 759 additions and 331 deletions
@@ -7,22 +7,22 @@ extern "C" {
#endif
#include "Gpio.h"
#include <stdbool.h>
#include <Tactility/Error.h>
struct GpioControllerApi {
bool (*set_level)(struct Device* device, gpio_pin_t pin, bool high);
bool (*get_level)(struct Device* device, gpio_pin_t pin, bool* high);
bool (*set_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t options);
bool (*get_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t* options);
error_t (*set_level)(struct Device* device, gpio_pin_t pin, bool high);
error_t (*get_level)(struct Device* device, gpio_pin_t pin, bool* high);
error_t (*set_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t options);
error_t (*get_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t* options);
};
bool gpio_controller_set_level(struct Device* device, gpio_pin_t pin, bool high);
bool gpio_controller_get_level(struct Device* device, gpio_pin_t pin, bool* high);
bool gpio_controller_set_options(struct Device* device, gpio_pin_t pin, gpio_flags_t options);
bool gpio_controller_get_options(struct Device* device, gpio_pin_t pin, gpio_flags_t* options);
error_t gpio_controller_set_level(struct Device* device, gpio_pin_t pin, bool high);
error_t gpio_controller_get_level(struct Device* device, gpio_pin_t pin, bool* high);
error_t gpio_controller_set_options(struct Device* device, gpio_pin_t pin, gpio_flags_t options);
error_t gpio_controller_get_options(struct Device* device, gpio_pin_t pin, gpio_flags_t* options);
inline bool gpio_set_options_config(struct Device* device, struct GpioPinConfig* config) {
return gpio_controller_set_options(device, config->pin, config->dt_flags);
static inline error_t gpio_set_options_config(struct Device* device, const struct GpioPinConfig* config) {
return gpio_controller_set_options(device, config->pin, config->flags);
}
#ifdef __cplusplus