annotate Small_CPU/Src/uartProtocol_GNSS.c @ 936:3029f0332f4f Evo_2_23

GNSS introduced power saving mode: In the previous implementation the modul always did a cold start. In the new one the power saving functions of the module are activated. The module will be switched to intervall mode while entering sleep. If the computer remains in sleep for a long time then the GNSS modul will be switchen of completly.
author Ideenmodellierer
date Sun, 08 Dec 2024 22:03:07 +0100
parents effadaa3a1f7
children f41974734268
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
1 /**
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
2 ******************************************************************************
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
3 * @file uartProtocol_GNSS.c
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
4 * @author heinrichs weikamp gmbh
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
5 * @version V0.0.1
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
6 * @date 30-Sep-2024
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
7 * @brief Interface functionality operation of GNSS devices
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
8 *
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
9 @verbatim
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
10
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
11
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
12 @endverbatim
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
13 ******************************************************************************
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
14 * @attention
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
15 *
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
16 * <h2><center>&copy; COPYRIGHT(c) 2024 heinrichs weikamp</center></h2>
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
17 *
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
18 ******************************************************************************
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
19 */
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
20 /* Includes ------------------------------------------------------------------*/
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
21
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
22 #include <string.h>
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
23 #include "scheduler.h"
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
24 #include <uartProtocol_GNSS.h>
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
25 #include "uart.h"
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
26 #include "GNSS.h"
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
27 #include "configuration.h"
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
28 #include "externalInterface.h"
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
29
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
30
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
31 #if defined ENABLE_GNSS || defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
32
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
33 static uartGnssStatus_t gnssState = UART_GNSS_INIT;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
34 static gnssRequest_s activeRequest = {0,0};
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
35
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
36 static receiveStateGnss_t rxState = GNSSRX_READY;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
37 static uint8_t GnssConnected = 0; /* Binary indicator if a sensor is connected or not */
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
38 static uint8_t writeIndex = 0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
39 static uint8_t dataToRead = 0;
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
40 static uint8_t ReqPowerDown = 0;
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
41
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
42 void ConvertByteToHexString(uint8_t byte, char* str)
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
43 {
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
44 uint8_t worker = 0;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
45 uint8_t digit = 0;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
46 uint8_t digitCnt = 1;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
47
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
48 worker = byte;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
49 while((worker!=0) && (digitCnt != 255))
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
50 {
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
51 digit = worker % 16;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
52 if( digit < 10)
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
53 {
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
54 digit += '0';
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
55 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
56 else
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
57 {
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
58 digit += 'A' - 10;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
59 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
60 str[digitCnt--]= digit;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
61 worker = worker / 16;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
62 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
63 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
64
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
65 void uartGnss_ReqPowerDown(uint8_t request)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
66 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
67 if(GnssConnected)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
68 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
69 ReqPowerDown = 1;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
70 }
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
71 }
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
72
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
73 uartGnssStatus_t uartGnss_GetState()
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
74 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
75 return gnssState;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
76 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
77 void uartGnss_SetState(uartGnssStatus_t newState)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
78 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
79 gnssState = newState;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
80 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
81
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
82 void UART_Gnss_SendCmd(uint8_t GnssCmd)
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
83 {
922
7c996354b8ac Moved UART6 into a separate unit:
Ideenmodellierer
parents: 919
diff changeset
84 const uint8_t* pData;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
85 uint8_t txLength = 0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
86
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
87 switch (GnssCmd)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
88 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
89 case GNSSCMD_LOADCONF_0: pData = configUBX;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
90 txLength = sizeof(configUBX) / sizeof(uint8_t);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
91 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
92 case GNSSCMD_LOADCONF_1: pData = setNMEA410;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
93 txLength = sizeof(setNMEA410) / sizeof(uint8_t);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
94 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
95 case GNSSCMD_LOADCONF_2: pData = setGNSS;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
96 txLength = sizeof(setGNSS) / sizeof(uint8_t);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
97 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
98 case GNSSCMD_GET_PVT_DATA: pData = getPVTData;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
99 txLength = sizeof(getPVTData) / sizeof(uint8_t);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
100 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
101 case GNSSCMD_GET_NAV_DATA: pData = getNavigatorData;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
102 txLength = sizeof(getNavigatorData) / sizeof(uint8_t);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
103 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
104 case GNSSCMD_GET_NAVSAT_DATA: pData = getNavSat;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
105 txLength = sizeof(getNavSat) / sizeof(uint8_t);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
106 break;
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
107 case GNSSCMD_MODE_PWS: pData = setPowerLow;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
108 txLength = sizeof(setPowerLow) / sizeof(uint8_t);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
109 break;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
110 case GNSSCMD_MODE_NORMAL: pData = setPowerNormal;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
111 txLength = sizeof(setPowerNormal) / sizeof(uint8_t);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
112 break;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
113 case GNSSCMD_SET_CONFIG: pData = setConfig;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
114 txLength = sizeof(setConfig) / sizeof(uint8_t);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
115 break;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
116 default:
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
117 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
118 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
119 if(txLength != 0)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
120 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
121 activeRequest.class = pData[2];
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
122 activeRequest.id = pData[3];
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
123 UART_SendCmdUbx(pData, txLength);
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
124 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
125 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
126
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
127 void uartGnss_Control(void)
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
128 {
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
129 static uint32_t warmupTick = 0;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
130 static uint8_t dataToggle = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
131 uint8_t activeSensor = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
132 sUartComCtrl* pUartCtrl = UART_GetGnssCtrl();
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
133
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
134 if(pUartCtrl == &Uart1Ctrl)
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
135 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
136 activeSensor = externalInterface_GetActiveUartSensor();
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
137 gnssState = externalInterface_GetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
138 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
139
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
140 switch (gnssState)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
141 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
142 case UART_GNSS_INIT: gnssState = UART_GNSS_WARMUP;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
143 warmupTick = HAL_GetTick();
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
144 UART_clearRxBuffer(pUartCtrl);
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
145 break;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
146 case UART_GNSS_WARMUP: if(time_elapsed_ms(warmupTick,HAL_GetTick()) > 1000)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
147 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
148 gnssState = UART_GNSS_LOADCONF_0;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
149 }
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
150 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
151 case UART_GNSS_LOADCONF_0: UART_Gnss_SendCmd(GNSSCMD_LOADCONF_0);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
152 rxState = GNSSRX_DETECT_ACK_0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
153 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
154 case UART_GNSS_LOADCONF_1: UART_Gnss_SendCmd(GNSSCMD_LOADCONF_1);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
155 rxState = GNSSRX_DETECT_ACK_0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
156 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
157 case UART_GNSS_LOADCONF_2: UART_Gnss_SendCmd(GNSSCMD_LOADCONF_2);
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
158 rxState = GNSSRX_DETECT_ACK_0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
159 break;
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
160 case UART_GNSS_PWRDOWN: UART_Gnss_SendCmd(GNSSCMD_MODE_PWS);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
161 rxState = GNSSRX_DETECT_ACK_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
162 break;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
163
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
164 case UART_GNSS_PWRUP:
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
165 case UART_GNSS_INACTIVE: UART_Gnss_SendCmd(GNSSCMD_MODE_NORMAL);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
166 rxState = GNSSRX_DETECT_ACK_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
167 gnssState = UART_GNSS_PWRUP;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
168 break;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
169 case UART_GNSS_SETCONF: UART_Gnss_SendCmd(GNSSCMD_SET_CONFIG);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
170 rxState = GNSSRX_DETECT_ACK_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
171 break;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
172
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
173 case UART_GNSS_IDLE: if(ReqPowerDown)
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
174 {
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
175 UART_Gnss_SendCmd(GNSSCMD_MODE_PWS);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
176 gnssState = UART_GNSS_PWRDOWN;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
177 rxState = GNSSRX_DETECT_ACK_0;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
178 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
179 else
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
180 {
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
181 if(dataToggle)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
182 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
183 UART_Gnss_SendCmd(GNSSCMD_GET_PVT_DATA);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
184 gnssState = UART_GNSS_GET_PVT;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
185 rxState = GNSSRX_DETECT_HEADER_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
186 dataToggle = 0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
187 }
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
188 else
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
189 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
190 UART_Gnss_SendCmd(GNSSCMD_GET_NAVSAT_DATA);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
191 gnssState = UART_GNSS_GET_SAT;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
192 rxState = GNSSRX_DETECT_HEADER_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
193 dataToggle = 1;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
194 }
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
195 }
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
196 break;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
197 default:
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
198 break;
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
199 }
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
200 if(pUartCtrl == &Uart1Ctrl)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
201 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
202 externalInterface_SetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET,gnssState);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
203 }
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
204
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
205 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
206
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
207
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
208 void uartGnss_ProcessData(uint8_t data)
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
209 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
210 static uint16_t rxLength = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
211 static uint8_t ck_A = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
212 static uint8_t ck_B = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
213 static uint8_t ck_A_Ref = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
214 static uint8_t ck_B_Ref = 0;
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
215 uint8_t activeSensor = 0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
216
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
217 sUartComCtrl* pUartCtrl = UART_GetGnssCtrl();
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
218
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
219 if(pUartCtrl == &Uart1Ctrl)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
220 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
221 activeSensor = externalInterface_GetActiveUartSensor();
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
222 gnssState = externalInterface_GetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
223 }
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
224
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
225 GNSS_Handle.uartWorkingBuffer[writeIndex++] = data;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
226 if((rxState >= GNSSRX_DETECT_HEADER_2) && (rxState < GNSSRX_READ_CK_A))
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
227 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
228 ck_A += data;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
229 ck_B += ck_A;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
230 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
231
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
232 switch(rxState)
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
233 {
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
234 case GNSSRX_DETECT_ACK_0:
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
235 case GNSSRX_DETECT_HEADER_0: if(data == 0xB5)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
236 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
237 writeIndex = 0;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
238 memset(GNSS_Handle.uartWorkingBuffer,0xff, sizeof(GNSS_Handle.uartWorkingBuffer));
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
239 GNSS_Handle.uartWorkingBuffer[writeIndex++] = data;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
240 rxState++;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
241 ck_A = 0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
242 ck_B = 0;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
243 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
244 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
245 case GNSSRX_DETECT_ACK_1:
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
246 case GNSSRX_DETECT_HEADER_1: if(data == 0x62)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
247 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
248 rxState++;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
249 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
250 else
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
251 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
252 rxState = GNSSRX_DETECT_HEADER_0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
253 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
254 break;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
255 case GNSSRX_DETECT_ACK_2: if(data == 0x05)
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
256 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
257 rxState++;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
258 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
259 else
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
260 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
261 rxState = GNSSRX_DETECT_HEADER_0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
262 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
263 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
264 case GNSSRX_DETECT_ACK_3: if((data == 0x01))
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
265 {
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
266 rxState = GNSSRX_READY;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
267 if(gnssState == UART_GNSS_PWRUP)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
268 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
269 gnssState = UART_GNSS_IDLE;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
270 }
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
271 else if(gnssState == UART_GNSS_PWRDOWN)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
272 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
273 rxState = GNSSRX_DETECT_ACK_0;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
274 UART_Gnss_SendCmd(GNSSCMD_SET_CONFIG);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
275 gnssState = UART_GNSS_SETCONF;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
276 }
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
277 else if(gnssState == UART_GNSS_SETCONF)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
278 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
279 gnssState = UART_GNSS_INACTIVE;
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
280 }
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
281 else if((gnssState >= UART_GNSS_LOADCONF_0) && (gnssState <= UART_GNSS_LOADCONF_2))
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
282 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
283 if(gnssState == UART_GNSS_LOADCONF_2)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
284 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
285 gnssState = UART_GNSS_IDLE;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
286 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
287 else
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
288 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
289 gnssState++;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
290 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
291 }
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
292 GnssConnected = 1;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
293 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
294 else
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
295 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
296 rxState = GNSSRX_DETECT_HEADER_0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
297 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
298 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
299 case GNSSRX_DETECT_HEADER_2: if(data == activeRequest.class)
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
300 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
301 rxState++;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
302 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
303 else
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
304 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
305 rxState = GNSSRX_DETECT_HEADER_0;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
306 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
307 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
308 case GNSSRX_DETECT_HEADER_3: if(data == activeRequest.id)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
309 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
310 rxState = GNSSRX_DETECT_LENGTH_0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
311 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
312 else
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
313 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
314 rxState = GNSSRX_DETECT_HEADER_0;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
315 }
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
316 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
317 case GNSSRX_DETECT_LENGTH_0: rxLength = GNSS_Handle.uartWorkingBuffer[4];
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
318 rxState = GNSSRX_DETECT_LENGTH_1;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
319 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
320 case GNSSRX_DETECT_LENGTH_1: rxLength += (GNSS_Handle.uartWorkingBuffer[5] << 8);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
321 rxState = GNSSRX_READ_DATA;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
322 dataToRead = rxLength;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
323 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
324 case GNSSRX_READ_DATA: if(dataToRead > 0)
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
325 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
326 dataToRead--;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
327 }
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
328 if(dataToRead == 0)
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
329 {
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
330 rxState = GNSSRX_READ_CK_A;
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
331 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
332 break;
932
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
333 case GNSSRX_READ_CK_A: ck_A_Ref = data;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
334 rxState++;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
335 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
336 case GNSSRX_READ_CK_B: ck_B_Ref = data;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
337 if((ck_A_Ref == ck_A) && (ck_B_Ref == ck_B))
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
338 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
339 switch(gnssState)
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
340 {
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
341 case UART_GNSS_GET_PVT:GNSS_ParsePVTData(&GNSS_Handle);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
342 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
343 case UART_GNSS_GET_SAT: GNSS_ParseNavSatData(&GNSS_Handle);
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
344 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
345 default:
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
346 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
347 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
348 }
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
349 rxState = GNSSRX_DETECT_HEADER_0;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
350 gnssState = UART_GNSS_IDLE;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
351 break;
effadaa3a1f7 Cleanup Gnss UART implementation:
Ideenmodellierer
parents: 922
diff changeset
352
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
353 default: rxState = GNSSRX_READY;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
354 break;
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
355 }
936
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
356 if(pUartCtrl == &Uart1Ctrl)
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
357 {
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
358 externalInterface_SetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET,gnssState);
3029f0332f4f GNSS introduced power saving mode:
Ideenmodellierer
parents: 932
diff changeset
359 }
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
360 }
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
361
919
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
362 uint8_t uartGnss_isSensorConnected()
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
363 {
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
364 return GnssConnected;
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
365 }
c0553dd70608 GNSS support for external UART interface:
Ideenmodellierer
parents: 899
diff changeset
366
899
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
367 #endif
2225c467f1e9 Added data path and visualization for position data:
Ideenmodellierer
parents:
diff changeset
368