!drivers: separate pulse count from PWM driver#18916
Draft
raiden00pl wants to merge 14 commits into
Draft
Conversation
BREAKING CHANGE: separate pulse count feature from PWM driver. Coupling PWM driver with pulse count feature was bad decision from the beginning, these are two different things: - PWM is a modulation scheme: it continuously represents a value by varying duty cycle, usually at a fixed frequency. - Pulse train generation is a finite waveform transaction: generate N edges/pulses with selected timing, then complete. This change introduce a new pulse count driver with new API. Now user can generate pulse train by providing: - high pulse length in ns - low pulse length in ns - pulse count All architectures supporting pulse count have been adapted in subsequent commits. Users must migrate their code to use the new driver with new API. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
BREAKING CHANGE: separate pulse count from PWM driver Pulse count handling was removed from PWM driver and moved to a separate driver. For details about this change, look at previous commit. Signed-off-by: raiden00pl <raiden00@railab.me>
remove PULSECOUNT references from PWM drivers that not implemet PWM feature. PULSECOUNT for these architectures was not implemented, so we just remove all references to it. Signed-off-by: raiden00pl <raiden00@railab.me>
add pulse count example for nucleo-h743zi2 Signed-off-by: raiden00pl <raiden00@railab.me>
add pulse count example for nucleo-f446re Signed-off-by: raiden00pl <raiden00@railab.me>
add pulse count example for nucleo-c092rc Signed-off-by: raiden00pl <raiden00@railab.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BREAKING CHANGE: separate pulse count feature from PWM driver.
Coupling PWM driver with pulse count feature was bad decision from the beginning, these are two different things:
This change introduce a new pulse count driver with new API. Now user can generate pulse train by providing:
All architectures supporting pulse count have been modified.
Dependency-for: apache/nuttx-apps#3490.
Impact
Breaking change. Users must migrate their code to use the new driver with new API.
Testing
TODO: I can test on stm32 archs. All stm32 and at32 are based on the same stm32 driver. I'll add it later.
Help with tests would be useful for tivia and tlsr82 boards.
stm32c0 with PWM in background and pulse count train for 1 sec: