periph icon indicating copy to clipboard operation
periph copied to clipboard

sysfs-gpio: expose pins found in /sys/class/pwm and reconcile with gpio

Open chmorgan opened this issue 6 years ago • 9 comments

I may intend to submit a pull request to add this support but I'm currently using gobot for pwm support.

chmorgan avatar Dec 20 '18 02:12 chmorgan

Can you expand on what you mean exactly?

maruel avatar Dec 20 '18 02:12 maruel

It looks like hardware PWM support isn't provided via sysfs:

https://github.com/google/periph/blob/master/host/sysfs/gpio.go#L307

chmorgan avatar Dec 20 '18 02:12 chmorgan

Do you ask about using /sys/class/pwm/ or something else?

maruel avatar Dec 20 '18 02:12 maruel

Hi @maruel, yep, isn't /sys/xxx sysfs or am I confused there?

chmorgan avatar Dec 20 '18 02:12 chmorgan

What kind of board are you looking for to leverage native PWM on?

maruel avatar Dec 20 '18 02:12 maruel

Hi @maruel, in this csae an Omega2+ board.

I apologize if the support is already present, I combed the codebase, searched etc but I'm still a bit new to sysfs with PWM. I wouldn't want to waste anyones time.

chmorgan avatar Dec 20 '18 02:12 chmorgan

I see http://blog.oddbit.com/2017/09/26/some-notes-on-pwm-on-the-raspberry-pi/

I hadn't realize that newer kernels exposed it. That looks totally doable.

maruel avatar Dec 20 '18 02:12 maruel

Independent of Omega or RPi, this is doable, just need someone to add the enumeration and reconciliation with the GPIO pin numbers.

maruel avatar Dec 20 '18 02:12 maruel

@maruel yep, I was thinking it would be relatively transparent with respect to the hardware itself. I'm not at the point with periph that I could help contributing anything here yet.

chmorgan avatar Dec 20 '18 02:12 chmorgan

Ported to https://github.com/periph/host/issues/40.

maruel avatar Sep 20 '23 17:09 maruel