Skip to content

Add boot-default ClockConfig#77

Merged
MabezDev merged 1 commit intoesp-rs:mainfrom
bjoernQ:feature/add-clock-config-type
Jun 9, 2022
Merged

Add boot-default ClockConfig#77
MabezDev merged 1 commit intoesp-rs:mainfrom
bjoernQ:feature/add-clock-config-type

Conversation

@bjoernQ
Copy link
Copy Markdown
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

@bjoernQ bjoernQ requested review from MabezDev and jessebraham June 9, 2022 11:11
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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