1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-25 18:15:39 +00:00
sys-con/ControllerUSB/include/IUSBInterface.h
2019-10-31 21:00:42 +03:00

31 lines
846 B
C++

#pragma once
#include "Status.h"
#include "IUSBEndpoint.h"
#include <memory>
class IUSBInterface
{
protected:
public:
struct InterfaceDescriptor
{
uint8_t bLength;
uint8_t bDescriptorType; ///< Must match USB_DT_INTERFACE.
uint8_t bInterfaceNumber; ///< See also USBDS_DEFAULT_InterfaceNumber.
uint8_t bAlternateSetting; ///< Must match 0.
uint8_t bNumEndpoints;
uint8_t bInterfaceClass;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
uint8_t iInterface; ///< Ignored.
};
virtual ~IUSBInterface() = default;
virtual Status Open() = 0;
virtual void Close() = 0;
virtual IUSBEndpoint *GetEndpoint(IUSBEndpoint::Direction direction, uint8_t index);
virtual InterfaceDescriptor *GetDescriptor();
virtual Status Reset() = 0;
};