This is a Kotlin library allowing you to communicate with MCP2221 and MCP2221A devices over USB. It supports all of the operations described in the data sheet.
import mcp2221.MCP2221Device
import mcp2221.commands.ResetCommand
fun resetDevice() {
val device = MCP2221Device(".*MCP2221.*")
// Device is now opened and ready to use.
device.reset()
// or alternatively:
device.sendCommand(ResetCommand())
// Output:
// Device reset.
}
- improve testing
- improve error handling
- add listener functionality to observe GPIO statuses
- create GUI similar to the utility tool by MicroChip
The code is based on this .NET implementation by DerekGn.
cf. LICENSE