Create set-home.md
[u360gts.git] / src / main / tracker / defines.h
bloba23a73e51d0a051bfc57eb2019296397444a0365
1 /*
2 * This file is part of u360gts, aka amv-open360tracker 32bits:
3 * https://github.com/raul-ortega/amv-open360tracker-32bits
5 * The code below is an adaptation by Raúl Ortega of the original code written by Samuel Brucksch:
6 * https://github.com/SamuelBrucksch/open360tracker
8 * u360gts 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.
13 * u360gts 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.
18 * You should have received a copy of the GNU General Public License
19 * along with u360gts. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef DEFINES_H
24 #define DEFINES_H
26 #include "Arduino.h"
27 #include <stdbool.h>
28 #include <stdint.h>
29 #include "config.h"
32 * Lat/Lon in units of millionths of a degree
33 * Altitude from -32.768m to 32.767m
34 * Heading from 0 to - 3599
35 * Distance from 0 ... 64000 meters
37 typedef struct {
38 int32_t lat;
39 int32_t lon;
40 int16_t alt;
41 uint16_t heading;
42 uint32_t distance;
43 int16_t home_alt;
45 positionVector_t;
47 typedef struct {
48 uint16_t distance;
49 uint16_t heading;
50 uint16_t speed;
51 } epsVectorGain_t;
53 #define toRad(val) val * PI/180.0f
54 #define toDeg(val) val * 180.0f/PI
56 #define meter2feet(value) value * 3.2808399
57 #define feet2meter(value) value * 0.3048
59 #endif