summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@adafruit.com>2019-11-06 14:29:29 -0500
committerGitHub <noreply@github.com>2019-11-06 14:29:29 -0500
commitb8373aca0c38d709266e3c0534da26ab3bcbff80 (patch)
tree67481b38aeb0743974ed538775d99b182074bd2f
parent01bf9321692d00da8628b7b230be3b03665eff82 (diff)
parente66fcb5e1f98ff75185d3829ef36c0af33fd293f (diff)
Merge pull request #2266 from hierophect/stm32-defaults
STM32: Add board defaults
-rw-r--r--ports/stm32f4/boards/feather_stm32f405_express/board.c3
-rw-r--r--ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h13
-rw-r--r--ports/stm32f4/boards/feather_stm32f405_express/pins.c4
-rw-r--r--ports/stm32f4/boards/pyboard_v11/mpconfigboard.h8
-rw-r--r--ports/stm32f4/boards/pyboard_v11/pins.c2
-rw-r--r--ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h3
-rw-r--r--ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h5
-rw-r--r--ports/stm32f4/boards/stm32f412zg_discovery/pins.c2
8 files changed, 30 insertions, 10 deletions
diff --git a/ports/stm32f4/boards/feather_stm32f405_express/board.c b/ports/stm32f4/boards/feather_stm32f405_express/board.c
index 4421970ee..82b0c506e 100644
--- a/ports/stm32f4/boards/feather_stm32f405_express/board.c
+++ b/ports/stm32f4/boards/feather_stm32f405_express/board.c
@@ -25,12 +25,13 @@
*/
#include "boards/board.h"
+#include "mpconfigboard.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
- return false;
+ return false;
}
void reset_board(void) {
diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h
index d795342dd..67ddc885a 100644
--- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h
+++ b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h
@@ -3,8 +3,7 @@
*
* The MIT License (MIT)
*
- * Copyright (c) 2016 Glenn Ruben Bakke
- * Copyright (c) 2018 Dan Halbert for Adafruit Industries
+ * Copyright (c) 2019 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -41,3 +40,13 @@
#define SPI_FLASH_MISO_PIN &pin_PB04
#define SPI_FLASH_SCK_PIN &pin_PB03
#define SPI_FLASH_CS_PIN &pin_PA15
+
+#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
+#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
+
+#define DEFAULT_SPI_BUS_SCK (&pin_PB13)
+#define DEFAULT_SPI_BUS_MOSI (&pin_PB15)
+#define DEFAULT_SPI_BUS_MISO (&pin_PB14)
+
+#define DEFAULT_UART_BUS_RX (&pin_PB11)
+#define DEFAULT_UART_BUS_TX (&pin_PB10)
diff --git a/ports/stm32f4/boards/feather_stm32f405_express/pins.c b/ports/stm32f4/boards/feather_stm32f405_express/pins.c
index 518ab6d2a..4aa1f362a 100644
--- a/ports/stm32f4/boards/feather_stm32f405_express/pins.c
+++ b/ports/stm32f4/boards/feather_stm32f405_express/pins.c
@@ -25,5 +25,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) },
+
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
+ { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
+ { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h
index e8441d665..9d8f72f77 100644
--- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h
+++ b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h
@@ -3,8 +3,7 @@
*
* The MIT License (MIT)
*
- * Copyright (c) 2016 Glenn Ruben Bakke
- * Copyright (c) 2018 Dan Halbert for Adafruit Industries
+ * Copyright (c) 2019 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -34,4 +33,7 @@
#define FLASH_PAGE_SIZE (0x4000)
#define AUTORESET_DELAY_MS 500
-#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) \ No newline at end of file
+#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000)
+
+#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
+#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
diff --git a/ports/stm32f4/boards/pyboard_v11/pins.c b/ports/stm32f4/boards/pyboard_v11/pins.c
index ccbb58ab9..8783dfcf1 100644
--- a/ports/stm32f4/boards/pyboard_v11/pins.c
+++ b/ports/stm32f4/boards/pyboard_v11/pins.c
@@ -46,5 +46,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) },
+
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h
index d5491fe36..d7898ba0b 100644
--- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h
+++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h
@@ -3,8 +3,7 @@
*
* The MIT License (MIT)
*
- * Copyright (c) 2016 Glenn Ruben Bakke
- * Copyright (c) 2018 Dan Halbert for Adafruit Industries
+ * Copyright (c) 2019 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h
index ebee98f89..45505dee2 100644
--- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h
+++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h
@@ -3,8 +3,7 @@
*
* The MIT License (MIT)
*
- * Copyright (c) 2016 Glenn Ruben Bakke
- * Copyright (c) 2018 Dan Halbert for Adafruit Industries
+ * Copyright (c) 2019 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,3 +35,5 @@
#define AUTORESET_DELAY_MS 500
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000)
+#define DEFAULT_I2C_BUS_SCL (&pin_PB10)
+#define DEFAULT_I2C_BUS_SDA (&pin_PB09)
diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c b/ports/stm32f4/boards/stm32f412zg_discovery/pins.c
index a0b477a47..b92f21270 100644
--- a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c
+++ b/ports/stm32f4/boards/stm32f412zg_discovery/pins.c
@@ -88,5 +88,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PE01) },
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE03) },
+
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);