瀏覽代碼

F7: Support new F7 v2 board design.

Keir Fraser 4 年之前
父節點
當前提交
97eb1ca5ed
共有 3 個文件被更改,包括 19 次插入8 次删除
  1. 4 3
      inc/stm32/f7.h
  2. 3 2
      scripts/greaseweazle/tools/info.py
  3. 12 3
      src/f7/board.c

+ 4 - 3
inc/stm32/f7.h

@@ -89,9 +89,10 @@ void gpio_set_af(GPIO gpio, unsigned int pin, unsigned int af);
 #define section_ext_ram __attribute__((section(".ext_ram")))
 
 enum {
-    F7SM_basic = 0,
-    F7SM_ambertronic_f7_plus = 1,
-    F7SM_lightning = 2
+    F7SM_basic_v1 = 0,
+    F7SM_ambertronic_f7_plus,
+    F7SM_lightning,
+    F7SM_basic_v2,
 };
 
 struct user_pin {

+ 3 - 2
scripts/greaseweazle/tools/info.py

@@ -16,9 +16,10 @@ from greaseweazle import usb as USB
 from greaseweazle import version
 
 model_id = { 1: { 0: 'F1' },
-             7: { 0: 'F7',
+             7: { 0: 'F7 (version 1)',
                   1: 'AmberTronic F7 Plus',
-                  2: 'F7 Lightning' } }
+                  2: 'F7 Lightning',
+                  3: 'F7 (version 2)' } }
 
 speed_id = { 0: 'Full Speed (12 Mbit/s)',
              1: 'High Speed (480 Mbit/s)' }

+ 12 - 3
src/f7/board.c

@@ -32,7 +32,7 @@ GPIO gpio_from_id(uint8_t id)
     return NULL;
 }
 
-const static struct user_pin _user_pins_F7SM_basic[] = {
+const static struct user_pin _user_pins_F7SM_basic_v1[] = {
     { 2, _B, 12, _OD },
     { 0,  0,  0, _OD } };
 const static struct user_pin _user_pins_F7SM_ambertronic_f7_plus[] = {
@@ -44,11 +44,16 @@ const static struct user_pin _user_pins_F7SM_lightning[] = {
     { 4, _E, 15, _PP },
     { 6, _E, 14, _PP },
     { 0,  0,  0, _PP } };
+const static struct user_pin _user_pins_F7SM_basic_v2[] = {
+    { 2, _B, 12, _OD },
+    { 4, _C,  8, _OD },
+    { 6, _C,  7, _OD },
+    { 0,  0,  0, _OD } };
 const static struct board_config _board_config[] = {
-    [F7SM_basic] = {
+    [F7SM_basic_v1] = {
         .hse_mhz   = 8,
         .hs_usb    = FALSE,
-        .user_pins = _user_pins_F7SM_basic },
+        .user_pins = _user_pins_F7SM_basic_v1 },
     [F7SM_ambertronic_f7_plus] = {
         .hse_mhz   = 8,
         .hs_usb    = FALSE,
@@ -57,6 +62,10 @@ const static struct board_config _board_config[] = {
         .hse_mhz   = 16,
         .hs_usb    = TRUE,
         .user_pins = _user_pins_F7SM_lightning },
+    [F7SM_basic_v2] = {
+        .hse_mhz   = 8,
+        .hs_usb    = FALSE,
+        .user_pins = _user_pins_F7SM_basic_v2 },
 };
 const struct board_config *board_config;