Comments (6)
The simplest to start with would be a "boot-default" configuration without actually changing any clock settings. This way drivers can get the clock rates and as soon as we actually make it possible to change clock rates things should "just work"
from esp-hal.
CPU clock settings for ESP32 and ESP32-C3 are implemented in #110
Will continue with ESP32-S2 and ESP32-S3 then ... after that I would consider this to be done
from esp-hal.
I wonder which clocks need to be contained in the clock config struct?
I can think of these:
- CPU CLK
- APB_CLK
- Option: XTAL_CLK
- Option: FOSC_CLK
- Option: RTC8M
- Option: APLL_CLOCK
- Option: REF_TICK
- Option: PLL_160M
- Option: PLL_240M
- Option: PLL_CLK
- Option: PLL_D2_CLK
Probably there are more.
The "Option" prefixed ones are not available for all targets. Should they be wrapped by an Option in the struct or just not be contained if not available for the target?
from esp-hal.
Option: XTAL_CLK
Is this really an option? I thought all esp's had some form of crystal clock? It's also the default clock source for a lot of peripherals (at least on the c3, when I skimmed the TRM).
I haven't looked through all the chip trms but this looks like a solid base (maybe we can do some smart grepping of the SVDs to find all clock sources?). It should be easy to determine what clocks are available to the driver and pick the best one. It might get interesting for peripherals like LEDC, where the input clock puts a limitation of certain output frequencies... but we'll worry about that later 😆.
from esp-hal.
Option: XTAL_CLK
Is this really an option? I thought all esp's had some form of crystal clock? It's also the default clock source for a lot of peripherals (at least on the c3, when I skimmed the TRM).
Ah true - I just looked at the "Peripheral Clock Usage" table and e.g. S2 doesn't list it as a direct clock source for peripherals but it's an indirect clock source ... 🕵️♂️ good point - we should include it
from esp-hal.
First part (basically introducing ClockConfig
with boot-defaults) has been done in #77
Next task is adding support for actually changing the clock rates
from esp-hal.
Related Issues (20)
- #[ram(zeroed)] statics are unsound
- Publish first versions of current unpublished packages
- Bytes reading from UART blocks forever on esp32c3 HOT 5
- Improve module level documentation for GPIO
- Expose GPIO matrix to users HOT 3
- Changing SPI clock is unexpectedly expensive HOT 1
- RFC: Provide consistent APIs for configuring clock sources for peripheral drivers
- DOCS: don't include dependencies
- Confusion about async I2S DMA buffering HOT 10
- `esp-println` fails to compile with `defmt-espflash,auto` features HOT 4
- esp-backtrace failed to compile on nightly 1.81
- Allow initialise `esp-wifi` without forcing CPU max clock HOT 2
- I2S: feature request or RFC about changing sample_freq "on-the-fly" HOT 1
- Are there any plans to implement a ZigBee stack on top of the esp-ieee802154 crate? HOT 2
- Verify packages build with both `stable` and `nightly` toolchains
- Add an example and/or other CI check to verify `defmt` features
- How to override the default post_init function? HOT 5
- can't declare type for esp_hal::lcd_cam::lcd::i8080::I8080 HOT 5
- UART AT character detection not working. HOT 7
- wifi example esp32 linkage error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-hal.