zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
43 stars 11 forks source link

zephyrCommon: Implement analogWrite() #56

Closed soburi closed 1 year ago

soburi commented 1 year ago

The 'pwms' node under the 'zephyr,user' defines available PWM channels.

The 'pwm-pins' defines the mapping of PWM channels to pin numbers. API looks up the 'pwm-pins' when querying the PWM channel by digital pin number. So it should be in the same order as 'pwms' node.

PWM channels should configure and tied to the output pins. The period property of the PWM channel is used as resolution as PWM. For original Arduino API compatibility, it should be 255. The period property and API argument determines the duty ratio.


I verified this PR with mkrzero and nano_33_ble. Some pins of the mkrzero seem not to work correctly. Only verified configuration only enableed.

DhruvaG2000 commented 1 year ago

I thought I would have rebase access, but seems like I can't squash commits, please can you squash my last commit in previous one? Also rebase on top of main please. Thank you

soburi commented 1 year ago

I thought I would have rebase access, but seems like I can't squash commits, please can you squash my last commit in previous one? Also rebase on top of main please. Thank you

squash and update done.