diff --git a/TactilityKernel/Include/tactility/device.h b/TactilityKernel/Include/tactility/device.h index 57bae4fb..d3622e3e 100644 --- a/TactilityKernel/Include/tactility/device.h +++ b/TactilityKernel/Include/tactility/device.h @@ -28,11 +28,18 @@ struct DeviceType { struct Device { /** The name of the device. Valid characters: a-z a-Z 0-9 - _ . */ const char* name; + /** The configuration data for the device's driver */ const void* config; + /** The parent device that this device belongs to. Can be NULL, but only the root device should have a NULL parent. */ struct Device* parent; - /** Internal data */ + + /** + * Internal state managed by the kernel. + * Device implementers should initialize this to NULL. + * Do not access or modify directly; use device_* functions. + */ struct DeviceInternal* internal; }; diff --git a/TactilityKernel/Include/tactility/driver.h b/TactilityKernel/Include/tactility/driver.h index 59399a05..7ae115a3 100644 --- a/TactilityKernel/Include/tactility/driver.h +++ b/TactilityKernel/Include/tactility/driver.h @@ -29,7 +29,11 @@ struct Driver { const struct DeviceType* device_type; /** The module that owns this driver. When it is NULL, the system owns the driver and it cannot be removed from registration. */ const struct Module* owner; - /** Internal data */ + /** + * Internal state managed by the kernel. + * Driver implementers should initialize this to NULL. + * Do not access or modify directly; use driver_* functions. + */ struct DriverInternal* internal; }; diff --git a/TactilityKernel/Include/tactility/module.h b/TactilityKernel/Include/tactility/module.h index 69702db5..aa49ba05 100644 --- a/TactilityKernel/Include/tactility/module.h +++ b/TactilityKernel/Include/tactility/module.h @@ -38,7 +38,6 @@ struct Module { * Desirable format "platform-esp32", "lilygo-tdeck", etc. */ const char* name; - /** * A function to initialize the module. * Should never be NULL. @@ -46,21 +45,23 @@ struct Module { * @return ERROR_NONE if successful */ error_t (*start)(void); - /** * Deinitializes the module. * Should never be NULL. * @return ERROR_NONE if successful */ error_t (*stop)(void); - /** * A list of symbols exported by the module. * Should be terminated by MODULE_SYMBOL_TERMINATOR. * Can be a NULL value. */ const struct ModuleSymbol* symbols; - + /** + * Internal state managed by the kernel. + * Module implementers should initialize this to NULL. + * Do not access or modify directly; use module_* functions. + */ struct ModuleInternal* internal; };