M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
unit_dof9.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_DOF9_HPP
11#define M5_UNIT_IMU_UNIT_UNIT_DOF9_HPP
12
13#include <M5UnitComponent.hpp>
14#include "unit_bmi270.hpp"
15#include "unit_bmm350.hpp"
16
17namespace m5 {
18namespace unit {
19
26class UnitDoF9 : public Component {
27 M5_UNIT_COMPONENT_HPP_BUILDER(UnitDoF9, 0xFF /* dummy: parent has no device of its own */);
28
29public:
32 explicit UnitDoF9(const uint8_t bmi_addr = 0x68);
34 virtual ~UnitDoF9()
35 {
36 }
37
40 {
41 return _bmi;
42 }
45 {
46 return _bmm;
47 }
48
50 virtual bool begin() override
51 {
52 return _valid;
53 }
54
55protected:
56 // Share this composite's bus with each child, duplicated at the child's address
57 virtual std::shared_ptr<Adapter> ensure_adapter(const uint8_t ch) override;
58
59private:
60 UnitBMI270 _bmi;
61 UnitBMM350 _bmm;
62 bool _valid{};
63};
64
65} // namespace unit
66} // namespace m5
67#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 DoF9: BMI270 + BMM350, both directly on the GROVE main bus (no AUX bypass). The BMI270 address i...
Definition unit_dof9.hpp:26
UnitBMI270 & imu()
Accel/gyro sub-unit (add to an AhrsController)
Definition unit_dof9.hpp:39
virtual ~UnitDoF9()
Destructor.
Definition unit_dof9.hpp:34
UnitDoF9(const uint8_t bmi_addr=0x68)
Construct with the BMI270's I2C address (the composite children derive from this)
Definition unit_dof9.cpp:23
UnitBMM350 & mag()
Magnetometer sub-unit (add to an AhrsController)
Definition unit_dof9.hpp:44
virtual bool begin() override
Begin: children are begun by the framework (all on the shared bus, any order)
Definition unit_dof9.hpp:50
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.