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 | |
| parent | 26664dd1802615b48ce5f53aa8a00a79353c7ae3 (diff) | |
stmhal: Enable I2C support for F7 MCUs.
Diffstat (limited to 'stmhal/boards/STM32F7DISC')
| -rw-r--r-- | stmhal/boards/STM32F7DISC/mpconfigboard.h | 13 | ||||
| -rw-r--r-- | stmhal/boards/STM32F7DISC/pins.csv | 4 |
2 files changed, 17 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) diff --git a/stmhal/boards/STM32F7DISC/pins.csv b/stmhal/boards/STM32F7DISC/pins.csv index 37d0edaf3..917214ae7 100644 --- a/stmhal/boards/STM32F7DISC/pins.csv +++ b/stmhal/boards/STM32F7DISC/pins.csv @@ -26,12 +26,16 @@ TP1,PH2 TP2,PI8 TP3,PH15 AUDIO_INT,PD6 +AUDIO_SDA,PH8 +AUDIO_SCL,PH7 EXT_SDA,PB9 EXT_SCL,PB8 EXT_RST,PG3 SD_SW,PC13 LCD_BL_CTRL,PK3 LCD_INT,PI13 +LCD_SDA,PH8 +LCD_SCL,PH7 OTG_FS_POWER,PD5 OTG_FS_OVER_CURRENT,PD4 OTG_HS_OVER_CURRENT,PE3 |
