-
Notifications
You must be signed in to change notification settings - Fork 61
/
utilities.h
273 lines (213 loc) · 9.88 KB
/
utilities.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
/**
* @file utilities.h
* @author Lewis He ([email protected])
* @license MIT
* @copyright Copyright (c) 2023 Shenzhen Xin Yuan Electronic Technology Co., Ltd
* @date 2023-11-15
*
*/
#pragma once
// Note:
// When using ArduinoIDE, you must select a corresponding board type.
// If you don’t know which board type you have, please click on the link to view it.
// 使用ArduinoIDE ,必须选择一个对应的板型 ,如果你不知道你的板型是哪种,请点击链接进行查看
// Products Link:https://www.lilygo.cc/products/t-sim-a7670e
// #define LILYGO_T_A7670
// Products Link: https://lilygo.cc/products/t-call-v1-4
// T-Call-A767X V1.0 and V1.1 have different Pinmaps and cannot be used universally.
// #define LILYGO_T_CALL_A7670_V1_0
//! SIM7672G and SIM7670G are exactly the same, except for the name change
// Products Link: https://lilygo.cc/products/t-sim-7670g-s3
// #define LILYGO_T_SIM767XG_S3
// Products Link: https://lilygo.cc/products/t-a7608e-h?variant=42860532433077
// #define LILYGO_T_A7608X
// Products Link: https://lilygo.cc/products/t-a7608e-h?variant=43932699033781
// #define LILYGO_T_A7608X_S3
// Products Link: https://lilygo.cc/products/a-t-pcie?variant=42335922094261
// #define LILYGO_T_PCIE_A767X
#if defined(LILYGO_T_A7670)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (25)
#define MODEM_TX_PIN (26)
#define MODEM_RX_PIN (27)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (4)
#define BOARD_ADC_PIN (35)
// The modem power switch must be set to HIGH for the modem to supply power.
#define BOARD_POWERON_PIN (12)
#define MODEM_RING_PIN (33)
#define MODEM_RESET_PIN (5)
#define BOARD_MISO_PIN (2)
#define BOARD_MOSI_PIN (15)
#define BOARD_SCK_PIN (14)
#define BOARD_SD_CS_PIN (13)
#define BOARD_BAT_ADC_PIN (35)
#define MODEM_RESET_LEVEL HIGH
#define SerialAT Serial1
#define MODEM_GPS_ENABLE_GPIO (-1)
#define MODEM_GPS_ENABLE_LEVEL (-1)
#ifndef TINY_GSM_MODEM_A7670
#define TINY_GSM_MODEM_A7670
#endif
// It is only available in V1.4 version. In other versions, IO36 is not connected.
#define BOARD_SOLAR_ADC_PIN (36)
#elif defined(LILYGO_T_CALL_A7670_V1_0)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (14)
#define MODEM_TX_PIN (26)
#define MODEM_RX_PIN (25)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (4)
#define BOARD_LED_PIN (12)
// There is no modem power control, the LED Pin is used as a power indicator here.
#define BOARD_POWERON_PIN (BOARD_LED_PIN)
#define MODEM_RING_PIN (13)
#define MODEM_RESET_PIN (27)
#define MODEM_RESET_LEVEL LOW
#define SerialAT Serial1
#define MODEM_GPS_ENABLE_GPIO (-1)
#define MODEM_GPS_ENABLE_LEVEL (-1)
#ifndef TINY_GSM_MODEM_A7670
#define TINY_GSM_MODEM_A7670
#endif
#elif defined(LILYGO_T_CALL_A7670_V1_1)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (32)
#define MODEM_TX_PIN (27)
#define MODEM_RX_PIN (26)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (4)
#define BOARD_LED_PIN (13)
// There is no modem power control, the LED Pin is used as a power indicator here.
#define BOARD_POWERON_PIN (BOARD_LED_PIN)
#define MODEM_RING_PIN (33)
#define MODEM_RESET_PIN (5)
#define MODEM_RESET_LEVEL LOW
#define SerialAT Serial1
#define MODEM_GPS_ENABLE_GPIO (-1)
#define MODEM_GPS_ENABLE_LEVEL (-1)
#ifndef TINY_GSM_MODEM_A7670
#define TINY_GSM_MODEM_A7670
#endif
#elif defined(LILYGO_T_SIM767XG_S3)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (9)
#define MODEM_TX_PIN (11)
#define MODEM_RX_PIN (10)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (18)
#define BOARD_LED_PIN (12)
// There is no modem power control, the LED Pin is used as a power indicator here.
#define BOARD_POWERON_PIN (BOARD_LED_PIN)
#define MODEM_RING_PIN (3)
#define MODEM_RESET_PIN (17)
#define MODEM_RESET_LEVEL LOW
#define SerialAT Serial1
#define BOARD_BAT_ADC_PIN (4)
#define BOARD_SOLAR_ADC_PIN (5)
#define BOARD_MISO_PIN (47)
#define BOARD_MOSI_PIN (14)
#define BOARD_SCK_PIN (21)
#define BOARD_SD_CS_PIN (13)
#ifndef TINY_GSM_MODEM_SIM7672
#define TINY_GSM_MODEM_SIM7672
#endif
#define MODEM_GPS_ENABLE_GPIO (4)
#define MODEM_GPS_ENABLE_LEVEL (1)
#elif defined(LILYGO_T_A7608X)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (25)
#define MODEM_TX_PIN (26)
#define MODEM_RX_PIN (27)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (4)
#define BOARD_BAT_ADC_PIN (35)
// The modem power switch must be set to HIGH for the modem to supply power.
#define BOARD_POWERON_PIN (12) //T-A7608-V2 is onboard led
#define MODEM_RING_PIN (33)
#define MODEM_RESET_PIN (5) //T-A7608-V2 no connection
#define BOARD_MISO_PIN (2)
#define BOARD_MOSI_PIN (15)
#define BOARD_SCK_PIN (14)
#define BOARD_SD_CS_PIN (13)
#define MODEM_RESET_LEVEL HIGH
#define SerialAT Serial1
#ifndef TINY_GSM_MODEM_A7608
#define TINY_GSM_MODEM_A7608
#endif
// only version v1.1 or V2 has solar adc pin
#define BOARD_SOLAR_ADC_PIN (34)
// 127 is defined in GSM as the AUXVDD index
#define MODEM_GPS_ENABLE_GPIO (127)
#define MODEM_GPS_ENABLE_LEVEL (1)
#elif defined(LILYGO_T_A7608X_S3)
#define MODEM_BAUDRATE (115200)
#define MODEM_DTR_PIN (7)
#define MODEM_TX_PIN (17)
#define MODEM_RX_PIN (18)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (15)
#define BOARD_BAT_ADC_PIN (4)
// The modem power switch must be set to HIGH for the modem to supply power.
// #define BOARD_POWERON_PIN (12)
#define MODEM_RING_PIN (6)
#define MODEM_RESET_PIN (16)
#define BOARD_MISO_PIN (47)
#define BOARD_MOSI_PIN (14)
#define BOARD_SCK_PIN (21)
#define BOARD_SD_CS_PIN (13)
#define MODEM_RESET_LEVEL LOW
#define SerialAT Serial1
#ifndef TINY_GSM_MODEM_A7608
#define TINY_GSM_MODEM_A7608
#endif
// only version v1.1 has solar adc pin
#define BOARD_SOLAR_ADC_PIN (3)
// 127 is defined in GSM as the AUXVDD index
#define MODEM_GPS_ENABLE_GPIO (127)
#define MODEM_GPS_ENABLE_LEVEL (1)
#elif defined(LILYGO_T_A7608X_DC_S3)
#define MODEM_DTR_PIN (5)
#define MODEM_RX_PIN (42)
#define MODEM_TX_PIN (41)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (38)
#define MODEM_RING_PIN (6)
#define MODEM_RESET_PIN (40)
#define MODEM_RTS_PIN (1)
#define MODEM_CTS_PIN (2)
#define MODEM_RESET_LEVEL LOW
#define SerialAT Serial1
#ifndef TINY_GSM_MODEM_A7608
#define TINY_GSM_MODEM_A7608
#endif
// 127 is defined in GSM as the AUXVDD index
#define MODEM_GPS_ENABLE_GPIO (127)
#define MODEM_GPS_ENABLE_LEVEL (1)
#elif defined(LILYGO_T_PCIE_A767X)
#define MODEM_DTR_PIN (32)
#define MODEM_RX_PIN (26)
#define MODEM_TX_PIN (27)
// The modem power switch must be set to HIGH for the modem to supply power.
#define BOARD_POWERON_PIN (25)
// The modem boot pin needs to follow the startup sequence.
#define BOARD_PWRKEY_PIN (4)
#define MODEM_RING_PIN (33)
#define BOARD_LED_PIN (12)
#define PMU_IRQ (35)
// No connect to reset pin to modem ,set dummy reset pin
#define MODEM_RESET_PIN (BOARD_LED_PIN)
#define MODEM_RESET_LEVEL (0)
#define SerialAT Serial1
#ifndef TINY_GSM_MODEM_A7670
#define TINY_GSM_MODEM_A7670
#endif
// 127 is defined in GSM as the AUXVDD index
#define MODEM_GPS_ENABLE_GPIO (4)
#define MODEM_GPS_ENABLE_LEVEL (0)
#else
#error "Use ArduinoIDE, please open the macro definition corresponding to the board above <utilities.h>"
#endif
// T-Call-A767X V1.0 and V1.1 have different Pinmaps and cannot be used universally , Invalid version
// #define LILYGO_T_CALL_A7670_V1_1
// #define LILYGO_T_A7608X_DC_S3