# Pwmx v0.1.0 - Table of Contents

> Pure Elixir library to interact with the sysfs interface to hardware PWM on Linux.

## Pages

- [Pwmx](readme.md)

## Modules

- [Pwmx](Pwmx.md): Pure Elixir library to interact with the sysfs interface to hardware PWM on Linux.
## Usage
### Fully manual
If you wish to just write and read to the sysfs Pwm interface, you can find path helpers in the
Pwmx.Paths module.
- [Pwmx.Backend](Pwmx.Backend.md): Backend GenServer, dispatching PWM calls either to the real sysfs interface
(`Pwmx.Backend.Sysfs`) on a Linux host that exposes `/sys/class`, or to an
in-memory simulation (`Pwmx.Backend.Virtual`) elsewhere.
- [Pwmx.Backend.Sysfs](Pwmx.Backend.Sysfs.md): Sysfs backend for Pwmx, used on the target.

- [Pwmx.Backend.Sysfs.Ops](Pwmx.Backend.Sysfs.Ops.md): Module performing the reads/writes on the sysfs paths. Separated from Pwmx.Backend.Sysfs so
you can use it directly if you wish, without going through the stateful ceremony.

- [Pwmx.Backend.Virtual](Pwmx.Backend.Virtual.md): Virtual backend for Pwmx, mainly used for tests & hosts.

- [Pwmx.Enumerator](Pwmx.Enumerator.md): Convenience module to enumerate *available* PWM outputs. The sysfs interface can report a number of
pwm pins, but it is not guaranteed that all of them will be able to be exported.

- [Pwmx.Output](Pwmx.Output.md): The main user-facing module: a GenServer that manages a single PWM output and
caches its state.
- [Pwmx.Paths](Pwmx.Paths.md): Path helpers for the Sysfs backend.

- [Pwmx.State](Pwmx.State.md): Struct keeping track of a PWM Output state. When developing on a non-linux box, or a linux box without PWM outputs, this struct is used instead of the sysfs calls. When running on the real board, this struct caches the values provided by the sysfs interface.

- [Pwmx.Utils](Pwmx.Utils.md): Utilities for type and units conversions.

