-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxPinMap.h
135 lines (112 loc) · 4.43 KB
/
xPinMap.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
/*
* Copyright (c) 2019 Helmut Tschemernjak
* 30826 Garbsen (Hannover) Germany
* Licensed under the Apache License, Version 2.0);
*/
#ifndef __XPINMAP_H__
#define __XPINMAP_H__
#define RS_MAJOR 4
#define RS_MINOR 2
#define MAJOR_VERSION 1
#define MINOR_VERSION 1
#ifdef TARGET_STM32L432KC
#define HELTECL432_REV1
#define FEATURE_LORA
#define FEATURE_LORA_PING_PONG
#define FEATURE_USBSERIAL
#define FEATURE_NVPROPERTY
#define FEATURE_NVPROPERTYEDITOR
#define FEATURE_SI7021
#define FEATURE_SSD1306
#endif
#ifdef TARGET_STM32L433xC
#define ECOPOWER_REV2
#define FEATURE_LORA
#define FEATURE_RADIOTESTSAMPLE
#define FEATURE_LORA_PING_PONG
#define FEATURE_USBSERIAL
#define FEATURE_NVPROPERTY
#define FEATURE_NVPROPERTYEDITOR
#define FEATURE_SI7021
#define FEATURE_SSD1306
#endif
#ifdef HELTECL432_REV1
#define USER_BUTTON (PinName) 0x73 // PH_3 boot pin
#define USER_BUTTON_RISE
#define STATUS_LED PB_1 // green LED
#define LED2 PB_0 // red LED
#define LED STATUS_LED
#define BATPOWER_EN PA_8 // high indicates power source is battery, removable bridge
#define BATPOWER_EXT 1
#define SPI_LSM_MOSI PA_7
#define SPI_LSM_MISO PA_6
#define SPI_LSM_SCLK PA_5
#define CS_FLASH NC
#define EXT_POWER_SW PA_3 // VEXT on/off
#define EXT_POWER_ON 0
#define EXT_POWER_OFF 1
#define LORA_SPI_MOSI SPI_LSM_MOSI
#define LORA_SPI_MISO SPI_LSM_MISO
#define LORA_SPI_SCLK SPI_LSM_SCLK
#define LORA_CS PA_4
#define LORA_RESET PA_1
#define LORA_DIO0 PA_0 // used for Rx, Tx Interrupt
#define LORA_DIO1 NC // PB_6Fifo Level/Full, RxTimeout/Cad Detection Interrupt, unused in RadioShuttle
#define LORA_DIO2 NC // FhssChangeChannel when FreqHop is on, unused in RadioShuttle
#define LORA_DIO3 NC // optionally Cad Detection in RS_Node_Offline/Checking mode
#define LORA_DIO4 NC // FSK mode preamble detected, unused in RadioShuttle
#define LORA_DIO5 NC // FSK mode ready / ClockOut, unused in RadioShuttle
#define LORA_ANT_PWR EXT_POWER_SW // the analog switch is getting turned off go save energy
/* this following are available pins for custom use */
#define P_SWLCK PA_14 // available only when no debugger is being used.
#define P_SWDIO PA_13 // available only when no debugger is being used
#define P_SWO PB_3 // available only when no SWO debugging output is being used
#define P_PA_2_TX PA_2 // available only when no debug serial console is being used
#define P_PA_15_RX PA_15 // available only when no debug serial console is being used
#define P_PA_9_SCL PA_9 // SCL includes 10k removable hardware pullup
#define P_PA_10_SDA PA_10 // SCL includes 10k removable hardware pullup
#define P_PB_4 PB_4
#define P_PB_5 PB_5
#define P_PB_6 PB_6
#define P_PB_7 PB_7
#define SI7021_SDA P_PA_10_SDA
#define SI7021_SCL P_PA_9_SCL
#define DISPLAY_ADDRESS 0x3c
#define DISPLAY_SDA P_PA_10_SDA
#define DISPLAY_SCL P_PA_9_SCL
#define WatchDogUpdate() void()
#elif defined(ECOPOWER_REV2)
#define USER_BUTTON PH_3 // boot pin
#define USER_BUTTON_RISE
#define STATUS_LED PC_13 // yellow LED
#define LED2 PB_11 // green LED
#define LED STATUS_LED
#define BATPOWER_EN PA_0 // high indicates power source is battery, removable bridge
#define BATPOWER_EXT 0 // 0 on eexterna power, 1 on battery power
#define EXT_POWER_SW PA_XXX // VEXT on/off
#define EXT_POWER_ON 0
#define EXT_POWER_OFF 1
#define ESP_POWER_SW PB_15
#define ESP_POWER_ON 0
#define ESP_POWER_OFF 1
#define LORA_SPI_MOSI PA_7
#define LORA_SPI_MISO PA_6
#define LORA_SPI_SCLK PA_5
#define LORA_CS PA_8
#define LORA_RESET PA_1
#define LORA_DIO0 PA_15 // used for Rx, Tx Interrupt
#define LORA_DIO1 NC // PB_6Fifo Level/Full, RxTimeout/Cad Detection Interrupt, unused in RadioShuttle
#define LORA_DIO2 NC // FhssChangeChannel when FreqHop is on, unused in RadioShuttle
#define LORA_DIO3 NC // optionally Cad Detection in RS_Node_Offline/Checking mode
#define LORA_DIO4 NC // FSK mode preamble detected, unused in RadioShuttle
#define LORA_DIO5 NC // FSK mode ready / ClockOut, unused in RadioShuttle
#define SI7021_SDA PA_10
#define SI7021_SCL PA_9
#define DISPLAY_ADDRESS 0x3c
#define DISPLAY_SDA PA_10
#define DISPLAY_SCL PA_9
#define WatchDogUpdate() void()
#else
#error "unknown board"
#endif
#endif // PinMap.h