view Small_CPU/Inc/uartProtocol_GNSS.h @ 970:3123aa8723fd
Evo_2_23
Old / new BT module communication:
The old / new BT module do have a sligthly different command set. To keep them compatible a function has been added which returns, based on the HW identification, the command string which matches to the module. In case a command is not supported the value 0 is returned and the calling function may react. E.g. with skipping of configuration steps like it is done now for the new module.
author
Ideenmodellierer
date
Sun, 19 Jan 2025 20:55:30 +0100 (2 months ago)
parents
f41974734268
children
line source
/**+ −
******************************************************************************+ −
* @file uartProtocol_GNSS.h+ −
* @author heinrichs weikamp gmbh+ −
* @version V0.0.1+ −
* @date 30-Sep-2024+ −
* @brief Interface functionality for operation of gnss devices+ −
*+ −
@verbatim+ −
==============================================================================+ −
##### How to use #####+ −
==============================================================================+ −
@endverbatim+ −
******************************************************************************+ −
* @attention+ −
*+ −
* <h2><center>© COPYRIGHT(c) 2014 heinrichs weikamp</center></h2>+ −
*+ −
******************************************************************************+ −
*/+ −
+ −
/* Define to prevent recursive inclusion -------------------------------------*/+ −
#ifndef UART_PROTOCOL_GNSS_H+ −
#define UART_PROTOCOL_GNSS_H+ −
+ −
#ifdef __cplusplus+ −
extern "C" {+ −
#endif+ −
+ −
/* Includes ------------------------------------------------------------------*/+ −
#include "configuration.h"+ −
#include "stm32f4xx_hal.h"+ −
+ −
typedef enum+ −
{+ −
UART_GNSS_INIT = 0, /* Default Status for every sensor type */+ −
UART_GNSS_IDLE, /* sensor detected and no communication pending */+ −
UART_GNSS_ERROR, /* Error message received from sensor */+ −
UART_GNSS_WARMUP = 10,+ −
UART_GNSS_INACTIVE, /* no requests to the receiver */+ −
UART_GNSS_LOADCONF_0,+ −
UART_GNSS_LOADCONF_1,+ −
UART_GNSS_LOADCONF_2,+ −
UART_GNSS_SETMODE_MOBILE,+ −
UART_GNSS_PWRDOWN,+ −
UART_GNSS_PWRUP,+ −
UART_GNSS_SETCONF, /* save configuration */+ −
UART_GNSS_GET_PVT,+ −
UART_GNSS_GET_SAT+ −
} uartGnssStatus_t;+ −
+ −
typedef enum+ −
{+ −
GNSSRX_READY = 0, /* Initial state */+ −
GNSSRX_DETECT_HEADER_0,+ −
GNSSRX_DETECT_HEADER_1,+ −
GNSSRX_DETECT_HEADER_2,+ −
GNSSRX_DETECT_HEADER_3,+ −
GNSSRX_DETECT_LENGTH_0,+ −
GNSSRX_DETECT_LENGTH_1,+ −
GNSSRX_DETECT_ACK_0,+ −
GNSSRX_DETECT_ACK_1,+ −
GNSSRX_DETECT_ACK_2,+ −
GNSSRX_DETECT_ACK_3,+ −
GNSSRX_READ_DATA,+ −
GNSSRX_READ_CK_A,+ −
GNSSRX_READ_CK_B,+ −
} receiveStateGnss_t;+ −
+ −
+ −
typedef enum+ −
{+ −
GNSSCMD_LOADCONF_0 = 0,+ −
GNSSCMD_LOADCONF_1,+ −
GNSSCMD_LOADCONF_2,+ −
GNSSCMD_SETMOBILE,+ −
GNSSCMD_MODE_PWS,+ −
GNSSCMD_MODE_NORMAL,+ −
GNSSCMD_SET_CONFIG,+ −
GNSSCMD_GET_NAV_DATA,+ −
GNSSCMD_GET_PVT_DATA,+ −
GNSSCMD_GET_POSLLH_DATA,+ −
GNSSCMD_GET_NAVSAT_DATA+ −
} gnssSensorCmd_t;+ −
+ −
typedef struct+ −
{+ −
uint8_t class;+ −
uint8_t id;+ −
} gnssRequest_s;+ −
+ −
void uartGnss_ReqPowerDown(uint8_t request);+ −
uint8_t uartGnss_isPowerDownRequested(void);+ −
uartGnssStatus_t uartGnss_GetState(void);+ −
void uartGnss_SetState(uartGnssStatus_t newState);+ −
void uartGnss_Control(void);+ −
void uartGnss_ProcessData(uint8_t data);+ −
uint8_t uartGnss_isSensorConnected();+ −
void uartGnss_SendCmd(uint8_t GnssCmd);+ −
+ −
#endif /* UART_PROTOCOL_GNSS_H */+ −