Pwm driver#6
Open
bebenlebricolo wants to merge 51 commits into
Open
Conversation
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
…ig time Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
…hing Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Owner
Author
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
… #warnings) Signed-off-by: bebenlebricolo <benoittarrade@hotmail.fr>
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.
Rationale about Driver/Module distinction
Implementing PWM driver/module. I find it difficult to distinguish between driver/module because to me the concept of a module relies on the fact that it does not directly interact with hardware peripheral, but rather uses drivers to achieve higher level functionalities.
The PWM module fits this description, as it does not interact with hardware peripherals directly but builds on top of hardware Timer's drivers and Timebase Module (which also wraps up hardware timer functionalities).
However, the level of detail of this PWM Module makes me think that in terms of pure functionality, it mostly appears as a driver, due to its intrinsic complexity.
What this driver / module is all about
Software based PWM, with customizable event generation (events still need to be implemented)
PWM driver provides the ability to synthesize PWM signals either using pure software resources or hardware resources instead.
Software generated PWMs are very well suited for low frequencies signals, and I plan to implement software events generation (user-customizable callbacks) which can be used in the software to perform very specific tasks while retaining the asynchronous aspect of the driver.
Hardware based PWMs, highly accurate PWM generation mode
On the other hand, the hardware handling (which is by far the trickiest) allows to easily configure a hardware timer, in order to achieve both frequency and / or duty cycle using full hardware capabilities of the timers themselves.
Hardware PWMs are, by design, very well suited for high frequencies applications where frequency and duty cycle accuracy are a priority.
Note that because Avr timers are quite limited by design, some limitations are to be expected.
For instance, 8 bit timer families can either achieve desired frequency, or duty cycle but not for each channel at the same time.
This can be achieved if we don't mind sacrificing the 'A' channel, in order to exploit the full time's potential for Channel B.