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

Sys pwm #127

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Sys pwm #127

wants to merge 3 commits into from

Conversation

curuvar
Copy link
Contributor

@curuvar curuvar commented Nov 28, 2021

What's in this pull request?

Added a new file (SysPWM.swift) that supports PWM using the Raspberry Pi's pwm dtoverlay.

Is there something you want to discuss?

Please feel free to use this as is or modify as needed.

This PWM class uses the sysfs PWM interface created by loading the pwm or pwm-2chan dtoverlays supplied with Raspberry Pi OS. It has two benefits over the current PWM: it does not require the program to be run as root (as it does not access /dev/mem), and it can drive both PWM channels at the same time.

Pull Request Checklist

  • I've added the default copyright header to every new file.
  • Every new file has been correctly indented, no tabs, 4 spaces (you can use swiftlint).
  • Verify that you only import what's necessary, this reduces compilation time.
  • Try to declare the type of every variable and constant, not using type inference greatly reduces compilation time.
  • Verify that your code compiles with the currently supported Swift version (currently 4.1.3)
  • You've read the contribution guidelines.

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.

None yet

1 participant