Update GPIO-examples.md

This commit is contained in:
Owen Carter 2024-09-20 13:44:40 +02:00 committed by GitHub
parent 4c768a13d2
commit 019cc1ccf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,8 +12,13 @@ Look at the great guide here: https://worldbeyondlinux.be/posts/gpio-on-the-mang
It does a better job of explaining this than I can do in a short guide. It does a better job of explaining this than I can do in a short guide.
## PWM ## PWM
**working**, There are eight PWM timers available and GPIO pins can be mapped to these in a custom device tree **working**: I have tested using a simple LED attached to a GPIO pin.
- *Note: `lgpio` provides a software (bit-bang) PWM solution that can be used on any free pin, and does not need a device tree modification. This may be a better solution for many projects.*
**Software PWM**: Does not need a device tree modification
`lgpio` provides a software (bit-bang) PWM solution that can be used on any free pin, and does not need a device tree modification.
**Hardware PWM**: There are eight hardware PWM timers available, these can be mapped to some of the pins on the GPIO connector.
The available hardware PWM mappings are somewhat limited, see the diagram in the main README to determine which pins on the GPIO connector can be used. The available hardware PWM mappings are somewhat limited, see the diagram in the main README to determine which pins on the GPIO connector can be used.
- The example below uses (legacy) `/sys/class` control, which in turn needs root access. PWM control from userland seems like a WIP for linux at present. - The example below uses (legacy) `/sys/class` control, which in turn needs root access. PWM control from userland seems like a WIP for linux at present.