mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-28 04:40:52 +00:00
Fix I²C frequency for esp32 and esp32s2. (#1333)
Co-authored-by: Ghislain MARY <ghislain@ghislainmary.fr>
This commit is contained in:
parent
1b2dab1dff
commit
d50290e9dd
@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fixing `esp-wifi` + `TRNG` issue on `ESP32-S2` (#1272)
|
||||
- Fixed core1 startup using the wrong stack on the esp32 and esp32s3 (#1286).
|
||||
- ESP32: Apply fix for Errata 3.6 in all the places necessary. (#1315)
|
||||
- ESP32 & ESP32-S2: Fix I²C frequency (#1306)
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -398,7 +398,7 @@ impl<'d> ClockControl<'d> {
|
||||
cpu_clock: cpu_clock_speed.frequency(),
|
||||
apb_clock: HertzU32::MHz(80),
|
||||
xtal_clock: HertzU32::MHz(40),
|
||||
i2c_clock: HertzU32::MHz(40),
|
||||
i2c_clock: HertzU32::MHz(80),
|
||||
// The docs are unclear here. pwm_clock seems to be tied to clocks.apb_clock
|
||||
// while simultaneously being fixed at 160 MHz.
|
||||
// Testing showed 160 MHz to be correct for current clock configurations.
|
||||
|
@ -689,7 +689,9 @@ pub trait Instance {
|
||||
// Configure frequency
|
||||
#[cfg(esp32)]
|
||||
self.set_frequency(clocks.i2c_clock.convert(), frequency, timeout);
|
||||
#[cfg(not(esp32))]
|
||||
#[cfg(esp32s2)]
|
||||
self.set_frequency(clocks.apb_clock.convert(), frequency, timeout);
|
||||
#[cfg(not(any(esp32, esp32s2)))]
|
||||
self.set_frequency(clocks.xtal_clock.convert(), frequency, timeout);
|
||||
|
||||
self.update_config();
|
||||
|
Loading…
x
Reference in New Issue
Block a user