Docs updated

This commit is contained in:
Ken Van Hoeylandt 2026-02-06 14:49:49 +01:00
parent 0e77989bd5
commit c3ea8a85ba
3 changed files with 18 additions and 6 deletions

View File

@ -28,11 +28,18 @@ struct DeviceType {
struct Device { struct Device {
/** The name of the device. Valid characters: a-z a-Z 0-9 - _ . */ /** The name of the device. Valid characters: a-z a-Z 0-9 - _ . */
const char* name; const char* name;
/** The configuration data for the device's driver */ /** The configuration data for the device's driver */
const void* config; const void* config;
/** The parent device that this device belongs to. Can be NULL, but only the root device should have a NULL parent. */ /** The parent device that this device belongs to. Can be NULL, but only the root device should have a NULL parent. */
struct Device* 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; struct DeviceInternal* internal;
}; };

View File

@ -29,7 +29,11 @@ struct Driver {
const struct DeviceType* device_type; 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. */ /** 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; 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; struct DriverInternal* internal;
}; };

View File

@ -38,7 +38,6 @@ struct Module {
* Desirable format "platform-esp32", "lilygo-tdeck", etc. * Desirable format "platform-esp32", "lilygo-tdeck", etc.
*/ */
const char* name; const char* name;
/** /**
* A function to initialize the module. * A function to initialize the module.
* Should never be NULL. * Should never be NULL.
@ -46,21 +45,23 @@ struct Module {
* @return ERROR_NONE if successful * @return ERROR_NONE if successful
*/ */
error_t (*start)(void); error_t (*start)(void);
/** /**
* Deinitializes the module. * Deinitializes the module.
* Should never be NULL. * Should never be NULL.
* @return ERROR_NONE if successful * @return ERROR_NONE if successful
*/ */
error_t (*stop)(void); error_t (*stop)(void);
/** /**
* A list of symbols exported by the module. * A list of symbols exported by the module.
* Should be terminated by MODULE_SYMBOL_TERMINATOR. * Should be terminated by MODULE_SYMBOL_TERMINATOR.
* Can be a NULL value. * Can be a NULL value.
*/ */
const struct ModuleSymbol* symbols; 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; struct ModuleInternal* internal;
}; };