Sentinel
Loading...
Searching...
No Matches
utilities.h
Go to the documentation of this file.
1
9
10#pragma once
11
12// Note:
13
14// When using ArduinoIDE, you must select a corresponding board type.
15// If you don’t know which board type you have, please click on the link to view it.
16// 使用ArduinoIDE ,必须选择一个对应的板型 ,如果你不知道你的板型是哪种,请点击链接进行查看
17
18// The model name with S3 after it is the ESP32-S3 version, otherwise it is the ESP32 version
19// 型号名称后面带S3的为ESP32-S3版本,否则是ESP32版本
20
21// Products Link:https://www.lilygo.cc/products/t-sim-a7670e
22// #define LILYGO_T_A7670
23
24// Products Link: https://lilygo.cc/products/t-call-v1-4
25// #define LILYGO_T_CALL_A7670_V1_0
26
27// Products Link: https://lilygo.cc/products/t-sim-7670g-s3
28// #define LILYGO_T_SIM7670G_S3
29
30// Products Link: https://lilygo.cc/products/t-a7608e-h?variant=42860532433077
31// #define LILYGO_T_A7608X
32
33// Products Link: https://lilygo.cc/products/t-a7608e-h?variant=43932699033781
34// #define LILYGO_T_A7608X_S3
35
36// Products Link: ......
37// #define LILYGO_A7670X_S3
38
39// Products Link: https://lilygo.cc/products/t-sim7000g
40// #define LILYGO_SIM7000G
41
42// Products Link: https://lilygo.cc/products/a-t-pcie?variant=42335922094261
43// #define LILYGO_T_PCIE_A767X
44
45// Products Link: https://lilygo.cc/products/a-t-pcie?variant=42335921897653
46// #define LILYGO_T_PCIE_SIM7000G
47
48// Products Link: https://lilygo.cc/products/a-t-pcie?variant=42335921995957
49// #define LILYGO_T_PCIE_SIM7080G
50
51// Products Link: https://lilygo.cc/products/t-eth-elite-1?variant=44498205049013
52// #define LILYGO_T_ETH_ELITE_A7670X
53
54#if defined(LILYGO_T_A7670)
55
56#define MODEM_BAUDRATE (115200)
57#define MODEM_DTR_PIN (25)
58#define MODEM_TX_PIN (26)
59#define MODEM_RX_PIN (27)
60// The modem boot pin needs to follow the startup sequence.
61#define BOARD_PWRKEY_PIN (4)
62#define BOARD_BAT_ADC_PIN (35)
63// The modem power switch must be set to HIGH for the modem to supply power.
64#define BOARD_POWERON_PIN (12)
65#define MODEM_RING_PIN (33)
66#define MODEM_RESET_PIN (5)
67#define BOARD_MISO_PIN (2)
68#define BOARD_MOSI_PIN (15)
69#define BOARD_SCK_PIN (14)
70#define BOARD_SD_CS_PIN (13)
71#define BOARD_BAT_ADC_PIN (35)
72#define MODEM_RESET_LEVEL HIGH
73#define SerialAT Serial1
74
75#define MODEM_GPS_ENABLE_GPIO (-1)
76#define MODEM_GPS_ENABLE_LEVEL (-1)
77
78#ifndef TINY_GSM_MODEM_A7670
79#define TINY_GSM_MODEM_A7670
80#endif
81
82// It is only available in V1.4 version. In other versions, IO36 is not connected.
83#define BOARD_SOLAR_ADC_PIN (36)
84
85#elif defined(LILYGO_T_CALL_A7670_V1_0)
86#define MODEM_BAUDRATE (115200)
87#define MODEM_DTR_PIN (14)
88#define MODEM_TX_PIN (26)
89#define MODEM_RX_PIN (25)
90// The modem boot pin needs to follow the startup sequence.
91#define BOARD_PWRKEY_PIN (4)
92#define BOARD_LED_PIN (12)
93// There is no modem power control, the LED Pin is used as a power indicator here.
94#define BOARD_POWERON_PIN (BOARD_LED_PIN)
95#define MODEM_RING_PIN (13)
96#define MODEM_RESET_PIN (27)
97#define MODEM_RESET_LEVEL LOW
98#define SerialAT Serial1
99
100#define MODEM_GPS_ENABLE_GPIO (-1)
101#define MODEM_GPS_ENABLE_LEVEL (-1)
102
103#ifndef TINY_GSM_MODEM_A7670
104#define TINY_GSM_MODEM_A7670
105#endif
106
107#elif defined(LILYGO_T_CALL_A7670_V1_1)
108
109#define MODEM_BAUDRATE (115200)
110#define MODEM_DTR_PIN (32)
111#define MODEM_TX_PIN (27)
112#define MODEM_RX_PIN (26)
113// The modem boot pin needs to follow the startup sequence.
114#define BOARD_PWRKEY_PIN (4)
115#define BOARD_LED_PIN (13)
116// There is no modem power control, the LED Pin is used as a power indicator here.
117#define BOARD_POWERON_PIN (BOARD_LED_PIN)
118#define MODEM_RING_PIN (33)
119#define MODEM_RESET_PIN (5)
120#define MODEM_RESET_LEVEL LOW
121#define SerialAT Serial1
122
123#define MODEM_GPS_ENABLE_GPIO (-1)
124#define MODEM_GPS_ENABLE_LEVEL (-1)
125
126#ifndef TINY_GSM_MODEM_A7670
127#define TINY_GSM_MODEM_A7670
128#endif
129
130
135#elif defined(LILYGO_T_SIM7670G_S3)
136#define MODEM_BAUDRATE (115200)
137#define MODEM_DTR_PIN (9)
138#define MODEM_TX_PIN (11)
139#define MODEM_RX_PIN (10)
140// The modem boot pin needs to follow the startup sequence.
141#define BOARD_PWRKEY_PIN (18)
142#define BOARD_LED_PIN (12)
143// There is no modem power control, the LED Pin is used as a power indicator here.
144#define BOARD_POWERON_PIN (BOARD_LED_PIN)
145#define MODEM_RING_PIN (3)
146#define MODEM_RESET_PIN (17)
147#define MODEM_RESET_LEVEL LOW
148#define SerialAT Serial1
149
150#define BOARD_BAT_ADC_PIN (4)
151#define BOARD_SOLAR_ADC_PIN (5)
152#define BOARD_MISO_PIN (47)
153#define BOARD_MOSI_PIN (14)
154#define BOARD_SCK_PIN (21)
155#define BOARD_SD_CS_PIN (13)
156
157#ifndef TINY_GSM_MODEM_SIM7672
158#define TINY_GSM_MODEM_SIM7672
159#endif
160
161#define MODEM_GPS_ENABLE_GPIO (4)
162#define MODEM_GPS_ENABLE_LEVEL (1)
163
164#elif defined(LILYGO_T_A7608X)
165
166#define MODEM_BAUDRATE (115200)
167#define MODEM_DTR_PIN (25)
168#define MODEM_TX_PIN (26)
169#define MODEM_RX_PIN (27)
170// The modem boot pin needs to follow the startup sequence.
171#define BOARD_PWRKEY_PIN (4)
172#define BOARD_BAT_ADC_PIN (35)
173// The modem power switch must be set to HIGH for the modem to supply power.
174#define BOARD_POWERON_PIN (12) // T-A7608-V2 is onboard led
175#define MODEM_RING_PIN (33)
176#define MODEM_RESET_PIN (5) // T-A7608-V2 no connection
177#define BOARD_MISO_PIN (2)
178#define BOARD_MOSI_PIN (15)
179#define BOARD_SCK_PIN (14)
180#define BOARD_SD_CS_PIN (13)
181
182#define MODEM_RESET_LEVEL HIGH
183#define SerialAT Serial1
184
185#ifndef TINY_GSM_MODEM_A7608
186#define TINY_GSM_MODEM_A7608
187#endif
188
189// only version v1.1 or V2 has solar adc pin
190#define BOARD_SOLAR_ADC_PIN (34)
191
192// 127 is defined in GSM as the AUXVDD index
193#define MODEM_GPS_ENABLE_GPIO (127)
194#define MODEM_GPS_ENABLE_LEVEL (1)
195
196#elif defined(LILYGO_T_A7608X_S3)
197
198#define MODEM_BAUDRATE (115200)
199#define MODEM_DTR_PIN (7)
200#define MODEM_TX_PIN (17)
201#define MODEM_RX_PIN (18)
202// The modem boot pin needs to follow the startup sequence.
203#define BOARD_PWRKEY_PIN (15)
204#define BOARD_BAT_ADC_PIN (4)
205// The modem power switch must be set to HIGH for the modem to supply power.
206// #define BOARD_POWERON_PIN (12)
207#define MODEM_RING_PIN (6)
208#define MODEM_RESET_PIN (16)
209#define BOARD_MISO_PIN (47)
210#define BOARD_MOSI_PIN (14)
211#define BOARD_SCK_PIN (21)
212#define BOARD_SD_CS_PIN (13)
213
214#define MODEM_RESET_LEVEL LOW
215#define SerialAT Serial1
216
217#ifndef TINY_GSM_MODEM_A7608
218#define TINY_GSM_MODEM_A7608
219#endif
220
221// only version v1.1 has solar adc pin
222#define BOARD_SOLAR_ADC_PIN (3)
223
224// 127 is defined in GSM as the AUXVDD index
225#define MODEM_GPS_ENABLE_GPIO (127)
226#define MODEM_GPS_ENABLE_LEVEL (1)
227
228#elif defined(LILYGO_T_A7608X_DC_S3)
229
230#define MODEM_DTR_PIN (5)
231#define MODEM_RX_PIN (42)
232#define MODEM_TX_PIN (41)
233// The modem boot pin needs to follow the startup sequence.
234#define BOARD_PWRKEY_PIN (38)
235#define MODEM_RING_PIN (6)
236#define MODEM_RESET_PIN (40)
237#define MODEM_RTS_PIN (1)
238#define MODEM_CTS_PIN (2)
239
240#define MODEM_RESET_LEVEL LOW
241#define SerialAT Serial1
242
243#ifndef TINY_GSM_MODEM_A7608
244#define TINY_GSM_MODEM_A7608
245#endif
246
247// 127 is defined in GSM as the AUXVDD index
248#define MODEM_GPS_ENABLE_GPIO (127)
249#define MODEM_GPS_ENABLE_LEVEL (1)
250
251#elif defined(LILYGO_SIM7000G)
252
253#define MODEM_DTR_PIN (25)
254#define MODEM_RX_PIN (26)
255#define MODEM_TX_PIN (27)
256
257// The modem boot pin needs to follow the startup sequence.
258#define BOARD_PWRKEY_PIN (4)
259#define MODEM_RING_PIN (33)
260#define BOARD_LED_PIN (12)
261#define LED_ON (LOW)
262
263#define SerialAT Serial1
264
265#ifndef TINY_GSM_MODEM_SIM7000SSL
266#define TINY_GSM_MODEM_SIM7000SSL
267#endif
268
269// 127 is defined in GSM as the AUXVDD index
270#define MODEM_GPS_ENABLE_GPIO (4)
271#define MODEM_GPS_ENABLE_LEVEL (0)
272
273#elif defined(LILYGO_A7670X_S3)
274
275#define BOARD_SDA_PIN (3)
276#define BOARD_SCL_PIN (2)
277
278#define MODEM_BAUDRATE (115200)
279#define MODEM_DTR_PIN (7)
280#define MODEM_TX_PIN (4)
281#define MODEM_RX_PIN (5)
282#define MODEM_RING_PIN (6)
283
284#define MODEM_GPS_RX_PIN (15)
285#define MODEM_GPS_TX_PIN (16)
286#define MODEM_GPS_PPS_PIN (17)
287
288// The modem boot pin needs to follow the startup sequence.
289#define BOARD_PWRKEY_PIN (46)
290
291#define BOARD_BAT_ADC_PIN (8)
292#define BOARD_SOLAR_ADC_PIN (18)
293
294#define BOARD_MISO_PIN (13)
295#define BOARD_MOSI_PIN (11)
296#define BOARD_SCK_PIN (12)
297#define BOARD_SD_CS_PIN (10)
298
299#define CAMERA_PWDN_PIN (-1)
300#define CAMERA_RESET_PIN (-1)
301#define CAMERA_XCLK_PIN (36)
302#define CAMERA_SIOD_PIN (40)
303#define CAMERA_SIOC_PIN (1)
304#define CAMERA_VSYNC_PIN (42)
305#define CAMERA_HREF_PIN (9)
306#define CAMERA_PCLK_PIN (41)
307#define CAMERA_Y9_PIN (45)
308#define CAMERA_Y8_PIN (39)
309#define CAMERA_Y7_PIN (38)
310#define CAMERA_Y6_PIN (7)
311#define CAMERA_Y5_PIN (35)
312#define CAMERA_Y4_PIN (48)
313#define CAMERA_Y3_PIN (47)
314#define CAMERA_Y2_PIN (14)
315
316#define BOARD_LED_PIN (37)
317#define LED_ON (HIGH)
318
319#define SerialAT Serial1
320
321#define MODEM_GPS_ENABLE_GPIO (1)
322#define MODEM_GPS_ENABLE_LEVEL (1)
323
324#ifndef TINY_GSM_MODEM_A7670
325#define TINY_GSM_MODEM_A7670
326#endif
327
328#elif defined(LILYGO_T_PCIE_A767X)
329
330#define MODEM_DTR_PIN (32)
331#define MODEM_RX_PIN (26)
332#define MODEM_TX_PIN (27)
333// The modem power switch must be set to HIGH for the modem to supply power.
334#define BOARD_POWERON_PIN (25)
335// The modem boot pin needs to follow the startup sequence.
336#define BOARD_PWRKEY_PIN (4)
337#define MODEM_RING_PIN (33)
338#define BOARD_LED_PIN (12)
339#define PMU_IRQ (35)
340
341// No connect to reset pin to modem ,set dummy reset pin
342#define MODEM_RESET_PIN (BOARD_LED_PIN)
343#define MODEM_RESET_LEVEL (0)
344
345#define SerialAT Serial1
346
347#ifndef TINY_GSM_MODEM_A7670
348#define TINY_GSM_MODEM_A7670
349#endif
350
351// 127 is defined in GSM as the AUXVDD index
352#define MODEM_GPS_ENABLE_GPIO (4)
353#define MODEM_GPS_ENABLE_LEVEL (0)
354
355#elif defined(LILYGO_T_PCIE_SIM7000G)
356
357#define LILYGO_T_PCIE
358
359#ifndef TINY_GSM_MODEM_SIM7000SSL
360#define TINY_GSM_MODEM_SIM7000SSL
361#endif
362
363#elif defined(LILYGO_T_PCIE_SIM7080G)
364
365#define LILYGO_T_PCIE
366
367#ifndef TINY_GSM_MODEM_SIM7080
368#define TINY_GSM_MODEM_SIM7080
369#endif
370
371#elif defined(LILYGO_T_ETH_ELITE_A7670X)
372
373#define LILYGO_T_ETH_ELITE
374
375#ifndef TINY_GSM_MODEM_A7670
376#define TINY_GSM_MODEM_A7670
377#endif
378
379#else
380#error \
381 "Use ArduinoIDE, please open the macro definition corresponding to the board above <utilities.h>"
382#endif
383
384#ifdef LILYGO_T_PCIE
385
386#define MODEM_DTR_PIN (32)
387#define MODEM_RX_PIN (26)
388#define MODEM_TX_PIN (27)
389// The modem power switch must be set to HIGH for the modem to supply power.
390#define BOARD_POWERON_PIN (25)
391// The modem boot pin needs to follow the startup sequence.
392#define BOARD_PWRKEY_PIN (4)
393#define MODEM_RING_PIN (33)
394#define BOARD_LED_PIN (12)
395#define PMU_IRQ (35)
396
397#define LED_ON (LOW)
398
399#define SerialAT Serial1
400#endif
401
402#ifdef LILYGO_T_ETH_ELITE
403
404#define ETH_MISO_PIN (47)
405#define ETH_MOSI_PIN (21)
406#define ETH_SCLK_PIN (48)
407#define ETH_CS_PIN (45)
408#define ETH_INT_PIN (14)
409#define ETH_RST_PIN (-1)
410#define ETH_ADDR (1)
411
412#define SPI_MISO_PIN (9)
413#define SPI_MOSI_PIN (11)
414#define SPI_SCLK_PIN (10)
415
416#define SD_MISO_PIN (SPI_MISO_PIN)
417#define SD_MOSI_PIN (SPI_MOSI_PIN)
418#define SD_SCLK_PIN (SPI_SCLK_PIN)
419#define SD_CS_PIN (12)
420
421#define BOARD_SDA_PIN (17)
422#define BOARD_SCL_PIN (18)
423
424#define ADC_BUTTONS_PIN (7)
425#define MODEM_RX_PIN (4)
426#define MODEM_TX_PIN (6)
427#define MODEM_DTR_PIN (5)
428#define MODEM_RING_PIN (1)
429#define BOARD_PWRKEY_PIN (3)
430
431#define GPS_RX_PIN (39)
432#define GPS_TX_PIN (42)
433
434#define BOARD_LED_PIN (38)
435#define LED_ON (HIGH)
436
437#endif
438
439// T-Call-A767X V1.0 and V1.1 have different Pinmaps and cannot be used universally , Invalid
440// version #define LILYGO_T_CALL_A7670_V1_1 #define LILYGO_T_A7608X_DC_S3