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.
Summary
Functions
Sets the chip field to a binary value.
Sets the duty_cycle field to an integer value.
Sets the enabled field to a boolean value.
Sets the exported field to true.
Sets the inverted field to true.
Sets the inverted field to false.
Sets the output field to an integer value.
Sets the period field to an integer value.
Sets the exported field to false.
Types
Functions
Sets the chip field to a binary value.
iex> %{chip: "virtualchip0"} = (%Pwmx.State{} |> Pwmx.State.set_chip("virtualchip0"))
Sets the duty_cycle field to an integer value.
iex> %{duty_cycle: 1000} = (%Pwmx.State{} |> Pwmx.State.set_duty_cycle(1000))
Sets the enabled field to a boolean value.
iex> %{enabled: false} = (%Pwmx.State{} |> Pwmx.State.set_enabled(false))
Sets the exported field to true.
iex> %{exported: true} = (%Pwmx.State{} |> Pwmx.State.set_exported())
Sets the inverted field to true.
iex> %{inverted: true} = (%Pwmx.State{} |> Pwmx.State.set_inverted())
Sets the inverted field to false.
iex> %{inverted: false} = (%Pwmx.State{} |> Pwmx.State.set_not_inverted())
Sets the output field to an integer value.
iex> %{output: 1} = (%Pwmx.State{} |> Pwmx.State.set_output(1))
Sets the period field to an integer value.
iex> %{period: 1000} = (%Pwmx.State{} |> Pwmx.State.set_period(1000))
Sets the exported field to false.
iex> %{exported: false} = (%Pwmx.State{} |> Pwmx.State.set_unexported())