6#include "dawn/porting/buttons.hxx"
8#include "dawn/io/buttons.hxx"
12int CIOButtons::configureDesc(
const CDescObject &desc)
17 for (
size_t i = 0; i < desc.
getSize(); i++)
23 DAWNERR(
"unsupported buttons cfg 0x08%" PRIx32
"\n", item->
cfgid.
v);
33CIOButtons::~CIOButtons()
54 DAWNERR(
"BUTTONS device number not configured\n");
58 snprintf(path,
sizeof(path), BUTTONS_PATH_FMT,
getCmnDevno());
62 fd = buttons_open(path);
65 DAWNERR(
"buttons_open failed %d\n", -errno);
82 uint32_t *tmp =
static_cast<uint32_t *
>(data.
getDataPtr());
95 ret = buttons_read(fd, &val);
98 DAWNERR(
"buttons_read failed %d\n", ret);
107 *tmp = (uint32_t)val;
112#ifdef CONFIG_DAWN_IO_NOTIFY
121 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.
CDescObject & getDesc()
Get descriptor object for this object.
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).
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.