   @doc """
   Perform a SPI transfer. The `data` should be a binary containing the bytes to
   send. Since SPI transfers simultaneously send and receive, the return value
-  will be a binary of the same length.
+  will be a binary of the same length or an error.
   """
   @spec transfer(pid, binary) :: binary | {:error, term}
   def transfer(pid, data) do

  end

  def handle_call({:transfer, data}, _from, state) do
    {:ok, response} = call_port(state, :transfer, data)
    {:reply, response, state}
  end



    receive do
      {_, {:data, response}} ->
        :erlang.binary_to_term(response)
    after
      500 -> {:error, :timeout}
    end
  end
end
