22 #ifndef COSA_USB_API_H 23 #define COSA_USB_API_H 38 extern USBDevice_ USBDevice;
41 uint8_t bmRequestType;
49 int HID_GetInterface(uint8_t* interfaceNum);
50 int HID_GetDescriptor(
int i);
51 bool HID_Setup(Setup& setup);
52 void HID_SendReport(uint8_t
id,
const void* data,
int len);
54 int MSC_GetInterface(uint8_t* interfaceNum);
55 int MSC_GetDescriptor(
int i);
56 bool MSC_Setup(Setup& setup);
57 bool MSC_Data(uint8_t rx,uint8_t tx);
59 int CDC_GetInterface(uint8_t* interfaceNum);
60 int CDC_GetDescriptor(
int i);
61 bool CDC_Setup(Setup& setup);
63 #define TRANSFER_PGM 0x80 64 #define TRANSFER_RELEASE 0x40 65 #define TRANSFER_ZERO 0x20 67 int USB_SendControl(uint8_t flags,
const void* d,
int len);
68 int USB_RecvControl(
void* d,
int len);
70 uint8_t USB_Available(uint8_t ep);
71 int USB_Send(uint8_t ep,
const void* data,
int len);
72 int USB_Recv(uint8_t ep,
void* data,
int len);
73 int USB_Recv(uint8_t ep);
74 void USB_Flush(uint8_t ep);