API Reference Pwmx v#0.1.0

Copy Markdown View Source

Modules

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

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.

Sysfs backend for Pwmx, used on the target.

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.

Virtual backend for Pwmx, mainly used for tests & hosts.

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.

The main user-facing module: a GenServer that manages a single PWM output and caches its state.

Path helpers for the Sysfs backend.

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.

Utilities for type and units conversions.