-
Notifications
You must be signed in to change notification settings - Fork 369
LCD_CAM: use the new clock API to get source frequencies #4663
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
base: main
Are you sure you want to change the base?
Conversation
esp-hal/src/lcd_cam/cam.rs
Outdated
| /// [`ConfigError::Clock`] will be returned if the frequency passed in | ||
| /// `Config` is too low. | ||
| pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError> { | ||
| let clocks = Clocks::get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused now
| let clocks = Clocks::get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, CI will point these out, don't worry :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the clock system to use a new clock tree API, primarily to support LCD_CAM peripherals and improve MCPWM clock management. The changes introduce unstable API features for advanced clock configuration while maintaining backward compatibility with existing APIs.
Key Changes
- Introduces new clock tree API with
ClockConfigand peripheral-specific function clocks for MCPWM - Refactors LCD_CAM drivers to query clock frequencies directly from the clock tree instead of the legacy
Clocksstruct - Marks clock configuration types as unstable and makes SoC clock modules unstable-gated
- Removes deprecated clock fields from
Clocksstruct (pwm_clock,crypto_pwm_clock,crypto_clock)
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| esp-metadata/src/cfg/soc.rs | Marks ClockConfig as unstable |
| esp-metadata/devices/*.toml | Adds MCPWM function clock configurations for various ESP32 variants |
| esp-metadata-generated/src/generated*.rs | Generated clock tree types and functions for MCPWM peripherals |
| esp-metadata-generated/src/_build_script_utils.rs | Adds build script support for MCPWM clock node cfg flags |
| esp-hal/src/system.rs | Implements Clone for PeripheralGuard to support multiple clock guards |
| esp-hal/src/soc/*/mod.rs | Moves clock modules behind unstable feature flag |
| esp-hal/src/soc/*/clocks.rs | Implements MCPWM function clock enable/configure functions and makes CpuClock public |
| esp-hal/src/mcpwm/*.rs | Refactors MCPWM to use new clock API with PwmClockGuard |
| esp-hal/src/lcd_cam/*.rs | Updates LCD_CAM to query frequencies from clock tree |
| esp-hal/src/clock/mod.rs | Removes legacy clock types and fields, consolidates clock configuration |
| esp-hal/CHANGELOG.md | Documents the addition of unstable clock configuration and removal of legacy clock fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cc #4502
Based on top of #4647