aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32/boards/NUCLEO_F746ZG
diff options
context:
space:
mode:
authorDamien George2018-04-11 16:27:48 +1000
committerDamien George2018-04-11 16:35:24 +1000
commita7ebac2eaed7eb0da362568b9333339634f1da1d (patch)
tree0f5d9832bf9f61e8b968d00fc22a93cb706a983d /ports/stm32/boards/NUCLEO_F746ZG
parent0041396f05bc1f43657c343df6b291fc4bbdc901 (diff)
stm32/can: Allow CAN pins to be configured per board.
This patch allows a given board to configure which pins are used for the CAN peripherals, in a similar way to all the other bus peripherals (I2C, UART, SPI). To enable CAN on a board the mpconfigboard.h file should define (for example): #define MICROPY_HW_CAN1_TX (pin_B9) #define MICROPY_HW_CAN1_RX (pin_B8) #define MICROPY_HW_CAN2_TX (pin_B13) #define MICROPY_HW_CAN2_RX (pin_B12) And the board config file should no longer define MICROPY_HW_ENABLE_CAN.
Diffstat (limited to 'ports/stm32/boards/NUCLEO_F746ZG')
-rw-r--r--ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
index 42beb4d9b..a9fbea576 100644
--- a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
@@ -11,7 +11,6 @@
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
-#define MICROPY_HW_ENABLE_CAN (1)
#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
@@ -53,6 +52,12 @@
#define MICROPY_HW_SPI3_MISO (pin_B4)
#define MICROPY_HW_SPI3_MOSI (pin_B5)
+// CAN busses
+#define MICROPY_HW_CAN1_TX (pin_B9)
+#define MICROPY_HW_CAN1_RX (pin_B8)
+#define MICROPY_HW_CAN2_TX (pin_B13)
+#define MICROPY_HW_CAN2_RX (pin_B12)
+
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_C13)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)