forked from Xinyuan-LilyGO/LilyGo-LoRa-Series
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilities.h
196 lines (148 loc) · 5.57 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
#pragma once
/*
* arduinoLoRa Library just only support SX1276/Sx1278,Not support SX1262
* */
// #define LILYGO_TBeam_V0_7
// #define LILYGO_TBeam_V1_0
// #define LILYGO_TBeam_V1_1
// #define LILYGO_T3_V1_0
// #define LILYGO_T3_V1_3
// #define LILYGO_T3_V1_6
// #define LILYGO_T3_V2_0
// #define LILYGO_T95_V1_0
/*
* if you need to change it,
* please open this note and change to the frequency you need to test
* Option: 433E6,470E6,868E6,915E6
* */
#define LoRa_frequency 433E6
#define UNUSE_PIN (0)
#if defined(LILYGO_TBeam_V0_7)
#define GPS_RX_PIN 12
#define GPS_TX_PIN 15
#define BUTTON_PIN 39
#define BUTTON_PIN_MASK GPIO_SEL_39
#define I2C_SDA 21
#define I2C_SCL 22
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 23
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 32
#define BOARD_LED 14
#define LED_ON HIGH
#define LED_OFF LOW
#define GPS_BAUD_RATE 9600
#define HAS_GPS
#define HAS_DISPLAY //Optional, bring your own board, no OLED !!
#elif defined(LILYGO_TBeam_V1_0) || defined(LILYGO_TBeam_V1_1)
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
#define BUTTON_PIN 38
#define BUTTON_PIN_MASK GPIO_SEL_38
#define I2C_SDA 21
#define I2C_SCL 22
#define PMU_IRQ 35
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 23
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 32
#define BOARD_LED 4
#define LED_ON LOW
#define LED_OFF HIGH
#define GPS_BAUD_RATE 9600
#define HAS_GPS
#define HAS_DISPLAY //Optional, bring your own board, no OLED !!
#elif defined(LILYGO_T3_V1_0)
#define I2C_SDA 4
#define I2C_SCL 15
#define OLED_RST 16
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 14
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 32
#define HAS_DISPLAY
#elif defined(LILYGO_T3_V1_3)
#define I2C_SDA 21
#define I2C_SCL 22
#define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 14
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 32
#define ADC_PIN 35
#define HAS_DISPLAY
#elif defined(LILYGO_T3_V1_6)
#define I2C_SDA 21
#define I2C_SCL 22
#define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 23
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 32
#define SDCARD_MOSI 15
#define SDCARD_MISO 2
#define SDCARD_SCLK 14
#define SDCARD_CS 13
#define BOARD_LED 25
#define LED_ON HIGH
#define ADC_PIN 35
#define HAS_SDCARD
#define HAS_DISPLAY
#elif defined(LILYGO_T3_V2_0)
#define I2C_SDA 21
#define I2C_SCL 22
#define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 14
#define RADIO_DIO1_PIN UNUSE_PIN
#define RADIO_BUSY_PIN UNUSE_PIN
#define SDCARD_MOSI 15
#define SDCARD_MISO 2
#define SDCARD_SCLK 14
#define SDCARD_CS 13
#define BOARD_LED 0
#define LED_ON LOW
#define HAS_DISPLAY
#define HAS_SDCARD
#elif defined(LILYGO_T95_V1_0)
#define I2C_SDA 21
#define I2C_SCL 22
#define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 18
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 23
#define RADIO_CS_PIN 5
#define RADIO_DI0_PIN 26
#define RADIO_RST_PIN 4
#define RADIO_DIO1_PIN 33
#define RADIO_DIO2_PIN 32
#define RADIO_BUSY_PIN UNUSE_PIN
#define ADC_PIN 35
#define HAS_DISPLAY
#else
#error "Please select the version you purchased in utilities.h"
#endif