comparison Small_CPU/Inc/uartProtocol_GNSS.h @ 981:c6c781a2e85b default

Merge into default
author heinrichsweikamp
date Tue, 11 Feb 2025 18:12:00 +0100
parents f41974734268
children c386ae6635e4
comparison
equal deleted inserted replaced
871:f7318457df4d 981:c6c781a2e85b
1 /**
2 ******************************************************************************
3 * @file uartProtocol_GNSS.h
4 * @author heinrichs weikamp gmbh
5 * @version V0.0.1
6 * @date 30-Sep-2024
7 * @brief Interface functionality for operation of gnss devices
8 *
9 @verbatim
10 ==============================================================================
11 ##### How to use #####
12 ==============================================================================
13 @endverbatim
14 ******************************************************************************
15 * @attention
16 *
17 * <h2><center>&copy; COPYRIGHT(c) 2014 heinrichs weikamp</center></h2>
18 *
19 ******************************************************************************
20 */
21
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef UART_PROTOCOL_GNSS_H
24 #define UART_PROTOCOL_GNSS_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /* Includes ------------------------------------------------------------------*/
31 #include "configuration.h"
32 #include "stm32f4xx_hal.h"
33
34 typedef enum
35 {
36 UART_GNSS_INIT = 0, /* Default Status for every sensor type */
37 UART_GNSS_IDLE, /* sensor detected and no communication pending */
38 UART_GNSS_ERROR, /* Error message received from sensor */
39 UART_GNSS_WARMUP = 10,
40 UART_GNSS_INACTIVE, /* no requests to the receiver */
41 UART_GNSS_LOADCONF_0,
42 UART_GNSS_LOADCONF_1,
43 UART_GNSS_LOADCONF_2,
44 UART_GNSS_SETMODE_MOBILE,
45 UART_GNSS_PWRDOWN,
46 UART_GNSS_PWRUP,
47 UART_GNSS_SETCONF, /* save configuration */
48 UART_GNSS_GET_PVT,
49 UART_GNSS_GET_SAT
50 } uartGnssStatus_t;
51
52 typedef enum
53 {
54 GNSSRX_READY = 0, /* Initial state */
55 GNSSRX_DETECT_HEADER_0,
56 GNSSRX_DETECT_HEADER_1,
57 GNSSRX_DETECT_HEADER_2,
58 GNSSRX_DETECT_HEADER_3,
59 GNSSRX_DETECT_LENGTH_0,
60 GNSSRX_DETECT_LENGTH_1,
61 GNSSRX_DETECT_ACK_0,
62 GNSSRX_DETECT_ACK_1,
63 GNSSRX_DETECT_ACK_2,
64 GNSSRX_DETECT_ACK_3,
65 GNSSRX_READ_DATA,
66 GNSSRX_READ_CK_A,
67 GNSSRX_READ_CK_B,
68 } receiveStateGnss_t;
69
70
71 typedef enum
72 {
73 GNSSCMD_LOADCONF_0 = 0,
74 GNSSCMD_LOADCONF_1,
75 GNSSCMD_LOADCONF_2,
76 GNSSCMD_SETMOBILE,
77 GNSSCMD_MODE_PWS,
78 GNSSCMD_MODE_NORMAL,
79 GNSSCMD_SET_CONFIG,
80 GNSSCMD_GET_NAV_DATA,
81 GNSSCMD_GET_PVT_DATA,
82 GNSSCMD_GET_POSLLH_DATA,
83 GNSSCMD_GET_NAVSAT_DATA
84 } gnssSensorCmd_t;
85
86 typedef struct
87 {
88 uint8_t class;
89 uint8_t id;
90 } gnssRequest_s;
91
92 void uartGnss_ReqPowerDown(uint8_t request);
93 uint8_t uartGnss_isPowerDownRequested(void);
94 uartGnssStatus_t uartGnss_GetState(void);
95 void uartGnss_SetState(uartGnssStatus_t newState);
96 void uartGnss_Control(void);
97 void uartGnss_ProcessData(uint8_t data);
98 uint8_t uartGnss_isSensorConnected();
99 void uartGnss_SendCmd(uint8_t GnssCmd);
100
101 #endif /* UART_PROTOCOL_GNSS_H */