File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
targets/TARGET_STM/TARGET_STM32L4 Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 31
31
#define MBED_I2C_DEVICE_H
32
32
33
33
#include "cmsis.h"
34
+ #include "mbed_error.h"
34
35
35
36
#ifdef __cplusplus
36
37
extern "C" {
@@ -82,6 +83,23 @@ static inline uint32_t get_i2c_timing(int hz)
82
83
default :
83
84
break ;
84
85
}
86
+ } else if (SystemCoreClock == 120000000 ) {
87
+ // Common settings: I2C clock = 120 MHz, Analog filter = ON, Digital filter coefficient = 0
88
+ switch (hz ) {
89
+ case 100000 :
90
+ tim = 0x107075B0 ; // Standard mode with Rise Time = 400ns and Fall Time = 100ns
91
+ break ;
92
+ case 400000 :
93
+ tim = 0x00501E6C ; // Fast mode with Rise Time = 250ns and Fall Time = 100ns
94
+ break ;
95
+ case 1000000 :
96
+ tim = 0x00200A26 ; // Fast mode Plus with Rise Time = 60ns and Fall Time = 100ns
97
+ break ;
98
+ default :
99
+ break ;
100
+ }
101
+ } else {
102
+ error ("get_i2c_timing error\n" );
85
103
}
86
104
return tim ;
87
105
}
You can’t perform that action at this time.
0 commit comments