Skip to content

Conversation

@Uthedris
Copy link
Contributor

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.

1 participant