Pigpiox v0.1.2 Pigpiox.Waveform View Source

Build and send waveforms with pigpiod.

Link to this section Summary

Types

A pulse used in constructing a waveform. Specifies the GPIO that should be turned on, the GPIO that should be turned off, and the delay before the next pulse

Functions

Adds a list of pulses to the current waveform

Returns whether or not a waveform is currently being transmitted

Clears all waveforms and any data added

Creates a waveform based on previous calls to add_...

Returns the id of the currently transmitted waveform

Deletes a previously added waveform

Returns the length in DMA control blocks of the current waveform

Returns the maximum possible size of a waveform in DMA control blocks

Returns the maximum possible size of a waveform in microseconds

Returns the maximum possible size of a waveform in pulses

Returns the length in microseconds of the current waveform

Returns the length in pulses of the current waveform

Starts a repeating waveform, by its id

Sends a waveform once, by its id

Stops a waveform that is currently being transmitted

Link to this section Types

Link to this type pulse() View Source
pulse() :: %Pigpiox.Waveform.Pulse{delay: term, gpio_off: term, gpio_on: term}

A pulse used in constructing a waveform. Specifies the GPIO that should be turned on, the GPIO that should be turned off, and the delay before the next pulse.

At least one field is required to be set.

Link to this section Functions

Link to this function add_generic(pulses) View Source
add_generic(pulses :: [pulse]) ::
  {:ok, non_neg_integer} |
  {:error, atom}

Adds a list of pulses to the current waveform

Returns the new total number of pulses in the waveform or an error.

Link to this function busy?() View Source
busy?() :: {:ok, boolean} | {:error, atom}

Returns whether or not a waveform is currently being transmitted.

Link to this function clear_all() View Source
clear_all() :: :ok | {:error, atom}

Clears all waveforms and any data added.

Link to this function create() View Source
create() :: {:ok, non_neg_integer} | {:error, atom}

Creates a waveform based on previous calls to add_...

Returns the id of the newly created waveform or an error

Link to this function current() View Source
current() :: {:ok, non_neg_integer} | {:error, atom}

Returns the id of the currently transmitted waveform.

Link to this function delete(wave_id) View Source
delete(non_neg_integer) :: :ok | {:error, atom}

Deletes a previously added waveform.

Link to this function get_cbs() View Source
get_cbs() :: {:ok, non_neg_integer} | {:error, atom}

Returns the length in DMA control blocks of the current waveform.

Link to this function get_max_cbs() View Source
get_max_cbs() :: {:ok, non_neg_integer} | {:error, atom}

Returns the maximum possible size of a waveform in DMA control blocks.

Link to this function get_max_micros() View Source
get_max_micros() :: {:ok, non_neg_integer} | {:error, atom}

Returns the maximum possible size of a waveform in microseconds.

Link to this function get_max_pulses() View Source
get_max_pulses() :: {:ok, non_neg_integer} | {:error, atom}

Returns the maximum possible size of a waveform in pulses.

Link to this function get_micros() View Source
get_micros() :: {:ok, non_neg_integer} | {:error, atom}

Returns the length in microseconds of the current waveform.

Link to this function get_pulses() View Source
get_pulses() :: {:ok, non_neg_integer} | {:error, atom}

Returns the length in pulses of the current waveform.

Link to this function repeat(wave_id) View Source
repeat(non_neg_integer) ::
  {:ok, non_neg_integer} |
  {:error, atom}

Starts a repeating waveform, by its id.

Returns the number of DMA control blocks used in the waveform.

Link to this function send(wave_id) View Source
send(non_neg_integer) :: {:ok, non_neg_integer} | {:error, atom}

Sends a waveform once, by its id.

Returns the number of DMA control blocks used in the waveform.

Link to this function stop() View Source
stop() :: :ok | {:error, atom}

Stops a waveform that is currently being transmitted.