NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
accelerometer.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 
33 typedef struct rollAndPitchTrims_s {
34  int16_t roll;
35  int16_t pitch;
36 } __attribute__((packed)) rollAndPitchTrims_t_def;
37 
38 typedef union rollAndPitchTrims_u {
39  int16_t raw[2];
40  rollAndPitchTrims_t_def values;
41 } __attribute__((packed)) rollAndPitchTrims_t;
42 
43 typedef struct accDeadband_s {
44  uint8_t xy;
45  uint8_t z;
46 } __attribute__((packed)) accDeadband_t;
47 
49  rollAndPitchTrims_t trims;
50 
51  // sensor-related stuff
52  uint8_t acc_cut_hz;
54  accDeadband_t accDeadband;
55  uint8_t acc_unarmedcal;
56 } __attribute__((packed)) ;
57 
int16_t pitch
Definition: accelerometer.h:35
uint8_t acc_unarmedcal
turn automatic acc compensation on/off
Definition: accelerometer.h:57
float accz_lpf_cutoff
cutoff frequency for the low pass filter used on the acc z-axis for althold in Hz ...
Definition: accelerometer.h:53
uint8_t xy
set the acc deadband for xy-Axis
Definition: accelerometer.h:44
Definition: accelerometer.h:43
uint8_t acc_cut_hz
Set the Low Pass Filter factor for ACC. Reducing this value would reduce ACC noise (visible in GUI)...
Definition: accelerometer.h:54
int16_t roll
Definition: accelerometer.h:34
uint8_t z
set the acc deadband for z-Axis, this ignores small accelerations
Definition: accelerometer.h:45
struct rollAndPitchTrims_s __attribute__((packed)) rollAndPitchTrims_t_def
rollAndPitchTrims_t trims
accelerometer trim
Definition: accelerometer.h:49
Definition: accelerometer.h:38
Definition: accelerometer.h:48
int16_t raw[2]
Definition: accelerometer.h:51
accDeadband_t accDeadband
Definition: accelerometer.h:56
rollAndPitchTrims_t_def values
Definition: accelerometer.h:40
Definition: accelerometer.h:33