The main user-facing module: a GenServer that manages a single PWM output and caches its state.
By default it talks to the application-supervised Pwmx.Backend. Pass a
:backend option to bind it to a specific backend instance instead, this is
how you drive an isolated virtual board in tests:
{:ok, backend} = Pwmx.Backend.start_link(name: :my_board, mode: :virtual)
{:ok, pid} = Pwmx.Output.start_link({"virtualchip0", 1}, backend: backend)The setters cache the value they write rather than reading it back from the
backend, the achievable value by the driver can differ. Call get_period/1
or get_duty_cycle/1 to re-read if you need the actual timing.
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Callback implementation for GenServer.init/1.