Quellcode durchsuchen

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

Bob Kuhn vor 4 Jahren
Ursprung
Commit
f6468f0af3
1 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
  1. 12
    4
      buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h

+ 12
- 4
buildroot/share/PlatformIO/variants/STEVAL_F401VE/variant.h Datei anzeigen

51
 #define PA9  0 //TX
51
 #define PA9  0 //TX
52
 #define PA10 1 //RX
52
 #define PA10 1 //RX
53
 
53
 
54
-// WIFI
54
+// WIFI (USART2)
55
 #define PD3   2 // CTS
55
 #define PD3   2 // CTS
56
 #define PD4   3 // RTS
56
 #define PD4   3 // RTS
57
 #define PD5   4 // TX
57
 #define PD5   4 // TX
183
 #define USER_BTN                PE7
183
 #define USER_BTN                PE7
184
 
184
 
185
 // UART Definitions
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
 // Default pin used for 'Serial' instance (ex: ST-Link)
189
 // Default pin used for 'Serial' instance (ex: ST-Link)
189
 // Mandatory for Firmata
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
 // Timer Definitions
201
 // Timer Definitions
194
 #define TIMER_SERVO             TIM4  // TIMER_SERVO must be defined in this file
202
 #define TIMER_SERVO             TIM4  // TIMER_SERVO must be defined in this file

Laden…
Abbrechen
Speichern