NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
imu.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Copyright: collective.
5  * Cleanup: Martin Schröder <mkschreder.uk@gmail.com>
6  * Original source from Cleanflight.
7  *
8  * Ninjaflight is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Ninjaflight is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 struct imu_config {
25  // IMU configuration
26  uint16_t looptime; // imu loop time in us
27  uint8_t gyroSync; // Enable interrupt based loop
28  uint8_t gyroSyncDenominator; // Gyro sync Denominator
29  uint16_t dcm_kp; // DCM filter proportional gain ( x 10000)
30  uint16_t dcm_ki; // DCM filter integral gain ( x 10000)
31  uint8_t small_angle; // Angle used for mag hold threshold.
32  uint16_t max_angle_inclination; // max inclination allowed in angle (level) mode. default 500 (50 degrees).
33 } __attribute__((packed)) ;
34 
35 
37  uint16_t throttle_correction_angle; // the angle when the throttle correction is maximal. in 0.1 degres, ex 225 = 22.5 ,30.0, 450 = 45.0 deg
38  uint8_t throttle_correction_value; // the correction that will be applied at throttle_correction_angle.
39 } __attribute__((packed)) ;
40 
Definition: imu.h:36
uint8_t throttle_correction_value
Definition: imu.h:38
uint16_t looptime
Definition: imu.h:26
uint8_t gyroSync
Definition: imu.h:27
uint16_t throttle_correction_angle
Definition: imu.h:37
uint16_t dcm_ki
Definition: imu.h:30
struct imu_config __attribute__((packed))
uint16_t dcm_kp
Definition: imu.h:29
uint8_t small_angle
Definition: imu.h:31
uint8_t gyroSyncDenominator
Definition: imu.h:28
Definition: imu.h:24
uint16_t max_angle_inclination
Definition: imu.h:32