M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
imu_data_source.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
3 *
4 * SPDX-License-Identifier: MIT
5 */
10#ifndef M5_UNIT_IMU_IMU_IMU_DATA_SOURCE_HPP
11#define M5_UNIT_IMU_IMU_IMU_DATA_SOURCE_HPP
12
13#include "imu_types.hpp"
14
15namespace m5 {
16namespace imu {
17
28public:
29 virtual ~IMUDataSource() = default;
30
35 virtual Capability imuSpec() const = 0;
46 virtual void imuConvertParam(imu_convert_param_t& out) const = 0;
47
56 virtual bool sleep()
57 {
58 return false;
59 }
68 virtual bool wakeup()
69 {
70 return false;
71 }
72};
73
74} // namespace imu
75} // namespace m5
76#endif
Thin contract between measurement units and consumers (e.g. AHRS)
Definition imu_data_source.hpp:27
virtual bool sleep()
Put the device into its lowest reversible power state.
Definition imu_data_source.hpp:56
virtual Capability readImuRaw(imu_raw_data_t &out)=0
Pop the oldest unconsumed raw sample.
virtual void imuConvertParam(imu_convert_param_t &out) const =0
Conversion coefficients for this source.
virtual bool wakeup()
Bring the device back from sleep()
Definition imu_data_source.hpp:68
virtual Capability imuSpec() const =0
What this source can provide.
Common types for M5Unit-IMU.
Capability
Capability of the IMU data source (bitwise combinable)
Definition imu_types.hpp:22
Top level namespace of M5Stack.
Definition ahrs_controller.cpp:26
Raw to physical unit conversion coefficients.
Definition imu_types.hpp:69
Unified raw data (chip-native axes, no remap applied)
Definition imu_types.hpp:57