diff options
| author | Dave Hylands | 2015-08-03 23:04:57 -0700 |
|---|---|---|
| committer | Damien George | 2015-08-05 23:38:24 +0100 |
| commit | 34fe5a30c6b9ec4ff5d9b10ef9b2e39ec5fd778f (patch) | |
| tree | fe41fe0346d09471c6b4308b100b4a8ee71e10e5 /stmhal/boards/STM32F7DISC/mpconfigboard.h | |
| parent | 26664dd1802615b48ce5f53aa8a00a79353c7ae3 (diff) | |
stmhal: Enable I2C support for F7 MCUs.
Diffstat (limited to 'stmhal/boards/STM32F7DISC/mpconfigboard.h')
| -rw-r--r-- | stmhal/boards/STM32F7DISC/mpconfigboard.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stmhal/boards/STM32F7DISC/mpconfigboard.h b/stmhal/boards/STM32F7DISC/mpconfigboard.h index dee42cb68..6a0d46bf4 100644 --- a/stmhal/boards/STM32F7DISC/mpconfigboard.h +++ b/stmhal/boards/STM32F7DISC/mpconfigboard.h @@ -47,6 +47,19 @@ void STM32F7DISC_board_early_init(void); #define MICROPY_HW_I2C1_SCL (pin_B8) #define MICROPY_HW_I2C1_SDA (pin_B9) +#define MICROPY_HW_I2C3_SCL (pin_H7) +#define MICROPY_HW_I2C3_SDA (pin_H8) + +// The STM32F7 uses a TIMINGR register which is configured using an Excel +// Spreadsheet from AN4235: http://www.st.com/web/en/catalog/tools/PF258335 +// We use an array of baudrates and corresponding TIMINGR values. +// +// The value 0x40912732 was obtained from the DISCOVERY_I2Cx_TIMING constant +// defined in the STM32F7Cube file Drivers/BSP/STM32F746G-Discovery/stm32f7456g_discovery.h +#define MICROPY_HW_I2C_BAUDRATE_TIMING {{100000, 0x40912732}} +#define MICROPY_HW_I2C_BAUDRATE_DEFAULT 100000 +#define MICROPY_HW_I2C_BAUDRATE_MAX 100000 + // USRSW is pulled low. Pressing the button makes the input go high. #define MICROPY_HW_USRSW_PIN (pin_I11) #define MICROPY_HW_USRSW_PULL (GPIO_NOPULL) |
