Mercurial > public > ostc4
annotate Small_CPU/Inc/GNSS.h @ 931:5a9bc2e6112d Evo_2_23
Added Sat Status Overview:
In addition to the navigation data now information regarding the satelliete and signal status are visualized. To enable the a new command has been added to the communication protocol and the position view has been extended.
author | Ideenmodellierer |
---|---|
date | Tue, 03 Dec 2024 20:32:51 +0100 |
parents | 2225c467f1e9 |
children | 43055e069bd1 |
rev | line source |
---|---|
887 | 1 /* |
2 * GNSS.h | |
3 * | |
4 * Created on: 03.10.2020 | |
5 * Author: SimpleMethod | |
6 * | |
7 *Copyright 2020 SimpleMethod | |
8 * | |
9 *Permission is hereby granted, free of charge, to any person obtaining a copy of | |
10 *this software and associated documentation files (the "Software"), to deal in | |
11 *the Software without restriction, including without limitation the rights to | |
12 *use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
13 *of the Software, and to permit persons to whom the Software is furnished to do | |
14 *so, subject to the following conditions: | |
15 * | |
16 *The above copyright notice and this permission notice shall be included in all | |
17 *copies or substantial portions of the Software. | |
18 * | |
19 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
25 *THE SOFTWARE. | |
26 ****************************************************************************** | |
27 */ | |
28 | |
29 #ifndef INC_GNSS_H_ | |
30 #define INC_GNSS_H_ | |
31 | |
32 #include "stm32f4xx_hal.h" | |
33 | |
34 union u_Short | |
35 { | |
36 uint8_t bytes[2]; | |
37 unsigned short uShort; | |
38 }; | |
39 | |
40 union i_Short | |
41 { | |
42 uint8_t bytes[2]; | |
43 signed short iShort; | |
44 }; | |
45 | |
46 union u_Long | |
47 { | |
48 uint8_t bytes[4]; | |
49 unsigned long uLong; | |
50 }; | |
51 | |
52 union i_Long | |
53 { | |
54 uint8_t bytes[4]; | |
55 signed long iLong; | |
56 }; | |
57 | |
58 typedef struct | |
59 { | |
60 UART_HandleTypeDef *huart; | |
61 | |
62 uint8_t uniqueID[4]; | |
931 | 63 uint8_t uartWorkingBuffer[255]; |
887 | 64 |
65 unsigned short year; | |
66 uint8_t yearBytes[2]; | |
67 uint8_t month; | |
68 uint8_t day; | |
69 uint8_t hour; | |
70 uint8_t min; | |
71 uint8_t sec; | |
72 uint8_t fixType; | |
73 | |
74 signed long lon; | |
75 uint8_t lonBytes[4]; | |
76 signed long lat; | |
77 uint8_t latBytes[4]; | |
78 float fLon; | |
79 float fLat; | |
80 | |
81 signed long height; | |
82 signed long hMSL; | |
83 uint8_t hMSLBytes[4]; | |
84 unsigned long hAcc; | |
85 unsigned long vAcc; | |
86 | |
87 signed long gSpeed; | |
88 uint8_t gSpeedBytes[4]; | |
89 signed long headMot; | |
90 | |
931 | 91 uint8_t numSat; |
92 uint8_t statSat[4]; | |
93 | |
887 | 94 }GNSS_StateHandle; |
95 | |
96 GNSS_StateHandle GNSS_Handle; | |
97 | |
98 | |
99 enum GNSSMode{Portable=0, Stationary=1, Pedestrian=2, Automotiv=3, Airbone1G=5, Airbone2G=6,Airbone4G=7,Wirst=8,Bike=9}; | |
100 | |
101 static const uint8_t configUBX[]={0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x80,0x25,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x9A,0x79}; | |
102 | |
103 static const uint8_t setNMEA410[]={0xB5,0x62,0x06,0x17,0x14,0x00,0x00,0x41,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x75,0x57}; | |
104 | |
105 //Activation of navigation system: Galileo, Glonass, GPS, SBAS, IMES | |
106 static const uint8_t setGNSS[]={0xB5,0x62,0x06,0x3E,0x24,0x00,0x00,0x00,0x20,0x04,0x00,0x08,0x10,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x03,0x00,0x01,0x00,0x01,0x01,0x02,0x04,0x08,0x00,0x01,0x00,0x01,0x01,0x06,0x08,0x0E,0x00,0x01,0x00,0x01,0x01,0xDF,0xFB}; | |
107 | |
108 static const uint8_t getDeviceID[]={0xB5,0x62,0x27,0x03,0x00,0x00,0x2A,0xA5}; | |
109 | |
110 static const uint8_t getNavigatorData[]={0xB5,0x62,0x01,0x21,0x00,0x00,0x22,0x67}; | |
111 | |
112 static const uint8_t getPOSLLHData[]={0xB5,0x62,0x01,0x02,0x00,0x00,0x03,0x0A}; | |
113 | |
114 static const uint8_t getPVTData[]={0xB5,0x62,0x01,0x07,0x00,0x00,0x08,0x19}; | |
115 | |
931 | 116 static const uint8_t getNavSat[]={0xB5,0x62,0x01,0x35,0x00,0x00,0x36,0xA3}; |
117 | |
887 | 118 static const uint8_t setPortableMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x00,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x3C}; |
119 | |
120 static const uint8_t setStationaryMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x02,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80}; | |
121 | |
122 static const uint8_t setPedestrianMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x03,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0xA2}; | |
123 | |
124 static const uint8_t setAutomotiveMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x04,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xC4}; | |
125 | |
126 //static const uint8_t setSeaMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x05,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0xE6}; | |
127 | |
128 static const uint8_t setAirbone1GMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x06,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x08}; | |
129 | |
130 static const uint8_t setAirbone2GMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x07,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x85,0x2A}; | |
131 | |
132 static const uint8_t setAirbone4GMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x08,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x4C}; | |
133 | |
134 static const uint8_t setWirstMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x09,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x87,0x6E}; | |
135 | |
136 static const uint8_t setBikeMode[]={0xB5,0x62,0x06,0x24,0x24,0x00,0xFF,0xFF,0x0A,0x03,0x00,0x00,0x00,0x00,0x10,0x27,0x00,0x00,0x05,0x00,0xFA,0x00,0xFA,0x00,0x64,0x00,0x5E,0x01,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x90}; | |
137 | |
138 static const uint8_t setPortableType[]={}; | |
139 void GNSS_Init(GNSS_StateHandle *GNSS, UART_HandleTypeDef *huart); | |
140 void GNSS_LoadConfig(GNSS_StateHandle *GNSS); | |
899
2225c467f1e9
Added data path and visualization for position data:
Ideenmodellierer
parents:
887
diff
changeset
|
141 uint8_t GNSS_ParseBuffer(GNSS_StateHandle *GNSS); |
887 | 142 |
143 void GNSS_GetUniqID(GNSS_StateHandle *GNSS); | |
144 void GNSS_ParseUniqID(GNSS_StateHandle *GNSS); | |
145 | |
146 void GNSS_GetNavigatorData(GNSS_StateHandle *GNSS); | |
147 void GNSS_ParseNavigatorData(GNSS_StateHandle *GNSS); | |
931 | 148 void GNSS_ParseNavSatData(GNSS_StateHandle *GNSS); |
887 | 149 |
150 void GNSS_GetPOSLLHData(GNSS_StateHandle *GNSS); | |
151 void GNSS_ParsePOSLLHData(GNSS_StateHandle *GNSS); | |
152 | |
153 void GNSS_GetPVTData(GNSS_StateHandle *GNSS); | |
154 void GNSS_ParsePVTData(GNSS_StateHandle *GNSS); | |
155 | |
156 void GNSS_SetMode(GNSS_StateHandle *GNSS, short gnssMode); | |
157 #endif /* INC_GNSS_H_ */ | |
158 | |
159 | |
160 |