6#include "dawn/io/gpi.hxx"
15 for (
size_t i = 0; i < desc.
getSize(); i++)
21 DAWNERR(
"Unsupported GPI config 0x%08" PRIx32
"\n", item->
cfgid.
v);
45 DAWNERR(
"GPI configure failed (error %d)\n", ret);
53 DAWNERR(
"GPI device number not configured\n");
57 snprintf(path,
sizeof(path), GPI_PATH_FMT,
getCmnDevno());
64 DAWNERR(
"gpi_open failed %d\n", -errno);
72#ifdef CONFIG_DAWN_IO_NOTIFY
76 if (gpi_notify(fd) ==
false)
91 DAWNERR(
"GPI requires DTYPE_UINT32\n");
108 bool *tmp =
static_cast<bool *
>(data.
getDataPtr());
121 ret = gpi_read(fd, &invalue);
124 DAWNERR(
"gpi_read failed %d\n", ret);
128#ifdef CONFIG_DAWN_IO_TIMESTAMP
135 *tmp =
static_cast<bool>(invalue);
140#ifdef CONFIG_DAWN_IO_NOTIFY
158 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.
virtual int getFd() const
Get file descriptor for notifications.
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 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).
size_t getDataDim() const
Get data vector dimension.
int deinit()
De-initialize object.
int init()
One-time initialize object after bindings are resolved.
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.