M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
unit_mpu6500.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_MPU6500_HPP
11#define M5_UNIT_IMU_UNIT_UNIT_MPU6500_HPP
12
13#include "unit_mpu6xxx.hpp"
14
15namespace m5 {
16namespace unit {
17
24class UnitMPU6500 : public UnitMPU6xxx {
25 M5_UNIT_COMPONENT_HPP_BUILDER(UnitMPU6500, 0x68);
26
27public:
28 explicit UnitMPU6500(const uint8_t addr = DEFAULT_ADDRESS) : UnitMPU6xxx(addr)
29 {
30 }
31
32protected:
33 // 0x70 = standalone MPU-6500; 0x71 = the MPU-6500-class accel/gyro die inside an MPU-9250.
34 inline bool accepts_whoami(const uint8_t id) const override
35 {
36 return id == 0x70 || id == 0x71;
37 }
38 inline float temperature_res() const override
39 {
40 return 1.0f / 333.87f;
41 }
42 inline float temperature_offset() const override
43 {
44 return 21.0f;
45 }
46};
47
48} // namespace unit
49} // namespace m5
50#endif
TDK InvenSense MPU-6500 6-axis core (accel + gyro + temp)
Definition unit_mpu6500.hpp:24
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_mpu6500.hpp:34
float temperature_offset() const override
Temperature conversion: degC offset (imu_convert_param_t::temp_offset)
Definition unit_mpu6500.hpp:42
float temperature_res() const override
Temperature conversion: degC per LSB (imu_convert_param_t::temp_res)
Definition unit_mpu6500.hpp:38
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.