8000 stm32/i2c: Support more I2C baudrates for F746, and more F7 MCUs. · neverhover/micropython@b806889 · GitHub
[go: up one dir, main page]

Skip to content

Commit b806889

Browse files
committed
stm32/i2c: Support more I2C baudrates for F746, and more F7 MCUs.
1 parent 008e178 commit b806889

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ports/stm32/i2c.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,17 @@ const pyb_i2c_obj_t pyb_i2c_obj[] = {
136136

137137
// The value 0x40912732 was obtained from the DISCOVERY_I2Cx_TIMING constant
138138
// defined in the STM32F7Cube file Drivers/BSP/STM32F746G-Discovery/stm32f7456g_discovery.h
139-
#define MICROPY_HW_I2C_BAUDRATE_TIMING {{100000, 0x40912732}}
140-
#define MICROPY_HW_I2C_BAUDRATE_DEFAULT (100000)
141-
#define MICROPY_HW_I2C_BAUDRATE_MAX (100000)
139+
#define MICROPY_HW_I2C_BAUDRATE_TIMING { \
140+
{100000, 0x40912732}, \
141+
{400000, 0x10911823}, \
142+
{1000000, 0x00611116}, \
143+
}
144+
#define MICROPY_HW_I2C_BAUDRATE_DEFAULT (400000)
145+
#define MICROPY_HW_I2C_BAUDRATE_MAX (1000000)
142146

143-
#elif defined(STM32F767xx) || defined(STM32F769xx)
147+
#elif defined(STM32F722xx) || defined(STM32F723xx) \
148+
|| defined(STM32F732xx) || defined(STM32F733xx) \
149+
|| defined(STM32F767xx) || defined(STM32F769xx)
144150

145151
// These timing values are for f_I2CCLK=54MHz and are only approximate
146152
#define MICROPY_HW_I2C_BAUDRATE_TIMING { \

0 commit comments

Comments
 (0)
0