Drone.Adapters.Crazyflie.CRTP.Ports (ex_drone v0.3.0)

View Source

Documented CRTP port numbers for Crazyflie 2.x subsystems.

See the CRTP specification.

Examples

8 = Drone.Adapters.Crazyflie.CRTP.Ports.port(:setpoint_hl)
9 = Drone.Adapters.Crazyflie.CRTP.Ports.port(:supervisor)

Summary

Functions

Map of all known named ports.

Returns the CRTP port integer for a named subsystem.

Functions

all()

@spec all() :: %{required(atom()) => 0..15}

Map of all known named ports.

Returns

%{atom() => 0..15}.

Examples

ports = Drone.Adapters.Crazyflie.CRTP.Ports.all()
8 = ports.setpoint_hl
true = Map.has_key?(ports, :supervisor)

port(name)

@spec port(atom()) :: 0..15

Returns the CRTP port integer for a named subsystem.

Parameters

  • name (atom()) — one of the keys from all/0 (:setpoint_hl, :supervisor, :platform, :linkctrl, …)

Returns

0..15 port number.

Raises

FunctionClauseError when name is unknown.

Examples

13 = Drone.Adapters.Crazyflie.CRTP.Ports.port(:platform)