Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some pinout support for Radxa Zero PWM #868

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

708yamaguchi
Copy link
Contributor

I add some pinout support for Radxa Zero PWM.

Below I share how I found the mapping between PWM chip and GPIO numbers.

  1. Check mapping between device file and GPIO number
$ sudo cat /sys/kernel/debug/pinctrl/ff800000.sys-ctrl:pinctrl@14-pinctrl-meson/pinmux-pins | grep pwm
pin 11 (GPIOAO_11): ff807000.pwm (GPIO UNCLAIMED) function pwm_ao_a group pwm_ao_a
  1. Find out the chip number corresponding to the device file
In [1]: from adafruit_blinka.microcontroller.alias import get_pwm_chipid

In [2]: get_pwm_chipid("ff807000.pwm")
Out[2]: 'PWM2'

In [3]: int(get_pwm_chipid("ff807000.pwm")[-1])
Out[3]: 2
  1. Add pinout mapping to pin.py
pwmOuts = (
    ((2, 0), GPIOAO_11),  # ((chip, channel), GPIO)
)

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Seems well reasoned to me. Thanks for sharing how you found it.

@makermelissa makermelissa merged commit 0a41814 into adafruit:main Jul 10, 2024
1 check 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