farmbot v6.0.1-alpha Farmbot.Firmware.Handler behaviour View Source

Any module that implements this behaviour should be a GenStage.

The implementng stage should communicate with the various Farmbot hardware such as motors and encoders. The Farmbot.Firmware module will subscribe_to: the implementing handler. Events should be Gcodes as parsed by Farmbot.Firmware.Gcode.Parser.

Link to this section Summary

Callbacks

Calibrate an axis

Lock the firmware

Unlock the firmware

Find home on an axis

Move to a position

Start a firmware handler

Manually set an axis’s current position to zero

Link to this section Types

Link to this type fw_ret_val() View Source
fw_ret_val() :: :ok | {:error, term}
Link to this type handler() View Source
handler() :: pid

Pin

Link to this type pin_mode() View Source
pin_mode() :: :digital | :analog

Mode of a pin.

Link to this section Callbacks

Link to this callback calibrate(handler, axis) View Source
calibrate(handler, axis) :: fw_ret_val

Calibrate an axis.

Link to this callback emergency_lock(handler) View Source
emergency_lock(handler) :: fw_ret_val

Lock the firmware.

Link to this callback emergency_unlock(handler) View Source
emergency_unlock(handler) :: fw_ret_val

Unlock the firmware.

Link to this callback find_home(handler, axis) View Source
find_home(handler, axis) :: fw_ret_val

Find home on an axis.

Link to this callback move_absolute(handler, vec3) View Source
move_absolute(handler, vec3) :: fw_ret_val

Move to a position.

Link to this callback read_param(handler, fw_param) View Source
read_param(handler, fw_param) ::
  {:ok, number} |
  {:error, term}

Read a paramater.

Link to this callback read_pin(handler, pin, pin_mode) View Source
read_pin(handler, pin, pin_mode) ::
  {:ok, number} |
  {:error, term}

Read a pin.

Link to this callback start_link() View Source
start_link() :: {:ok, handler}

Start a firmware handler.

Link to this callback update_param(handler, fw_param, number) View Source
update_param(handler, fw_param, number) :: fw_ret_val

Update a paramater.

Link to this callback write_pin(handler, pin, pin_mode, number) View Source
write_pin(handler, pin, pin_mode, number) :: fw_ret_val

Write a pin.

Manually set an axis’s current position to zero.