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
+9 -8
View File
@@ -7,6 +7,7 @@ extern "C" {
#endif
#include <stdbool.h>
#include "Error.h"
struct Device;
struct DeviceType;
@@ -17,13 +18,13 @@ struct Driver {
/** Array of const char*, terminated by NULL */
const char**compatible;
/** Function to initialize the driver for a device */
int (*start_device)(struct Device* dev);
error_t (*startDevice)(struct Device* dev);
/** Function to deinitialize the driver for a device */
int (*stop_device)(struct Device* dev);
error_t (*stopDevice)(struct Device* dev);
/** Contains the driver's functions */
const void* api;
/** Which type of devices this driver creates (can be NULL) */
const struct DeviceType* device_type;
const struct DeviceType* deviceType;
/** Internal data */
struct {
/** Contains private data */
@@ -31,20 +32,20 @@ struct Driver {
} internal;
};
int driver_construct(struct Driver* driver);
error_t driver_construct(struct Driver* driver);
int driver_destruct(struct Driver* driver);
error_t driver_destruct(struct Driver* driver);
int driver_bind(struct Driver* driver, struct Device* device);
error_t driver_bind(struct Driver* driver, struct Device* device);
int driver_unbind(struct Driver* driver, struct Device* device);
error_t driver_unbind(struct Driver* driver, struct Device* device);
bool driver_is_compatible(struct Driver* driver, const char* compatible);
struct Driver* driver_find_compatible(const char* compatible);
static inline const struct DeviceType* driver_get_device_type(struct Driver* driver) {
return driver->device_type;
return driver->deviceType;
}
#ifdef __cplusplus