cpu/stm32f4: add i2c low speed mode support

This commit is contained in:
Koen Zandberg 2016-12-08 12:38:12 +01:00
parent 742387acc0
commit 3ec401da61

View File

@ -73,7 +73,13 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed)
/* read speed configuration */ /* read speed configuration */
switch (speed) { switch (speed) {
case I2C_SPEED_LOW:
/* 10Kbit/s */
ccr = I2C_APBCLK / 20000;
break;
case I2C_SPEED_NORMAL: case I2C_SPEED_NORMAL:
/* 100Kbit/s */
ccr = I2C_APBCLK / 200000; ccr = I2C_APBCLK / 200000;
break; break;