-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathEEPROM.h
55 lines (43 loc) · 1.81 KB
/
EEPROM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Copyright (C) 2015 Kristian Sloth Lauszus. All rights reserved.
This software may be distributed and modified under the terms of the GNU
General Public License version 2 (GPL2) as published by the Free Software
Foundation and appearing in the file GPL2.TXT included in the packaging of
this file. Please note that GPL2 Section 2[b] requires that all works based
on this software must also be made publicly available under the terms of
the GPL2 ("Copyleft").
Contact information
-------------------
Kristian Sloth Lauszus
Web : http://www.lauszus.com
e-mail : [email protected]
*/
#ifndef __eeprom_h__
#define __eeprom_h__
#include "PID.h"
#include "Types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
// Can be set by the user
pid_values_t pidRollPitchValues, pidYawValues; // Use same PID values for both pitch and roll, but different values for yaw
pid_values_t pidSonarAltHoldValues, pidBaroAltHoldValues; // PID values for altitude hold
float angleKp; // Self level mode Kp value
float headKp; // Heading mode Kp value
uint8_t maxAngleInclination; // Max angle in self level mode
uint8_t maxAngleInclinationDistSensor; // Max angle when using sonar or LIDAR-Lite v3 in altitude hold mode
float stickScalingRollPitch, stickScalingYaw; // Stick scaling values
// Will be set by the microcontroller
bool calibrateESCs; // Flag used to tell if it should calibrate ESCs at next power cycle
sensorRaw_t accZero; // Accelerometer calibration values
sensor_t magZero; // Magnetometer calibration values
bool configureBtModule; // Used in order to configure the Bluetooth module the first time it is powered on
} config_t;
extern config_t cfg;
void initEEPROM(void);
void setDefaultConfig(void);
void updateConfig(void);
#ifdef __cplusplus
}
#endif
#endif