Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
bmi088_data.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2022 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_BMI088_DATA_HPP_
25#define TAPROOT_BMI088_DATA_HPP_
26
27#include "modm/architecture/interface/register.hpp"
28#include "modm/math/utils.hpp"
29
31{
37{
38public:
42 static constexpr uint8_t BMI088_READ_BIT = 0x80;
43
44 struct Gyro
45 {
71
73 static constexpr uint8_t GYRO_CHIP_ID_VALUE = 0x0f;
74
75 enum class GyroIntStat1 : uint8_t
76 {
77 GYRO_DRDY = modm::Bit7,
78 FIFO_INT = modm::Bit4,
79 };
81
82 enum class FifoStatus : uint8_t
83 {
84 FIFO_OVERRUN = modm::Bit7,
85 FIFO_FRAME_COUNTER = static_cast<uint8_t>(~modm::Bit7),
86 };
88
89 enum class GyroRange : uint8_t
90 {
91 DPS2000 = 0x00,
92 DPS1000 = 0x01,
93 DPS500 = 0x02,
94 DPS250 = 0x03,
95 DPS125 = 0x04,
96 };
98
99 enum class GyroBandwidth : uint8_t
100 {
104 ODR400_BANDWIDTH47 = 0x03,
105 ODR200_BANDWIDTH23 = 0x04,
106 ODR100_BANDWIDTH12 = 0x05,
107 ODR200_BANDWIDTH64 = 0x06,
108 ODR100_BANDWIDTH32 = 0x07,
109 };
111
112 enum class GyroLpm1
113 {
114 PWRMODE_NORMAL = 0x00,
115 PWRMODE_SUSPEND = 0x80,
117 };
119
120 enum class GyroSoftreset : uint8_t
121 {
122 RESET_SENSOR = 0xb6
123 };
125
126 enum class GyroIntCtrl : uint8_t
127 {
128 EnableNewDataInt_Mask = modm::Bit7,
129 EnableFifoInt_Mask = modm::Bit6,
130 };
132
133 enum class EnableNewDataInt : uint8_t
134 {
135 DISABLED = 0x00,
136 ENABLED = 0x01,
137 };
139
140 enum class EnableFifoInt : uint8_t
141 {
142 DISABLED = 0x00,
143 ENABLED = 0x01,
144 };
146
147 enum class Int3Int4IoConf : uint8_t
148 {
149 Int4Od_Mask = modm::Bit3,
150 Int4Lvl_Mask = modm::Bit2,
151 Int3Od_Mask = modm::Bit1,
152 Int3Lvl_Mask = modm::Bit0,
153 };
155
156 enum class Int4Od : uint8_t
157 {
158 PUSH_PULL = 0,
159 OPEN_DRAIN = 1,
160 };
162
163 enum class Int4Lvl : uint8_t
164 {
165 ACTIVE_LOW = 0,
166 ACTIVE_HIGH = 1,
167 };
169
170 enum class Int3Od : uint8_t
171 {
172 PUSH_PULL = 0,
173 OPEN_DRAIN = 1,
174 };
176
177 enum class Int3Lvl : uint8_t
178 {
179 ACTIVE_LOW = 0,
180 ACTIVE_HIGH = 1,
181 };
183
184 enum class Int3Int4IoMap : uint8_t
185 {
186 DATA_READY_INT4 = modm::Bit7,
187 FIFO_INT4 = modm::Bit5,
188 FIFO_INT3 = modm::Bit2,
189 DATA_READY_INT3 = modm::Bit0,
190 };
192
193 enum class FifoWmEnable : uint8_t
194 {
197 };
199
200 enum class FifoExtIntS : uint8_t
201 {
203 EXT_FIFO_S_SEL = modm::Bit4,
204 };
206
207 enum class GyroSelfTest : uint8_t
208 {
209 RATE_OK = modm::Bit4,
210 BIST_FAIL = modm::Bit2,
211 BIST_RDY = modm::Bit1,
212 TRIG_BIST = modm::Bit0,
213 };
215
221 enum class FifoConfig0 : uint8_t
222 {
223 FIFO_WATER_MARK_LVL_TRIGGER_RETAIN = static_cast<uint8_t>(~modm::Bit7),
224 };
226
227 enum class FifoConfig1 : uint8_t
228 {
229 FIFO = 0x40,
230 STREAM = 0x80,
231 };
233
234 using Registers_t = modm::FlagsGroup<
235 GyroIntStat1_t,
236 FifoStatus_t,
237 GyroRange_t,
238 GyroBandwidth_t,
239 GyroLpm1_t,
240 GyroSoftreset_t,
241 GyroIntCtrl_t,
242 Int3Int4IoConf_t,
243 Int3Int4IoMap_t,
244 FifoWmEnable_t,
245 FifoExtIntS_t,
246 GyroSelfTest_t,
247 FifoConfig0_t,
248 FifoConfig1_t>;
249 };
250
251 struct Acc
252 {
284
286 static constexpr uint8_t ACC_CHIP_ID_VALUE = 0x1e;
287
288 enum class AccErr : uint8_t
289 {
290 ERROR_CODE = modm::Bit2 | modm::Bit3 | modm::Bit4,
291 FATAL_ERR = modm::Bit0,
292 };
294
295 enum class AccStatus : uint8_t
296 {
297 ACC_DRDY = modm::Bit7,
298 };
300
301 enum class AccIntStat1 : uint8_t
302 {
303 ACC_DRDY = modm::Bit7,
304 };
306
307 enum class AccConf : uint8_t
308 {
309 AccBandwidth_Mask = modm::Bit4 | modm::Bit5 | modm::Bit6 | modm::Bit7,
310 AccOutputRate_Mask = modm::Bit0 | modm::Bit1 | modm::Bit2 | modm::Bit3,
311 };
313
315 enum class AccBandwidth : uint8_t
316 {
317 OSR4_OVERSAMPLING = 0x08,
318 OSR2_OVERSAMPLING = 0x09,
319 NORMAL = 0x0a,
320 };
321 typedef modm::Configuration<AccConf_t, AccBandwidth, 0b1111, 4> AccBandwidth_t; // Bit 4..7
322
323 enum class AccOutputRate : uint8_t
324 {
325 Hz12_5 = 0x05,
326 Hz25 = 0x06,
327 Hz50 = 0x07,
328 Hz100 = 0x08,
329 Hz200 = 0x09,
330 Hz400 = 0x0a,
331 Hz800 = 0x0b,
332 Hz1600 = 0x0c,
333 };
335
336 enum class AccRange : uint8_t
337 {
338 G3 = 0x0,
339 G6 = 0x1,
340 G12 = 0x2,
341 G24 = 0x03,
342 };
344
345 enum class IntMapData : uint8_t
346 {
347 INT2_DRDY = modm::Bit6,
348 Int2_FWRM = modm::Bit5,
349 INT2_FFULL = modm::Bit4,
350 INT1_DRDY = modm::Bit2,
351 INT1_FWM = modm::Bit1,
352 INT1_FFULL = modm::Bit0,
353 };
355
356 enum class Int1IoConf : uint8_t
357 {
358 INT1_IN = modm::Bit4,
359 INT1_OUT = modm::Bit3,
360 Int1Od_Mask = modm::Bit2,
361 Int1Lvl_Mask = modm::Bit1,
362 };
364
365 enum class Int1Od : uint8_t
366 {
367 PUSH_PULL = 0,
368 OPEN_DRAIN = 1,
369 };
370 typedef modm::Configuration<Int1IoConf_t, Int1Od, 0b1, 2> Int1Od_t;
371
372 enum class Int1Lvl : uint8_t
373 {
374 ACTIVE_LOW = 0,
375 ACTIVE_HIGH = 1,
376 };
377 typedef modm::Configuration<Int1IoConf_t, Int1Lvl, 0b1, 1> Int1Lvl_t;
378
379 enum class Int2IoConf : uint8_t
380 {
381 INT2_IO = modm::Bit4,
382 INT2_OUT = modm::Bit3,
383 Int2Od_Mask = modm::Bit2,
384 Int2Lvl_Mask = modm::Bit1,
385 };
387
388 enum class Int2Od : uint8_t
389 {
390 PUSH_PULL = 0,
391 OPEN_DRAIN = 1,
392 };
393 typedef modm::Configuration<Int2IoConf_t, Int2Od, 0b1, 2> Int2Od_t;
394
395 enum class Int2Lvl : uint8_t
396 {
397 ACTIVE_LOW = 0x00,
398 ACTIVE_HIGH = 0x01,
399 };
400 typedef modm::Configuration<Int2IoConf_t, Int2Lvl, 0b1, 1> Int2Lv1_t;
401
402 enum class AccSelfTest : uint8_t
403 {
404 SELF_TEST_OFF = 0x00,
407 };
409
410 enum class AccPwrConf : uint8_t
411 {
412 ACTIVE_MODE = 0x00,
413 SUSPEND_MODE = 0x03
414 };
416
417 enum class AccPwrCtrl : uint8_t
418 {
419 ACCELEROMETER_OFF = 0X00,
420 ACCELEROMETER_ON = 0X04
421 };
423
425 enum class AccSoftreset : uint8_t
426 {
427 ACC_SOFTRESET_VAL = 0xb6,
428 };
430
431 using Registers_t = modm::FlagsGroup<
432 AccErr_t,
433 AccStatus_t,
434 AccIntStat1_t,
435 AccConf_t,
436 Int1IoConf_t,
437 Int2IoConf_t,
438 AccSelfTest_t,
439 AccRange_t,
440 AccPwrConf_t,
441 AccPwrCtrl_t,
442 AccSoftreset_t,
443 IntMapData_t>;
444 };
445};
446
447} // namespace tap::communication::sensors::imu::bmi088
448
449#endif // TAPROOT_BMI088_DATA_HPP_
static constexpr uint8_t BMI088_READ_BIT
Definition bmi088_data.hpp:42
Definition can.hpp:32
modm::Configuration< AccConf_t, AccBandwidth, 0b1111, 4 > AccBandwidth_t
Definition bmi088_data.hpp:321
modm::Configuration< Int2IoConf_t, Int2Lvl, 0b1, 1 > Int2Lv1_t
Definition bmi088_data.hpp:400
modm::Configuration< Int2IoConf_t, Int2Od, 0b1, 2 > Int2Od_t
Definition bmi088_data.hpp:393
static constexpr uint8_t ACC_CHIP_ID_VALUE
The id of the accelerometer that will is stored in address ACC_CHIP_ID.
Definition bmi088_data.hpp:286
modm::FlagsGroup< AccErr_t, AccStatus_t, AccIntStat1_t, AccConf_t, Int1IoConf_t, Int2IoConf_t, AccSelfTest_t, AccRange_t, AccPwrConf_t, AccPwrCtrl_t, AccSoftreset_t, IntMapData_t > Registers_t
Definition bmi088_data.hpp:443
modm::Configuration< Int1IoConf_t, Int1Lvl, 0b1, 1 > Int1Lvl_t
Definition bmi088_data.hpp:377
Register
List of register addresses for the bmi088's accelerometer.
Definition bmi088_data.hpp:255
AccSoftreset
Writing this to the AccSoftreset register will perform a soft reset of the IMU.
Definition bmi088_data.hpp:426
modm::Configuration< Int1IoConf_t, Int1Od, 0b1, 2 > Int1Od_t
Definition bmi088_data.hpp:370
static constexpr uint8_t GYRO_CHIP_ID_VALUE
The id of the gyroscope that will is stored in address GYRO_CHIP_ID.
Definition bmi088_data.hpp:73
modm::FlagsGroup< GyroIntStat1_t, FifoStatus_t, GyroRange_t, GyroBandwidth_t, GyroLpm1_t, GyroSoftreset_t, GyroIntCtrl_t, Int3Int4IoConf_t, Int3Int4IoMap_t, FifoWmEnable_t, FifoExtIntS_t, GyroSelfTest_t, FifoConfig0_t, FifoConfig1_t > Registers_t
Definition bmi088_data.hpp:248