Dawn Framework 1.0
Universal data acquisition framework for embedded systems
adc_fetch.hxx
1// dawn/include/dawn/io/adc_fetch.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/io/adc_base.hxx"
9
10namespace dawn
11{
14class CIOAdcFetch : public CIOAdcBase
15{
16public:
17 explicit CIOAdcFetch(CDescObject &desc)
18 : CIOAdcBase(desc)
19 {
20 }
21
22#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
23 const char *getClassNameStr() const override
24 {
25 return "adc_fetch";
26 }
27#endif
28
29 int getDataImpl(IODataCmn &data, size_t len) override;
30 int doStart() override;
31 int doStop() override;
32 int trigger(uint8_t cmd) override;
33
34 bool isRead() const override
35 {
36 return true;
37 }
38
39 bool isWrite() const override
40 {
41 return false;
42 }
43
44 bool isNotify() const override
45 {
46 return false;
47 }
48
49 bool isBatch() const override
50 {
51 return false;
52 }
53
55
56 constexpr static SObjectId::ObjectId objectId(bool ts, uint16_t inst)
57 {
58 return ObjectIdHelper::create(ts, inst);
59 }
60
61 constexpr static SObjectCfg::ObjectCfgId cfgId(bool rw, uint8_t dtype, uint8_t size, uint8_t id)
62 {
65 }
66};
67
68} // Namespace dawn
Descriptor wrapper for individual object configuration.
Shared ADC base for fetch/sync/stream implementations.
Definition adc_base.hxx:19
On-demand ADC fetch I/O.
Definition adc_fetch.hxx:15
bool isRead() const
Check if IO supports read operations.
Definition adc_fetch.hxx:34
int trigger(uint8_t cmd)
Execute a trigger command.
Definition adc_fetch.cxx:57
int doStop()
Stop implementation hook.
Definition adc_fetch.cxx:52
bool isNotify() const
Check if IO supports notifications.
Definition adc_fetch.hxx:44
int doStart()
Start implementation hook.
Definition adc_fetch.cxx:47
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
Definition adc_fetch.cxx:10
bool isWrite() const
Check if IO supports write operations.
Definition adc_fetch.hxx:39
bool isBatch() const
Check if IO supports batch operations.
Definition adc_fetch.hxx:49
Template helper for creating ObjectIDs for I/O types.
Definition common.hxx:236
static SObjectId::ObjectId create(bool ts, uint16_t inst)
Create ObjectID with default data type.
Definition common.hxx:246
@ IO_CLASS_ADC_FETCH
ADC fetch (on-demand)
Definition common.hxx:177
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.
Definition objectcfg.hxx:60
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
Base interface for I/O data buffers (static and dynamic).
Definition idata.hxx:21
@ OBJTYPE_IO
Input/Output object type.
Definition objectid.hxx:184
uint32_t ObjectId
ObjectID type - single 32-bit value.
Definition objectid.hxx:44