Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boot-default ClockConfig #77

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jun 9, 2022

This is the first part of #44

While it doesn't allow you to change clock rates, yet it prepares for this by introducing ClockControll::boot_defaults()

  • there is a i2c_clock which doesn't exist - it's because according to the TRM on ESP32 it's always 80MHz and it's not clear to me from where that is ... so, adding this for now seems to be the easiest solution - not ideal but should be okay for now
  • the struct only contains clocks we actually use currently - if we need more, we should add them as needed
  • also, this adds system which splits the SYSTEM/DPORT - currently only into PeripheralClockControl and SystemClockControl
  • there is nothing yet for SystemClockControl - will be added once we actually allow to change clocks

I think this is an improvement in general - definitely more to come however - and I guess this contains enough changes for a single PR

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me! PeripheralClockControl is nice, a lot let cfg_if's sprinkled around now - all in one place for the most part.

@MabezDev MabezDev merged commit 3fd4b03 into esp-rs:main Jun 9, 2022
/// The existence of this value indicates that the clock configuration can no
/// longer be changed
pub struct Clocks {
_private: (),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this field?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, the end user would be able to construct Clocks from thin air. This private field means it can only come from the HAL.

@bjoernQ bjoernQ deleted the feature/add-clock-config-type branch October 27, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants