Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
dawn::SObjectCfg Class Reference

Configuration management for Dawn objects. More...

#include <objectcfg.hxx>

Classes

struct  SObjectCfgData
 Object configuration data container. More...
 
struct  SObjectCfgItem
 Single configuration item within object. More...
 
union  UObjectCfgId
 32-bit encoded configuration identifier (union with bit field). More...
 

Public Types

typedef uint32_t ObjectCfgData_t
 Configuration data element - single 32-bit word.
 
typedef uint32_t ObjectCfgId
 ConfigID type - single 32-bit value.
 

Static Public Member Functions

static uint32_t b16ToCfg (b16_t x)
 Convert b16_t to uint32_t.
 
static b16_t cfgToB16 (ObjectCfgData_t x)
 Convert ObjectCfgData_t to b16_t.
 
static float cfgToF (ObjectCfgData_t x)
 Convert ObjectCfgData_t to float.
 
static int32_t cfgtoi32 (ObjectCfgData_t x)
 Convert ObjectCfgData_t to int32_t.
 
static uint32_t cfgToU32 (ObjectCfgData_t x)
 Convert ObjectCfgData_t to uint32_t.
 
static ObjectCfgData_t fToB16ToCfg (float x)
 Convert float to b16_t and then to ObjectCfgData_t.
 
static ObjectCfgData_t fToCfg (float x)
 Convert float to ObjectCfgData_t.
 
static size_t getSizeBytes (const SObjectCfgData &cfg)
 Get total size in bytes for this object definition.
 
static ObjectCfgData_t i32ToCfg (int32_t x)
 Convert int32_t to ObjectCfgData_t.
 
static SObjectCfgItemobjectAtOffset (const SObjectCfgData &cfg, size_t offset)
 Get item from offset.
 
static ObjectCfgId objectCfg (uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
 Construct 32-bit ConfigID from component fields.
 
static SObjectCfgItemobjectCfgFromCfgId (const SObjectCfgData &cfg, ObjectCfgId id)
 Get item from configuration ID.
 
static uint16_t objectCfgGetCls (const ObjectCfgId objcfg)
 Extract object class from ConfigID.
 
static uint8_t objectCfgGetDtype (const ObjectCfgId objcfg)
 Extract data type from ConfigID.
 
static uint8_t objectCfgGetId (const ObjectCfgId objcfg)
 Extract configuration identifier from ConfigID.
 
static bool objectCfgGetRw (const ObjectCfgId objcfg)
 Extract read-write access flag from ConfigID.
 
static uint16_t objectCfgGetSize (const ObjectCfgId objcfg)
 Extract configuration data size from ConfigID.
 
static uint8_t objectCfgGetType (const ObjectCfgId objcfg)
 Extract object type from ConfigID.
 
static ObjectCfgData_t u32ToCfg (uint32_t x)
 Helper conversion functions: data types to cfg data type.
 

Static Public Attributes

static size_t ID_MAX = 0b11111
 Configuration ID field constants and bit shift positions.
 

Detailed Description

Configuration management for Dawn objects.

Encodes and manages optional configuration data attached to objects.

ConfigID is a 32-bit packed field:

These fields identify a config item and describe its storage and access semantics.

Definition at line 36 of file objectcfg.hxx.

Member Typedef Documentation

◆ ObjectCfgData_t

Configuration data element - single 32-bit word.

All configuration data is stored as arrays of 32-bit words, regardless of actual data type.

Definition at line 69 of file objectcfg.hxx.

Member Function Documentation

◆ b16ToCfg()

static uint32_t dawn::SObjectCfg::b16ToCfg ( b16_t  x)
inlinestatic

Convert b16_t to uint32_t.

Parameters
xb16_t value.
Returns
Converted uint32_t.

Definition at line 349 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ cfgToB16()

static b16_t dawn::SObjectCfg::cfgToB16 ( ObjectCfgData_t  x)
inlinestatic

Convert ObjectCfgData_t to b16_t.

Parameters
xObjectCfgData_t value.
Returns
Converted b16_t.

Definition at line 419 of file objectcfg.hxx.

◆ cfgToF()

static float dawn::SObjectCfg::cfgToF ( ObjectCfgData_t  x)
inlinestatic

Convert ObjectCfgData_t to float.

Parameters
xObjectCfgData_t value.
Returns
Converted float.

Definition at line 404 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ cfgtoi32()

static int32_t dawn::SObjectCfg::cfgtoi32 ( ObjectCfgData_t  x)
inlinestatic

Convert ObjectCfgData_t to int32_t.

Parameters
xObjectCfgData_t value.
Returns
Converted int32_t.

Definition at line 389 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ cfgToU32()

static uint32_t dawn::SObjectCfg::cfgToU32 ( ObjectCfgData_t  x)
inlinestatic

Convert ObjectCfgData_t to uint32_t.

Parameters
xObjectCfgData_t value.
Returns
Converted uint32_t.

Definition at line 377 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ fToB16ToCfg()

static ObjectCfgData_t dawn::SObjectCfg::fToB16ToCfg ( float  x)
inlinestatic

Convert float to b16_t and then to ObjectCfgData_t.

Parameters
xfloat value.
Returns
Converted ObjectCfgData_t.

Definition at line 364 of file objectcfg.hxx.

References b16ToCfg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fToCfg()

static ObjectCfgData_t dawn::SObjectCfg::fToCfg ( float  x)
inlinestatic

Convert float to ObjectCfgData_t.

Parameters
xfloat value.
Returns
Converted ObjectCfgData_t.

Definition at line 334 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ getSizeBytes()

size_t SObjectCfg::getSizeBytes ( const SObjectCfgData cfg)
static

Get total size in bytes for this object definition.

Returns the complete size of object definition in descriptor, including object metadata and all configuration items/data.

Definition at line 38 of file objectcfg.cxx.

References dawn::SObjectCfg::SObjectCfgItem::cfgid, objectAtOffset(), dawn::SObjectCfg::UObjectCfgId::s, dawn::SObjectCfg::UObjectCfgId::size, and dawn::SObjectCfg::SObjectCfgData::size.

Here is the call graph for this function:

◆ i32ToCfg()

static ObjectCfgData_t dawn::SObjectCfg::i32ToCfg ( int32_t  x)
inlinestatic

Convert int32_t to ObjectCfgData_t.

Parameters
xint32_t value.
Returns
Converted ObjectCfgData_t.

Definition at line 319 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ objectAtOffset()

static SObjectCfgItem * dawn::SObjectCfg::objectAtOffset ( const SObjectCfgData cfg,
size_t  offset 
)
inlinestatic

Get item from offset.

Parameters
cfgObject configuration data.
offsetOffset in 32-bit words.
Returns
Pointer to configuration item.
Note
Returns non-const pointer from a const-ref parameter. The underlying descriptor data resides in mutable memory (allocated during descriptor construction); the const qualifier on cfg is for API clarity, not physical constness of the data.

Definition at line 440 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ objectCfg()

static ObjectCfgId dawn::SObjectCfg::objectCfg ( uint8_t  type,
uint16_t  cls,
uint8_t  dtype,
bool  rw,
uint16_t  size,
uint8_t  id 
)
inlinestatic

Construct 32-bit ConfigID from component fields.

Packs individual configuration metadata into a single 32-bit ConfigID.

Parameters
typeObject type (0-3): OBJTYPE_ANY, OBJTYPE_IO, etc.
clsObject class (0-511): IOCLS_ADC, IOCLS_GPIO, etc.
dtypeData type (0-15): DTYPE_UINT32, DTYPE_FLOAT, etc.
rwRead-write flag: false=read-only, true=read-write.
sizeConfiguration data size in 32-bit words (0-1023).
idConfiguration identifier (0-31).
Returns
Constructed 32-bit ConfigID value.

Definition at line 208 of file objectcfg.hxx.

References ID_MAX.

Here is the caller graph for this function:

◆ objectCfgFromCfgId()

SObjectCfg::SObjectCfgItem * SObjectCfg::objectCfgFromCfgId ( const SObjectCfgData cfg,
ObjectCfgId  id 
)
static

Get item from configuration ID.

Parameters
cfgObject configuration data.
idConfiguration ID.
Returns
Pointer to configuration item, nullptr if not found.

Definition at line 12 of file objectcfg.cxx.

References dawn::SObjectCfg::SObjectCfgItem::cfgid, objectAtOffset(), dawn::SObjectCfg::UObjectCfgId::s, dawn::SObjectCfg::UObjectCfgId::size, dawn::SObjectCfg::SObjectCfgData::size, and dawn::SObjectCfg::UObjectCfgId::v.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ objectCfgGetCls()

static uint16_t dawn::SObjectCfg::objectCfgGetCls ( const ObjectCfgId  objcfg)
inlinestatic

Extract object class from ConfigID.

Parameters
objcfgConfigID value.
Returns
Object class (0-511).

Definition at line 281 of file objectcfg.hxx.

◆ objectCfgGetDtype()

static uint8_t dawn::SObjectCfg::objectCfgGetDtype ( const ObjectCfgId  objcfg)
inlinestatic

Extract data type from ConfigID.

Parameters
objcfgConfigID value.
Returns
Data type (EObjectDataType value, 0-15).

Definition at line 269 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ objectCfgGetId()

static uint8_t dawn::SObjectCfg::objectCfgGetId ( const ObjectCfgId  objcfg)
inlinestatic

Extract configuration identifier from ConfigID.

Parameters
objcfgConfigID value.
Returns
Configuration identifier (0-31).

Definition at line 233 of file objectcfg.hxx.

References ID_MAX.

Here is the caller graph for this function:

◆ objectCfgGetRw()

static bool dawn::SObjectCfg::objectCfgGetRw ( const ObjectCfgId  objcfg)
inlinestatic

Extract read-write access flag from ConfigID.

Parameters
objcfgConfigID value.
Returns
true if read-write (can be modified), false if read-only.

Definition at line 257 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ objectCfgGetSize()

static uint16_t dawn::SObjectCfg::objectCfgGetSize ( const ObjectCfgId  objcfg)
inlinestatic

Extract configuration data size from ConfigID.

Parameters
objcfgConfigID value.
Returns
Configuration data size in 32-bit words (0-1023).

Definition at line 245 of file objectcfg.hxx.

Here is the caller graph for this function:

◆ objectCfgGetType()

static uint8_t dawn::SObjectCfg::objectCfgGetType ( const ObjectCfgId  objcfg)
inlinestatic

Extract object type from ConfigID.

Parameters
objcfgConfigID value.
Returns
Object type (EObjectIdType value, 0-3).

Definition at line 293 of file objectcfg.hxx.

◆ u32ToCfg()

static ObjectCfgData_t dawn::SObjectCfg::u32ToCfg ( uint32_t  x)
inlinestatic

Helper conversion functions: data types to cfg data type.

Convert uint32_t to ObjectCfgData_t.

Parameters
xuint32_t value.
Returns
Converted ObjectCfgData_t.

Definition at line 307 of file objectcfg.hxx.

Here is the caller graph for this function:

Member Data Documentation

◆ ID_MAX

size_t dawn::SObjectCfg::ID_MAX = 0b11111
static

Configuration ID field constants and bit shift positions.

Used with getter functions to extract fields from ConfigID.

Definition at line 45 of file objectcfg.hxx.


The documentation for this class was generated from the following files: