-
Notifications
You must be signed in to change notification settings - Fork 10
Esp32 c3 led pwm #8
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: esp32_pwm
Are you sure you want to change the base?
Esp32 c3 led pwm #8
Conversation
alexandruradovici
left a comment
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.
The next step is to implement the Pwm related trait.
chips/esp32-c3/src/led_pwm.rs
Outdated
|
|
||
| //functions regarding interrupts | ||
|
|
||
| pub fn handle_interrupt(&self) { |
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.
Do you need to handle interrupts? What is the purpose of interrupts?
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.
The same questions I've asked myself and haven't found answers yet. Thought they made the interrupt for a reason and it is imperative to handle them
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.
Please document that and post a link to the documentation text.
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.
|
Any updates here? |
|
The LED PWM clock frequency is based off the clock source used for the CPU and/or the CPU clock frequency. Should the "get_maximum_frequency_hz()" function from the Pwm hil return the maximum frequency achievable with any clock source or with the in-use clock source ? |
|
This needs to be the max freq that the PWM outputs. |
| interrupts::IRQ_LEDC => { | ||
| //handler is unimplemented yet | ||
| //not sure exactly what to do :) | ||
| self.led_pwm.handle_interrupt(); |
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.
What is the purpose of the PWM interrupt?
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.
It is triggered either when a timer counter overflows for a set number of times, when a fade has finished or when a timer counter has reached it's max value.
chips/esp32-c3/src/led_pwm.rs
Outdated
| //x used for timers, value between [0, 3] | ||
| //n used for pwm generators, value between [0, 5] |
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.
What is x?
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.
The following sections refer to the timers collectively as Timerx (where x ranges from 0 to 3). Likewise, the six PWM generators are also identical in features and operation, and thus are collectively referred to as PWMn (where n ranges from 0 to 5).
as seen in the official documentation
If it is a method, than the in-use clock source, if it is an associated function, than for any clock source (probably you have to receive the clock as a parameter). |
Pull Request Overview
This pull request adds partial Led Pwm support for the esp32-c3
Testing Strategy
This pull request was tested by me :)
TODO or Help Wanted
This pull request still needs Pwm generators implementation
Documentation Updated
/docs, or no updates are required.Formatting
make prepush.