Skip to content

Conversation

@cvpines
Copy link
Contributor

@cvpines cvpines commented May 5, 2025

Adds hardware PWM support to libDaisy.

Introduces the PWMHandle class that provides up to 4 channels of PWM output per timer peripheral.
Also includes a small demo project showing how to use the class.

This API has been extensively tested on the Daisy Seed and shown to work for every supported timer and channel.

Minimal example:

PWMHandle pwm_tim3;
pwm_tim3.Init({PWMHandle::Config::Peripheral::TIM_3});
pwm_tim3.Channel1().Init({seed::D19});
pwm_tim3.Channel1().Set(0.75f);

@cvpines
Copy link
Contributor Author

cvpines commented May 5, 2025

Review very much welcomed! 🙂

@stephenhensley
Copy link
Collaborator

Thank you for the contribution! This has been a much needed feature since libDaisy came into being.

I'll carve out some time to do a full review next week, but at a glance it looks great! Conforms to typical libDaisy conventions, and has a straightforward API for usage.

@github-actions
Copy link

github-actions bot commented May 9, 2025

Test Results

150 tests  ±0   150 ✅ ±0   0s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit cde6250. ± Comparison against base commit f7c63ae.

♻️ This comment has been updated with latest results.

@stephenhensley
Copy link
Collaborator

This looks great, and works great!
Did a little bit of testing, and looks good to me!

I saw a few more changes come in last night, @cvpines anything else you want to do before we merge this in?

@cvpines
Copy link
Contributor Author

cvpines commented May 20, 2025

Good on my end!

@stephenhensley
Copy link
Collaborator

Awesome, thanks again for the awesome PR!

@stephenhensley stephenhensley merged commit fecdd5f into electro-smith:master May 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants