mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11672 from ABOSTM/I2C_FASTMODEPLUS
STM32F767ZI - I2C FastModePlus not properly enabledpull/11725/head
commit
9db54bc1ee
|
@ -389,25 +389,33 @@ void i2c_frequency(i2c_t *obj, int hz)
|
|||
|
||||
// Enable the Fast Mode Plus capability
|
||||
if (hz == 1000000) {
|
||||
#if defined(I2C1_BASE) && defined(__HAL_SYSCFG_FASTMODEPLUS_ENABLE) && defined (I2C_FASTMODEPLUS_I2C1)
|
||||
#if defined(I2C1_BASE) && defined(I2C_FASTMODEPLUS_I2C1) // sometimes I2C_FASTMODEPLUS_I2Cx is define even if not supported by the chip
|
||||
#if defined(SYSCFG_CFGR1_I2C_FMP_I2C1) || defined(SYSCFG_CFGR1_I2C1_FMP) || defined(SYSCFG_PMC_I2C1_FMP) || defined(SYSCFG_PMCR_I2C1_FMP) || defined(SYSCFG_CFGR2_I2C1_FMP)
|
||||
if (obj_s->i2c == I2C_1) {
|
||||
HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C1);
|
||||
}
|
||||
#endif
|
||||
#if defined(I2C2_BASE) && defined(__HAL_SYSCFG_FASTMODEPLUS_ENABLE) && defined (I2C_FASTMODEPLUS_I2C2)
|
||||
#endif
|
||||
#if defined(I2C2_BASE) && defined(I2C_FASTMODEPLUS_I2C2) // sometimes I2C_FASTMODEPLUS_I2Cx is define even if not supported by the chip
|
||||
#if defined(SYSCFG_CFGR1_I2C_FMP_I2C2) || defined(SYSCFG_CFGR1_I2C2_FMP) || defined(SYSCFG_PMC_I2C2_FMP) || defined(SYSCFG_PMCR_I2C2_FMP) || defined(SYSCFG_CFGR2_I2C2_FMP)
|
||||
if (obj_s->i2c == I2C_2) {
|
||||
HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C2);
|
||||
}
|
||||
#endif
|
||||
#if defined(I2C3_BASE) && defined(__HAL_SYSCFG_FASTMODEPLUS_ENABLE) && defined (I2C_FASTMODEPLUS_I2C3)
|
||||
#endif
|
||||
#if defined(I2C3_BASE) && defined (I2C_FASTMODEPLUS_I2C3) // sometimes I2C_FASTMODEPLUS_I2Cx is define even if not supported by the chip
|
||||
#if defined(SYSCFG_CFGR1_I2C_FMP_I2C3) || defined(SYSCFG_CFGR1_I2C3_FMP) || defined(SYSCFG_PMC_I2C3_FMP) || defined(SYSCFG_PMCR_I2C3_FMP) || defined(SYSCFG_CFGR2_I2C3_FMP)
|
||||
if (obj_s->i2c == I2C_3) {
|
||||
HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C3);
|
||||
}
|
||||
#endif
|
||||
#if defined(I2C4_BASE) && defined(__HAL_SYSCFG_FASTMODEPLUS_ENABLE) && defined (I2C_FASTMODEPLUS_I2C4)
|
||||
#endif
|
||||
#if defined(I2C4_BASE) && defined (I2C_FASTMODEPLUS_I2C4) // sometimes I2C_FASTMODEPLUS_I2Cx is define even if not supported by the chip
|
||||
#if defined(SYSCFG_CFGR1_I2C_FMP_I2C4) || defined(SYSCFG_CFGR1_I2C4_FMP) || defined(SYSCFG_PMC_I2C4_FMP) || defined(SYSCFG_PMCR_I2C4_FMP) || defined(SYSCFG_CFGR2_I2C4_FMP)
|
||||
if (obj_s->i2c == I2C_4) {
|
||||
HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C4);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif //I2C_IP_VERSION_V2
|
||||
|
|
Loading…
Reference in New Issue