Expand PWM support from 3 to 5 simultaneous channels#157
Open
gregmatthewcrossley wants to merge 1 commit intoSiliconLabs:mainfrom
Open
Expand PWM support from 3 to 5 simultaneous channels#157gregmatthewcrossley wants to merge 1 commit intoSiliconLabs:mainfrom
gregmatthewcrossley wants to merge 1 commit intoSiliconLabs:mainfrom
Conversation
This commit expands the PWM driver to support 5 simultaneous PWM channels (up from 3), utilizing both TIMER0 and TIMER1 hardware peripherals. Changes: - Increased max_pwm_channels from 3 to 5 in pwm.h - Implemented 2-timer allocation strategy in pwm.cpp: * Channels 0-2 use TIMER0 (CC0, CC1, CC2) * Channels 3-4 use TIMER1 (CC0, CC1) - Added helper methods get_timer_for_channel() and get_cc_channel_for_pwm_channel() - All channels share the same frequency (GSDK constraint) with independent duty cycles - Updated test_sketch.ino to test all 5 PWM channels - Added pwm_multi_channel example demonstrating 5-channel usage Hardware tested on Arduino Nano Matter (EFR32xG24) with oscilloscope verification of 4 channels (the limit of my oscilloscope) operating simultaneously with different duty cycles. All 28 automated build tests pass.
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.
This commit expands the PWM driver to support 5 simultaneous PWM channels (up from 3), utilizing both TIMER0 and TIMER1 hardware peripherals.
Changes:
Hardware tested on Arduino Nano Matter (EFR32xG24) with oscilloscope verification of 4 channels (the limit of my oscilloscope) operating simultaneously with different duty cycles.
All 28 automated build tests pass.
