6#include "dawn/io/gpo.hxx"
15 for (
size_t i = 0; i < desc.
getSize(); i++)
21 DAWNERR(
"Unsupported GPO config 0x%08" PRIx32
"\n", item->
cfgid.
v);
45 DAWNERR(
"GPO configure failed (error %d)\n", ret);
53 DAWNERR(
"GPO device number not configured\n");
57 snprintf(path,
sizeof(path), GPO_PATH_FMT,
getCmnDevno());
64 DAWNERR(
"gpo_open failed %d\n", -errno);
79 DAWNERR(
"GPO requires DTYPE_UINT32\n");
96 bool *tmp =
static_cast<bool *
>(data.
getDataPtr());
109 ret = gpo_read(fd, &invalue);
112 DAWNERR(
"gpi_read failed %d\n", ret);
116#ifdef CONFIG_DAWN_IO_TIMESTAMP
123 *tmp =
static_cast<bool>(invalue);
130 bool *outvalue =
static_cast<bool *
>(data.
getDataPtr());
135 ret = gpo_write(fd, *outvalue);
138 DAWNERR(
"gpo_write failed %d\n", ret);
142#ifdef CONFIG_DAWN_IO_TIMESTAMP
154 return sizeof(uint32_t);
Descriptor wrapper for individual object configuration.
size_t getSize() const
Get number of configuration items for this object.
SObjectCfg::SObjectCfgItem * objectCfgItemAtOffset(size_t offset) const
Get configuration item at specified offset.
uint64_t getTimestamp()
Get current timestamp.
bool isTimestamp() const
Check if I/O supports timestamp.
int getCmnDevno() const
Get device number for this I/O.
size_t cfgCmnOffset(const SObjectCfg::SObjectCfgItem *cfg)
Get offset of configuration item in descriptor.
@ IO_CLASS_ANY
Any I/O class.
int init()
One-time initialize object after bindings are resolved.
int configure()
Configure object from descriptor data.
size_t getDataSize() const
Get data size in bytes.
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
int setDataImpl(IODataCmn &data)
Set data implementation (override in derived classes).
size_t getDataDim() const
Get data vector dimension.
int deinit()
De-initialize object.
CDescObject & getDesc()
Get descriptor object for this object.
uint8_t getDtype() const
Get data type field.
Out-of-tree user-extension hooks for Dawn.
Base interface for I/O data buffers (static and dynamic).
virtual void * getDataPtr(size_t batch=0)=0
Get pointer to data only (skips timestamp if present).
virtual uint64_t & getTs(size_t batch=0)=0
Get timestamp reference for batch.
Single configuration item within object.
UObjectCfgId cfgid
Configuration ID header (type, class, id, size, rw, dtype).
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
ObjectCfgId v
Raw 32-bit ConfigID value (for storage, comparison).
uint32_t cls
Object class (bits 21-29, max 511).
struct dawn::SObjectCfg::UObjectCfgId::@10 s
Bit-field structure for named member access.