M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
unit_dof10.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_UNIT_UNIT_DOF10_HPP
11#define M5_UNIT_IMU_UNIT_UNIT_DOF10_HPP
12
13#include <M5UnitComponent.hpp>
14#include <M5UnitUnifiedENV.h> // UnitSPA06 is provided by M5Unit-ENV (the barometer drivers live there)
15#include "unit_bmi270.hpp"
16#include "unit_bmm350.hpp"
17
18namespace m5 {
19namespace unit {
20
28class UnitDoF10 : public Component {
29 M5_UNIT_COMPONENT_HPP_BUILDER(UnitDoF10, 0xFF /* dummy: parent has no device of its own */);
30
31public:
34 explicit UnitDoF10(const uint8_t bmi_addr = 0x68);
36 virtual ~UnitDoF10()
37 {
38 }
39
42 {
43 return _bmi;
44 }
47 {
48 return _bmm;
49 }
51 UnitSPA06& baro()
52 {
53 return _spa;
54 }
55
57 virtual bool begin() override
58 {
59 return _valid;
60 }
61
62protected:
63 // Share this composite's bus with each child, duplicated at the child's address
64 virtual std::shared_ptr<Adapter> ensure_adapter(const uint8_t ch) override;
65
66private:
67 UnitBMI270 _bmi;
68 UnitBMM350 _bmm;
69 UnitSPA06 _spa;
70 bool _valid{};
71};
72
73} // namespace unit
74} // namespace m5
75#endif
6-axis (accel + gyro) IMU unit. CoreS3/AtomS3R built-in
Definition unit_bmi270.hpp:34
3-axis magnetometer unit (U231, GROVE)
Definition unit_bmm350.hpp:28
Unit DoF10: BMI270 + BMM350 + SPA06, all directly on the GROVE main bus (no AUX bypass)....
Definition unit_dof10.hpp:28
UnitSPA06 & baro()
Barometer sub-unit (read directly; not AHRS-fused)
Definition unit_dof10.hpp:51
UnitBMI270 & imu()
Accel/gyro sub-unit (add to an AhrsController)
Definition unit_dof10.hpp:41
UnitDoF10(const uint8_t bmi_addr=0x68)
Construct with the BMI270's I2C address (the composite children derive from this)
Definition unit_dof10.cpp:23
virtual ~UnitDoF10()
Destructor.
Definition unit_dof10.hpp:36
UnitBMM350 & mag()
Magnetometer sub-unit (add to an AhrsController)
Definition unit_dof10.hpp:46
virtual bool begin() override
Begin: children are begun by the framework (all on the shared bus, any order)
Definition unit_dof10.hpp:57
Top level namespace of M5Stack.
Definition ahrs_controller.cpp:26
Unit-related namespace.
UnitBMI270 (6-axis IMU) unit component.
UnitBMM350 (3-axis magnetometer, U231) unit component.