-
Notifications
You must be signed in to change notification settings - Fork 35
/
struct_def.h
176 lines (151 loc) · 3.37 KB
/
struct_def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#ifndef __STRUCT_DEF_H
#define __STRUCT_DEF_H
#include <Arduino.h>
#include <time.h>
#include "board_def.h"
typedef enum {
DIRECTION_TOP_EDGE = 0,
DIRECTION_BOTTOM_EDGE = 1,
DIRECTION_LEFT_EDGE = 2,
DIRECTION_RIGHT_EDGE = 3,
DIRECTION_DISP_UP = 4,
DIRECTION_DISP_DOWN = 5
} direction_t;
typedef enum {
MESS_EVENT_GPS,
MESS_EVENT_FILE,
MESS_EVENT_VOLT,
MESS_EVENT_SPEK,
MESS_EVENT_WIFI,
MESS_EVENT_MOTI,
MESS_EVENT_TIME,
MESS_EVENT_POWER,
MESS_EVENT_LORA,
MESS_EVENT_BLE,
} message_type_t;
typedef enum {
LVGL_WIFI_CONFIG_SCAN = 0,
LVGL_WIFI_CONFIG_SCAN_DONE,
LVGL_WIFI_CONFIG_CONNECT_SUCCESS,
LVGL_WIFI_CONFIG_CONNECT_FAIL,
LVGL_WIFI_CONFIG_TRY_CONNECT,
} wifi_config_event_t;
typedef enum {
DIR_TYPE,
FILE_TYPE,
} file_type_t;
typedef enum {
LVGL_FILE_SCAN,
} file_event_t;
typedef enum {
LVGL_GPS_START,
LVGL_GPS_STOP,
LVGL_GPS_DATA_READY,
LVGL_GPS_WAIT_FOR_DATA,
} gps_event_t;
typedef enum {
LVGL_MOTION_STOP,
LVGL_MOTION_GET_ACCE,
LVGL_MOTION_GET_STEP,
} motion_event_t;
typedef enum {
LVGL_POWER_GET_MOINITOR,
LVGL_POWER_MOINITOR_STOP,
LVGL_POWER_IRQ,
LVGL_POWER_ENTER_SLEEP,
} power_event_t;
typedef enum {
LVGL_TIME_UPDATE,
LVGL_TIME_ALARM,
LVGL_TIME_SYNC,
} time_event_t;
typedef struct {
double lng;
double lat;
double speed;
double altitude;
struct gpsdate {
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t min;
uint8_t sec;
} date;
uint32_t time;
uint32_t course;
uint32_t satellites;
int gpsVaild;
gps_event_t event;
} gps_struct_t;
typedef struct {
file_event_t event;
} file_struct_t;
typedef struct {
char ssid[64];
char password[64];
} wifi_auth_t;
typedef struct {
wifi_config_event_t event;
void *ctx;
} wifi_struct_t;
typedef struct {
motion_event_t event;
direction_t dir;
uint32_t setp;
} motion_struct_t;
typedef struct {
float vbus_vol;
float vbus_cur;
float batt_vol;
float batt_cur;
float power;
} power_data_t;
typedef struct {
power_event_t event;
power_data_t data;
} power_struct_t;
typedef struct {
time_event_t event;
struct tm time;
} time_struct_t;
typedef enum {
LVGL_S7XG_GPS_START,
LVGL_S7XG_GPS_STOP,
LVGL_S7XG_GPS_DATA_READY,
LVGL_S7XG_GPS_WAIT_FOR_DATA,
LVGL_S7XG_LORA_SEND,
LVGL_S7XG_LORA_RECV,
LVGL_S7XG_LORAWLAN,
LVGL_S7XG_LORA_STOP,
} lora_event_t;
typedef struct {
lora_event_t event;
void *data;
} lora_struct_t;
typedef enum {
LV_BLE_SCAN,
LV_BLE_SCAN_DONE,
LV_BLE_CONNECT,
LV_BLE_CONNECT_SUCCESS,
LV_BLE_DISCONNECT
}ble_event_t;
typedef struct{
ble_event_t event;
uint8_t index;
}ble_struct_t;
typedef struct {
union {
gps_struct_t gps;
wifi_struct_t wifi;
motion_struct_t motion;
time_struct_t time;
file_struct_t file;
power_struct_t power;
lora_struct_t lora;
ble_struct_t ble;
};
void *arg;
message_type_t type;
} task_event_data_t;
#endif //*__STRUCT_DEF_H*/