Appearance
System Configuration
Runtime access to per-device sysprop entries.
Devices are described in the system configuration table via [sysconf_create_device(...)](/embed/2.2.0/API/Files/sysconfig_8h.md#define-sysconf-create-device) and a list of sysconf_set_*_param(...) entries. The functions below let driver code query those entries at runtime by their sysconf_param_* identifier.
Functions Overview
| Name | |
|---|---|
| uint32_t | sysconf_has_prop(struct device * dev, uint16_t property) Tests whether a device has a sysprop with the given identifier. |
| uint32_t | sysconf_get_int_prop(struct device * dev, uint16_t property) Reads an integer sysprop. |
| struct device * | sysconf_get_device_prop(struct device * dev, uint16_t property) Resolves a device-typed sysprop to a struct device pointer. |
| const char * | sysconf_get_string_prop(struct device * dev, uint16_t property) Reads a string sysprop. |
Function Details
function sysconf_has_prop
cpp
uint32_t sysconf_has_prop(
struct device * dev,
uint16_t property
)Tests whether a device has a sysprop with the given identifier.
Parameters:
- dev Device whose sysprop list is searched.
- property One of the
sysconf_param_*identifiers.
Return: Non-zero if the property exists, 0 otherwise.
function sysconf_get_int_prop
cpp
uint32_t sysconf_get_int_prop(
struct device * dev,
uint16_t property
)Reads an integer sysprop.
Parameters:
- dev Device whose sysprop list is queried.
- property One of the
sysconf_param_*identifiers.
Return: The integer value, or 0 if the property is missing or not an integer.
function sysconf_get_device_prop
cpp
struct device * sysconf_get_device_prop(
struct device * dev,
uint16_t property
)Resolves a device-typed sysprop to a struct device pointer.
Parameters:
- dev Device whose sysprop list is queried.
- property One of the
sysconf_param_*identifiers.
Return: Pointer to the referenced device, or NULL if missing.
Used for cross-references such as a peripheral's parent bus (see sysconf_set_parent_dev).
function sysconf_get_string_prop
cpp
const char * sysconf_get_string_prop(
struct device * dev,
uint16_t property
)Reads a string sysprop.
Parameters:
- dev Device whose sysprop list is queried.
- property One of the
sysconf_param_*identifiers.
Return: Pointer to the (read-only) string, or NULL if missing.