mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
**New features** - Created a devicetree DTS and YAML parser in Python - Created new modules: - TactilityKernel (LGPL v3.0 license) - Platforms/PlatformEsp32 (LGPL v3.0 license) - Platforms/PlatformPosix (LGPL v3.0 license) - Tests/TactilityKernelTests Most boards have a placeholder DTS file, while T-Lora Pager has a few devices attached. **Licenses** Clarified licenses and copyrights better. - Add explanation about the intent behind them. - Added explanation about licenses for past and future subprojects - Added more details explanations with regards to the logo usage - Copied licenses to subprojects to make it more explicit
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdbool.h>
|
|
|
|
struct Device;
|
|
struct DeviceType;
|
|
|
|
struct Driver {
|
|
/** The driver name */
|
|
const char* name;
|
|
/** Array of const char*, terminated by NULL */
|
|
const char**compatible;
|
|
/** Function to initialize the driver for a device */
|
|
int (*start_device)(struct Device* dev);
|
|
/** Function to deinitialize the driver for a device */
|
|
int (*stop_device)(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;
|
|
/** Internal data */
|
|
struct {
|
|
/** Contains private data */
|
|
void* data;
|
|
} internal;
|
|
};
|
|
|
|
int driver_construct(struct Driver* driver);
|
|
|
|
int driver_destruct(struct Driver* driver);
|
|
|
|
int driver_bind(struct Driver* driver, struct Device* device);
|
|
|
|
int 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;
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|