summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJonathan Giles <jonathangiles@fastmail.fm>2020-12-22 09:07:50 -0500
committerJonathan Giles <jonathangiles@fastmail.fm>2020-12-22 09:11:05 -0500
commitaaa3c61819bc0c819df88df00d6fe8b52d677356 (patch)
tree4b65a74c807c43b98a43c96376a2f3a72f291664 /ports
parentd6df43b9432c992debd0d7c309765c17e80450f8 (diff)
Add default I2C pins for STM32F411CE
Diffstat (limited to 'ports')
-rw-r--r--ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h3
-rw-r--r--ports/stm/boards/stm32f411ce_blackpill/pins.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h
index 83a8bded3..435133954 100644
--- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h
+++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h
@@ -42,6 +42,9 @@
// #define SPI_FLASH_SCK_PIN (&pin_PA05)
// #define SPI_FLASH_CS_PIN (&pin_PA04)
+#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
+#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
+
#define CIRCUITPY_AUTORELOAD_DELAY_MS (500)
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000)
diff --git a/ports/stm/boards/stm32f411ce_blackpill/pins.c b/ports/stm/boards/stm32f411ce_blackpill/pins.c
index 2f8aab6e8..16946b8be 100644
--- a/ports/stm/boards/stm32f411ce_blackpill/pins.c
+++ b/ports/stm/boards/stm32f411ce_blackpill/pins.c
@@ -35,5 +35,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) },
{ MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) },
+
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) },
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) },
+
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);