Refactored some of the USB device (libusb wrapper) & interface code

This commit is contained in:
Nav
2021-04-07 23:30:01 +01:00
parent 8d6b09ec21
commit 509ff084cd
9 changed files with 133 additions and 165 deletions

View File

@@ -11,11 +11,14 @@ void AtmelIce::init() {
// TODO: Move away from hard-coding the CMSIS-DAP/EDBG interface number
auto& usbHidInterface = this->getEdbgInterface().getUsbHidInterface();
usbHidInterface.setNumber(0);
usbHidInterface.setUSBDevice(this->getLibUsbDevice());
usbHidInterface.setVendorId(this->getVendorId());
usbHidInterface.setProductId(this->getProductId());
usbHidInterface.setLibUsbDevice(this->libUsbDevice);
usbHidInterface.setLibUsbDeviceHandle(this->libUsbDeviceHandle);
usbHidInterface.setVendorId(this->vendorId);
usbHidInterface.setProductId(this->productId);
if (!usbHidInterface.isInitialised()) {
usbHidInterface.detachKernelDriver();
UsbDevice::setConfiguration(0);
usbHidInterface.init();
}

View File

@@ -11,9 +11,10 @@ void PowerDebugger::init() {
// TODO: Move away from hard-coding the CMSIS-DAP/EDBG interface number
auto& usbHidInterface = this->getEdbgInterface().getUsbHidInterface();
usbHidInterface.setNumber(0);
usbHidInterface.setUSBDevice(this->getLibUsbDevice());
usbHidInterface.setVendorId(this->getVendorId());
usbHidInterface.setProductId(this->getProductId());
usbHidInterface.setLibUsbDevice(this->libUsbDevice);
usbHidInterface.setLibUsbDeviceHandle(this->libUsbDeviceHandle);
usbHidInterface.setVendorId(this->vendorId);
usbHidInterface.setProductId(this->productId);
if (!usbHidInterface.isInitialised()) {
usbHidInterface.init();

View File

@@ -26,10 +26,7 @@ namespace Bloom::DebugToolDrivers
* as an Atmel Data Gateway Interface (DGI).
*
* Communication:
* Like the Atmel-ICE, using the Power Debugger device for AVR debugging/programming requires the AVR
* communication protocol, which is a sub-protocol of the CMSIS-DAP.
*
* For more information on the communication protocol, see the DebugToolDrivers::AtmelIce class.
* Uses the same EDBG protocol as described in the AtmelIce driver. See the AtmelIce debug tool class for more.
*
* USB Setup:
* Vendor ID: 0x03eb (1003)