Constants
Types
device_type_t
An enumeration of all recognised device classes.
device_info_t
A snapshot of a single registered device.
uint32_t
A kernel-assigned identifier that is unique for the lifetime of the registry. IDs are assigned sequentially starting from 0 and are never reused within a single boot.
device_type_t
The device class. Use
device_type_name() to convert this value to a printable string.uint8_t
1 if the device is online and available; 0 if it has been registered but is not yet active or has failed.char[28]
A null-terminated UTF-8 display name supplied at registration time. Maximum usable length is 27 characters.
Functions
device_manager_init
device_register
const char *
required
A null-terminated display name for the device. The name is copied into the registry; you do not need to keep the pointer alive after the call. Maximum length is 27 characters — longer names are truncated to fit
DEVICE_NAME_MAX.device_type_t
required
The device class. Must be one of the
device_type_t enumerators listed above.uint8_t
required
Pass
1 to mark the device as online immediately, or 0 to register it in an offline state.int
Returns
0 on success. Returns -1 if the registry is full (i.e. DEVICE_MAX devices are already registered).device_count
uint32_t
The number of entries in the registry, in the range
[0, DEVICE_MAX].device_list
device_info_t *
required
Pointer to an array of
device_info_t that will receive the device records. The array must be large enough to hold at least capacity elements.uint32_t
required
The maximum number of records to write. Pass
DEVICE_MAX to guarantee that every registered device is captured.uint32_t
The number of records written to
devices. This is min(device_count(), capacity).device_type_name
device_type_t
required
Any
device_type_t value.const char *
A pointer to a null-terminated string such as
"CPU", "INTERRUPT", "TIMER", "INPUT", "DISPLAY", "SERIAL", "CLOCK", "BUS", or "FILESYSTEM". The pointer refers to a static string — do not free or modify it. Returns "UNKNOWN" for unrecognised values.Shell Command
The built-indevices shell command prints a formatted table of every registered device, including its ID, type, name, and online state: