8 #include<libtransistor/cpp/types.hpp>
19 enum class State : uint32_t {
20 INITIAL = USB_DS_STATE_INITIAL,
21 INIT_STARTING = USB_DS_STATE_INIT_STARTING,
22 INIT2 = USB_DS_STATE_INIT2,
23 INIT3 = USB_DS_STATE_INIT3,
24 INITIALIZED = USB_DS_STATE_INITIALIZED,
32 static Result<DS> Initialize(uint32_t complex_id,
usb_device_data_t *device_data);
37 Result<KEvent> GetStateChangeEvent();
38 Result<State> GetState();
39 Result<std::shared_ptr<Interface>> GetInterface(usb_interface_descriptor_t &descriptor,
const char *name);
51 Result<std::nullopt_t> Enable();
52 Result<std::nullopt_t> Disable();
53 Result<std::shared_ptr<Endpoint>> GetEndpoint(usb_endpoint_descriptor_t &descriptor);
54 Result<std::shared_ptr<Endpoint>> GetCtrlInEndpoint();
55 Result<std::shared_ptr<Endpoint>> GetCtrlOutEndpoint();
56 Result<std::nullopt_t> StallCtrl();
68 virtual Result<uint32_t> PostBufferAsync(
void *buffer,
size_t size) = 0;
69 virtual Result<usb_ds_report_t> GetReportData() = 0;
70 virtual Result<std::nullopt_t> Stall() = 0;
Definition: usb_ds.hpp:47
Definition: types.hpp:126
Definition: interface.h:20
USB definitions (C++ header)
Definition: usb_ds.hpp:63
Definition: usb_ds.hpp:30