842
|
1 /**
|
|
2 ******************************************************************************
|
|
3 * @file uartProtocol_Sentinel.h
|
|
4 * @author heinrichs weikamp gmbh
|
|
5 * @version V0.0.1
|
|
6 * @date 15-Jan-2024
|
|
7 * @brief Interface functionality read data from Sentinel rebreather
|
|
8 *
|
|
9 @verbatim
|
|
10 ==============================================================================
|
|
11 ##### How to use #####
|
|
12 ==============================================================================
|
|
13 @endverbatim
|
|
14 ******************************************************************************
|
|
15 * @attention
|
|
16 *
|
|
17 * <h2><center>© COPYRIGHT(c) 2014 heinrichs weikamp</center></h2>
|
|
18 *
|
|
19 ******************************************************************************
|
|
20 */
|
|
21
|
|
22 /* Define to prevent recursive inclusion -------------------------------------*/
|
|
23 #ifndef UART_PROTOCOL_SENTINEL_H
|
|
24 #define UART_PROTOCOL_SENTINEL_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_SENTINEL_INIT = 0, /* Default Status for every sensor type */
|
|
37 UART_SENTINEL_IDLE, /* sensor detected and no communication pending */
|
|
38 UART_SENTINEL_ERROR,
|
|
39 UART_SENTINEL_OPERATING, /* normal operation */
|
|
40 } uartSentinelStatus_t;
|
|
41
|
|
42 typedef enum
|
|
43 {
|
|
44 SENTRX_Ready= 0, /* Initial state */
|
|
45 SENTRX_DetectStart, /* validate start byte */
|
|
46 SENTRX_SelectData, /* Data contained in this frame */
|
|
47 SENTRX_Data0, /* Process incoming data */
|
|
48 SENTRX_Data1,
|
|
49 SENTRX_Data2,
|
|
50 SENTRX_Data3,
|
|
51 SENTRX_Data4,
|
|
52 SENTRX_Data5,
|
|
53 SENTRX_Data6,
|
|
54 SENTRX_Data7,
|
|
55 SENTRX_Data8,
|
|
56 SENTRX_Data9,
|
|
57 SENTRX_Data10,
|
|
58 SENTRX_Data11,
|
|
59 SENTRX_Data12,
|
|
60 SENTRX_DataComplete
|
|
61 } receiveStateSentinel_t;
|
|
62
|
|
63
|
|
64 void uartSentinel_Control(void);
|
|
65 void uartSentinel_ProcessData(uint8_t data);
|
|
66 uint8_t uartSentinel_isSensorConnected();
|
|
67
|
|
68 #endif /* UART_PROTOCOL_SENTINEL_H */
|