Browse Source

STEVAL_3DP001V1: Easier Serial2 (for WIFI interface) (#16599)

Bob Kuhn 4 years ago
parent
commit
f6468f0af3
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h

+ 12
- 4
buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h View File

@@ -51,7 +51,7 @@ extern "C" {
51 51
 #define PA9  0 //TX
52 52
 #define PA10 1 //RX
53 53
 
54
-// WIFI
54
+// WIFI (USART2)
55 55
 #define PD3   2 // CTS
56 56
 #define PD4   3 // RTS
57 57
 #define PD5   4 // TX
@@ -183,12 +183,20 @@ extern "C" {
183 183
 #define USER_BTN                PE7
184 184
 
185 185
 // UART Definitions
186
-#define SERIAL_UART_INSTANCE    1 //Connected to ST-Link
186
+#define SERIAL_UART_INSTANCE    1 // Connected to ST-Link
187
+//#define SERIAL_UART_INSTANCE    2 // Connected to WIFI
187 188
 
188 189
 // Default pin used for 'Serial' instance (ex: ST-Link)
189 190
 // Mandatory for Firmata
190
-#define PIN_SERIAL_RX           PA10
191
-#define PIN_SERIAL_TX           PA9
191
+#if SERIAL_UART_INSTANCE == 1             // ST-Link & J23
192
+  #define PIN_SERIAL_RX         PA10
193
+  #define PIN_SERIAL_TX         PA9
194
+#elif SERIAL_UART_INSTANCE == 2         // WIFI interface
195
+  #define PIN_SERIAL2_RX        PD6
196
+  #define PIN_SERIAL2_TX        PD5
197
+#else
198
+  #error'Invaqlid setting for SERIAL_UART_INSTANCE'
199
+#endif
192 200
 
193 201
 // Timer Definitions
194 202
 #define TIMER_SERVO             TIM4  // TIMER_SERVO must be defined in this file

Loading…
Cancel
Save