EHS/include/ehs/io/UsbBase.h

48 lines
908 B
C
Raw Normal View History

2024-04-08 03:10:24 -07:00
#pragma once
#include "ehs/Types.h"
namespace ehs
{
2024-07-24 01:36:20 -07:00
class EHS_LIB_IO UsbBase
2024-04-08 03:10:24 -07:00
{
private:
UInt_32 bus;
UInt_32 address;
public:
virtual ~UsbBase() = default;
UsbBase();
UsbBase(UInt_32 bus, UInt_32 address);
UsbBase(UsbBase&& usb) noexcept;
UsbBase(const UsbBase& usb);
UsbBase& operator=(UsbBase&& usb) noexcept;
UsbBase& operator=(const UsbBase& usb);
virtual void Initialize() = 0;
virtual void Release() = 0;
virtual bool IsInitialized() const = 0;
virtual Size Send(const Byte* data, Size size) = 0;
void BulkSend(const Byte* data, Size size);
virtual Size Receive(Byte* data, Size size) = 0;
void BulkReceive(Byte** data, Size* size);
UInt_32 GetBus() const;
UInt_32 GetAddress() const;
bool IsValid() const;
};
}