This commit is contained in:
2025-05-13 00:37:35 +03:00
parent c2ebc2046b
commit 3f693566bd
437 changed files with 423694 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "Usb.h"
#include <LFramework/Debug.h>
#include <LFramework/Threading/Thread.h>
Usb::Usb(){
usbInterface = new LFramework::USB::UsbDBulkInterface();
usbContext = new LFramework::USB::UsbDDeviceContext(usbInterface);
usbContext->configurationStringDescriptor = "LFramework";
usbContext->interfaceStringDescriptor = "LFramework";
usbContext->productStringDescriptor = "LFramework test device";
usbContext->manufacturerStringDescriptor = "L";
usbContext->serialStringDescriptor = "123456";
LFramework::USB::UsbDevice::start(usbContext);
lfDebug() << "USB started: waiting for interface open...";
auto usbInterface = usbContext->getInterface(0);
while(!usbInterface->isOpen()){
LFramework::Threading::ThisThread::sleepForMs(1);
}
lfDebug() << "USB interface is open!";
}
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <LFramework/USB/Device/USBDevice.h>
#include <LFramework/USB/Device/UsbDBulkInterface.h>
#include <LFramework/USB/Device/UsbDDeviceContext.h>
class Usb {
public:
Usb();
LFramework::USB::UsbDBulkInterface* usbInterface = nullptr;
LFramework::USB::UsbDDeviceContext* usbContext = nullptr;
};