# `Nanodrop.Device`

USB device management for NanoDrop spectrophotometers.

Handles device enumeration, connection, and low-level USB communication
using the Ocean Optics USB2000 endpoints.

# `device_info`

```elixir
@type device_info() :: %{
  vendor_id: non_neg_integer(),
  product_id: non_neg_integer(),
  bus: non_neg_integer(),
  address: non_neg_integer(),
  device_ref: reference()
}
```

# `t`

```elixir
@type t() :: %Nanodrop.Device{device_info: device_info(), handle: reference()}
```

# `close`

```elixir
@spec close(t()) :: :ok
```

Closes a device connection.

# `list_devices`

```elixir
@spec list_devices() :: [device_info()]
```

Lists all connected NanoDrop/USB2000 devices.

# `open`

```elixir
@spec open(device_info() | nil) :: {:ok, t()} | {:error, term()}
```

Opens a connection to a NanoDrop device.

# `read_query`

```elixir
@spec read_query(t(), non_neg_integer()) :: {:ok, binary()} | {:error, term()}
```

Reads query response from the device (bulk transfer in on EP 0x87).

# `read_spectrum`

```elixir
@spec read_spectrum(t(), non_neg_integer()) :: {:ok, binary()} | {:error, term()}
```

Reads spectrum data from the device (bulk transfer in on EP 0x82).

# `send_command`

```elixir
@spec send_command(t(), binary()) :: :ok | {:error, term()}
```

Sends a command to the device (bulk transfer out).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
