8#include "dawn/porting/config.hxx"
9#include "dawn/prog/common.hxx"
29 constexpr static uint32_t DEPTH_DEFAULT = 16;
33 PROG_BUFFER_CFG_FIRST = 0,
38 PROG_BUFFER_CFG_LAST = 31
43 FLAG_AUTO_START = (1u << 0),
44 FLAG_MODE_ONESHOT = (1u << 1),
45 FLAG_KEEP_DATA_ON_STOP = (1u << 2),
46 }
typedef EProgBufferFlags;
61 , depth(DEPTH_DEFAULT)
63 , flags(FLAG_AUTO_START)
69#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
70 const char *getClassNameStr()
const override
82 int trigger(uint8_t cmd)
override;
125 STAT_SNAPSHOT_SEQ = 4,
126 STAT_RUNTIME_FLAGS = 5,
127 STAT_SELECTED_OFFSET = 6,
136 RUNTIME_RUNNING = (1u << 0),
137 RUNTIME_CAPTURE_ACTIVE = (1u << 1),
138 RUNTIME_FULL = (1u << 2),
139 RUNTIME_ERROR_RANGE = (1u << 3),
157 io_ddata_t *statData;
161 uint32_t selectedOffset;
162 uint32_t snapshotSeq;
171 int configureDesc(
const CDescObject &desc);
179 int captureBind(io_ddata_t *data);
180 int updateSelected();
184 void cmdStartCapture();
185 void cmdStopCapture();
187 static uint32_t resolveRingIndex(
const SBufferBind *bind, uint32_t sel, uint32_t depth);
189 static int srcNotifyCb(
void *priv, io_ddata_t *data);
190 static void outGetCb(CIOVirt *io,
void *priv);
191 static void selSetCb(CIOVirt *io,
void *priv);
192 static void statGetCb(CIOVirt *io,
void *priv);
Descriptor wrapper for individual object configuration.
Notify-driven history buffer Program.
int doStart()
Start implementation hook.
int deinit()
De-initialize object.
int init()
One-time initialize object after bindings are resolved.
int trigger(uint8_t cmd)
Execute a trigger command.
@ PROG_BUFFER_CFG_IOBIND
I/O binding configuration.
@ PROG_BUFFER_CFG_CHUNK_SIZE
Output samples per read.
@ PROG_BUFFER_CFG_FLAGS
Config flags.
@ PROG_BUFFER_CFG_DEPTH
Buffer depth.
int configure()
Configure object from descriptor data.
int doStop()
Stop implementation hook.
bool hasThread() const
Check if a background thread is active.
Base class for all PROG (processing) objects.
@ PROG_CLASS_BUFFER
Notify-driven history capture buffer.
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.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
One buffer binding payload.
SObjectId::UObjectId out
Selected history sample to readers.
SObjectId::UObjectId stat
Buffer status words (see STAT_*).
SObjectId::UObjectId sel
History offset selector (0 = newest).
SObjectId::UObjectId src
Source IO providing samples via notify.
@ OBJTYPE_PROG
Program/algorithm object type.
@ DTYPE_ANY
Wildcard data type (matches any actual type).
uint32_t ObjectId
ObjectID type - single 32-bit value.
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.
32-bit encoded object identifier (union with bit field).