forked from Xinyuan-LilyGO/LilyGo-LoRa-Series
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard_def.h
80 lines (63 loc) · 1.49 KB
/
board_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
#ifndef BOARD_DEF_H
#define BOARD_DEF_H
// #define T_BEAM_V07
#define T_BEAM_V10
#define ENABLE_SSD1306
#define ENABLE_GPS
#define ENABLE_LOAR
//ssd1306 oled显示屏
#define SSD1306_ADDRESS 0x3c
#ifdef ENABLE_SSD1306
#include "SSD1306.h"
#include "OLEDDisplayUi.h"
#define SSD1306_OBJECT() SSD1306 oled(SSD1306_ADDRESS, I2C_SDA, I2C_SCL);OLEDDisplayUi ui(&oled)
#else
#define SSD1306_OBJECT()
#endif
//lora模块
#ifdef ENABLE_LOAR
#include <LoRa.h>
#define LORA_PERIOD 868
#define LORA_SCK 5
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_SS 18
#define LORA_DI0 26
#define LORA_RST 23
//设置为1则设定为lora 发送, 0 则为接收
#define LORA_SENDER 1
#endif
//GPS模块
#ifdef ENABLE_GPS
#include <TinyGPS++.h>
#define UBLOX_GPS_OBJECT() TinyGPSPlus gps
#define GPS_BANUD_RATE 9600
#if defined(T_BEAM_V07)
#define GPS_RX_PIN 12
#define GPS_TX_PIN 15
#elif defined(T_BEAM_V10)
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
#endif
#else
UBLOX_GPS_OBJECT()
#endif
#ifdef ENABLE_LOAR
#if LORA_PERIOD == 433
#define BAND 433E6
#elif LORA_PERIOD == 868
#define BAND 868E6
#elif LORA_PERIOD == 915
#define BAND 915E6
#else
#define BAND 433E6
#endif
#endif
#define I2C_SDA 21
#define I2C_SCL 22
#define PMU_IRQ 35
#define GPS_POWER_CTRL_CH 3
#define LORA_POWER_CTRL_CH 2
#define ENABLE_BUZZER
#define BUZZER_PIN 4
#endif /*BOARD_DEF_H*/