6#include "dawn/proto/nxscope/dummy.hxx"
8#include "dawn/io/common.hxx"
9#include "dawn/io/sdata.hxx"
13int CProtoNxscopeDummy::configureDesc(
const CDescObject &desc)
18 for (
size_t i = 0; i < desc.
getSize(); i++)
24 DAWNERR(
"unsupported nxscope cfg 0x08%" PRIx32
"\n", item->
cfgid.
v);
32 const size_t wpe =
sizeof(SProtoNxscopeIOBind) / 4;
37 SProtoNxscopeIOBind *tmp =
38 reinterpret_cast<SProtoNxscopeIOBind *
>(item->
data + j * wpe);
48 const size_t wpe =
sizeof(SProtoNxscopeIOBind2) / 4;
49 const size_t entry_count = item->
cfgid.
s.
size / wpe;
54 DAWNERR(
"unsupported nxscope cfg 0x08%" PRIx32
"\n", item->
cfgid.
v);
58 for (j = 0; j < entry_count; j++)
60 SProtoNxscopeIOBind2 *tmp =
61 reinterpret_cast<SProtoNxscopeIOBind2 *
>(item->
data + j * wpe);
63 allocObject(&tmp->bind);
64 allocNames(j, &tmp->name);
72 DAWNERR(
"unsupported nxscope cfg 0x08%" PRIx32
"\n", item->
cfgid.
v);
81int CProtoNxscopeDummy::confgureNxscopePriv()
87 DAWNINFO(
"nxscope dummy\n");
89 ret = nxscope_dummy_init(&
nxsIntf, &nxsDummyCfg);
92 DAWNERR(
"nxscope_dummy_init failed: %d\n", ret);
99CProtoNxscopeDummy::~CProtoNxscopeDummy()
103int CProtoNxscopeDummy::initPriv()
109 ret = configureDesc(
getDesc());
115 ret = confgureNxscopePriv();
121 ret = configureNxscope();
130int CProtoNxscopeDummy::deinitPriv()
132 nxscope_dummy_deinit(&
nxsIntf);
136int CProtoNxscopeDummy::startPriv()
141int CProtoNxscopeDummy::stopPriv()
Descriptor wrapper for individual object configuration.
size_t getSize() const
Get number of configuration items for this object.
SObjectCfg::SObjectCfgItem * objectCfgItemNext(size_t &offset) const
Get config item at current offset and advance past it.
CDescObject & getDesc()
Get descriptor object for this object.
@ PROTO_CLASS_NXSCOPE_DUMMY
NxScope real-time visualization (dummy interface).
@ PROTO_NXSCOPE_DUMMY_CFG_IOBIND2
I/O bindings with names.
@ PROTO_NXSCOPE_DUMMY_CFG_IOBIND
I/O bindings.
struct nxscope_intf_s nxsIntf
NXScope interface structure (from logging library).
Out-of-tree user-extension hooks for Dawn.
Single configuration item within object.
ObjectCfgData_t data[]
Configuration data array (flexible, size from cfgid.s.size).
UObjectCfgId cfgid
Configuration ID header (type, class, id, size, rw, dtype).
ObjectCfgId v
Raw 32-bit ConfigID value (for storage, comparison).
uint32_t cls
Object class (bits 21-29, max 511).
uint32_t id
Configuration identifier (bits 0-4, max 31).
uint32_t size
Configuration data size in 32-bit words (bits 5-14, max 1023).
struct dawn::SObjectCfg::UObjectCfgId::@10 s
Bit-field structure for named member access.