Skip to content

Is there any way to talk to two seperate MCP2221 chips at the same time? #11

Answered by smdn
MPstatus asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the question.

You can choose the target MCP2221 from multiple HID devices by specifying the findDevicePredicate argument of MCP2221.OpenAsync.
In this way, you can handle multiple MCP2221s separately.

More specifically, the code would be as follows.

// Select an HID device that contains the string "device-1" in its DevicePath.
await using var device1 = await MCP2221.OpenAsync(
  findDevicePredicate: hidDevice => hidDevice.DevicePath.Contains("device-1")
);

// Select an HID device that contains the string "device-2" in its DevicePath.
await using var device2 = await MCP2221.OpenAsync(
  findDevicePredicate: hidDevice => hidDevice.DevicePath.Contains("device-2")
);

The DevicePath

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MPstatus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants