Subversion Repositories FlightCtrl

Rev

Rev 1971 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1971 Rev 2018
1
#ifndef _SENSORS_H
1
#ifndef _SENSORS_H
2
#define _SENSORS_H
2
#define _SENSORS_H
3
 
3
 
4
#include <inttypes.h>
4
#include <inttypes.h>
5
#include "configuration.h"
5
#include "configuration.h"
6
 
-
 
7
/*
-
 
8
 * Whether (pitch, roll, yaw) gyros are reversed (see analog.h).
-
 
9
 */
-
 
10
extern const uint8_t GYRO_REVERSED[3];
-
 
11
 
-
 
12
/*
-
 
13
 * Whether (pitch, roll, Z) acc. meters are reversed(see analog.h).
-
 
14
 */
-
 
15
extern const uint8_t ACC_REVERSED[3];
6
 
16
extern sensorOffset_t gyroAmplifierOffset;
7
extern sensorOffset_t gyroAmplifierOffset;
17
 
8
 
18
/*
9
/*
19
 * Common procedures for all gyro types.
10
 * Common procedures for all gyro types.
20
 * FC 1.3 hardware: Searching the DAC values that return neutral readings.
11
 * FC 1.3 hardware: Searching the DAC values that return neutral readings.
21
 * FC 2.0 hardware: Nothing to do.
12
 * FC 2.0 hardware: Nothing to do.
22
 * InvenSense hardware: Output a pulse on the AUTO_ZERO line.
13
 * InvenSense hardware: Output a pulse on the AUTO_ZERO line.
23
 */
14
 */
24
void gyro_calibrate(void);
15
void gyro_calibrate(void);
25
 
16
 
26
/*
17
/*
27
 * FC 1.3: Output data in gyroAmplifierOffset to DAC. All other versions: Do nothing.
18
 * FC 1.3: Output data in gyroAmplifierOffset to DAC. All other versions: Do nothing.
28
 */
19
 */
29
void gyro_loadAmplifierOffsets(uint8_t overwriteWithDefaults);
20
void gyro_init(void);
30
 
21
 
31
/*
22
/*
32
 * Set some default FC parameters, depending on gyro type: Drift correction etc.
23
 * Set some default FC parameters, depending on gyro type: Drift correction etc.
33
 */
24
 */
34
void gyro_setDefaultParameters(void);
25
void gyro_setDefaultParameters(void);
35
 
26
 
36
#endif
27
#endif
37
 
28