8#include "dawn/io/common.hxx"
9#include "dawn/porting/config.hxx"
10#include "dawn/porting/sensors.hxx"
25 ,
public CIOSensorPorting
30 IO_SENSOR_CFG_FIRST = 0,
41 IO_SENSOR_CFG_LAST = 31
56 ~CIOSensor()
override;
58#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
59 const char *getClassNameStr()
const override
105 int getDataImpl(IODataCmn &data,
size_t len)
override;
107#ifdef CONFIG_DAWN_IO_NOTIFY
108 int getFd()
const override;
134 constexpr static SObjectId::ObjectId objectId(uint16_t cls, uint8_t dtype,
bool ts, uint16_t inst)
138#ifdef CONFIG_DAWN_IO_TIMESTAMP
144 DAWNASSERT(ts ==
false,
"ts not supported");
220 constexpr static SObjectId::ObjectId objectIdGnssTime(uint8_t dtype,
bool ts, uint16_t inst)
225 constexpr static SObjectId::ObjectId objectIdGnssInfo(uint8_t dtype,
bool ts, uint16_t inst)
230 constexpr static SObjectId::ObjectId objectIdGnssSats(uint8_t dtype,
bool ts, uint16_t inst)
258 constexpr static const size_t DATA_BUFFER_SIZE = 96;
270 virtual int validateDtype();
Descriptor wrapper for individual object configuration.
Base class for all I/O objects.
virtual int getFd() const
Get file descriptor for notifications.
@ IO_FLAGS_TS
Timestamp support flag.
@ IO_CLASS_SENSOR_MAGNETICFIELD
Magnetic field sensor.
@ IO_CLASS_ANY
Any I/O class.
@ IO_CLASS_SENSOR_LIGHT
Light sensor.
@ IO_CLASS_SENSOR_BAROMETER
Barometer sensor.
@ IO_CLASS_SENSOR_HUMIDITY
Humidity sensor.
@ IO_CLASS_SENSOR_PROXIMITY
Proximity sensor.
@ IO_CLASS_SENSOR_GNSS_TIME
GNSS UTC time (seconds since epoch)
@ IO_CLASS_SENSOR_TEMPERATURE
Temperature sensor.
@ IO_CLASS_SENSOR_GNSS_INFO
GNSS accuracy + DOP (eph/epv/hdop/pdop/vdop)
@ IO_CLASS_SENSOR_UV
Ultraviolet sensor.
@ IO_CLASS_SENSOR_GNSS
GNSS position+velocity (lat/lon/alt/speed/course)
@ IO_CLASS_SENSOR_ACCELEROMETER
Accelerometer sensor.
@ IO_CLASS_SENSOR_RGB
RGB color sensor.
@ IO_CLASS_SENSOR_GYROSCOPE
Gyroscope sensor.
@ IO_CLASS_SENSOR_GNSS_SATELLITES
GNSS satellites used in fix.
@ IO_CLASS_SENSOR_IR
Infrared sensor.
@ IO_CLASS_SENSOR_ATEMPERATURE
Ambient temperature sensor.
@ IO_CLASS_SENSOR_GAS
Gas sensor.
Generic sensor interface for various sensor types.
uint32_t measurementPeriod
Sensor measurement period in milliseconds.
int fd
File descriptor for sensor device.
bool isNotify() const
Check if IO supports notifications.
bool isWrite() const
Check if IO supports write operations.
int deinit()
De-initialize object.
@ IO_SENSOR_CFG_GAIN
Analog gain setting.
@ IO_SENSOR_CFG_UNIT
Measurement unit selection.
@ IO_SENSOR_CFG_ORIENTATION
Sensor orientation/mounting angle.
@ IO_SENSOR_CFG_ALERT
Alert threshold configuration.
@ IO_SENSOR_CFG_BANDWIDTHLP
Low-pass filter bandwidth.
@ IO_SENSOR_CFG_MEASPERIOD
Measurement period.
@ IO_SENSOR_CFG_SCALE
Scale/multiplier for raw sensor values.
@ IO_SENSOR_CFG_BANDWIDTHHP
High-pass filter bandwidth.
@ IO_SENSOR_CFG_UPDATEINTERVAL
Data update interval in milliseconds.
@ IO_SENSOR_CFG_ENABLE
Sensor enable/disable configuration.
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
bool isBatch() const
Check if IO supports batch operations.
size_t getDataSize() const
Get data size in bytes.
size_t dsize
Sensor data size in bytes.
uint32_t updateInterval
Sensor update interval in milliseconds.
char path[PATH_MAX]
Sensor device file path.
const SIOSensorMapInfo * info
Sensor metadata.
bool isRead() const
Check if IO supports read operations.
int configure()
Configure object from descriptor data.
size_t getDataDim() const
Get data vector dimension.
uint16_t getCls() const
Get object class field.
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.
static size_t ID_MAX
Configuration ID field constants and bit shift positions.
Out-of-tree user-extension hooks for Dawn.
@ OBJTYPE_IO
Input/Output object type.
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
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.