M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
unit_mpu6886.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_MPU6886_HPP
11#define M5_UNIT_IMU_UNIT_UNIT_MPU6886_HPP
12
13#include "unit_mpu6xxx.hpp"
14
15namespace m5 {
16namespace unit {
17
22class UnitMPU6886 : public UnitMPU6xxx {
23 M5_UNIT_COMPONENT_HPP_BUILDER(UnitMPU6886, 0x68);
24
25public:
26 explicit UnitMPU6886(const uint8_t addr = DEFAULT_ADDRESS) : UnitMPU6xxx(addr)
27 {
28 }
29
30protected:
31 inline bool accepts_whoami(const uint8_t id) const override
32 {
33 return id == 0x19;
34 }
35 inline float temperature_res() const override
36 {
37 return 1.0f / 326.8f;
38 }
39 inline float temperature_offset() const override
40 {
41 return 25.0f;
42 }
43};
44
45} // namespace unit
46} // namespace m5
47#endif
TDK InvenSense MPU-6886 6-axis IMU (accel + gyro + temp). WHO_AM_I 0x19.
Definition unit_mpu6886.hpp:22
bool accepts_whoami(const uint8_t id) const override
Accepted WHO_AM_I id(s) for this chip; begin() rejects the device unless this returns true.
Definition unit_mpu6886.hpp:31
float temperature_res() const override
Temperature conversion: degC per LSB (imu_convert_param_t::temp_res)
Definition unit_mpu6886.hpp:35
float temperature_offset() const override
Temperature conversion: degC offset (imu_convert_param_t::temp_offset)
Definition unit_mpu6886.hpp:39
Shared base for the TDK InvenSense MPU 6-axis family (accel + gyro + temp)
Definition unit_mpu6xxx.hpp:33
UnitMPU6xxx(const uint8_t addr=DEFAULT_ADDRESS)
Protected: UnitMPU6xxx is abstract, constructed only by concrete derived chips.
Definition unit_mpu6xxx.cpp:37
Top level namespace of M5Stack.
Definition ahrs_controller.cpp:26
Unit-related namespace.
UnitMPU6xxx: shared base for the InvenSense MPU 6-axis family.