F7: Support new F7 v2 board design.

This commit is contained in:
Keir Fraser
2020-06-07 13:01:44 +01:00
parent 798a5db854
commit 97eb1ca5ed
3 changed files with 19 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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)' }

View File

@@ -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;