27 const char* description,
34 manufacturer(manufacturer),
36 description(description),
62 return Init(parent, port, lowspeed);
66 uint8_t
ADK::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
113 goto FailGetDevDescr;
148 goto FailSetDevTblEntry;
154 USBTRACE(
"\r\nAcc.mode device detected");
160 for (uint8_t i = 0; i < num_of_conf; i++) {
164 goto FailGetConfDescr;
175 goto FailSetDevTblEntry;
184 goto FailSetConfDescr;
201 USBTRACE(
"\r\nConfiguration successful");
208 uint16_t adkproto = -1;
209 rcode = getProto((uint8_t*) & adkproto);
213 USBTRACE2(
"\r\nADK protocol rev. ", adkproto);
236 #ifdef DEBUG_USB_HOST
242 #ifdef DEBUG_USB_HOST
248 #ifdef DEBUG_USB_HOST
254 #ifdef DEBUG_USB_HOST
260 #ifdef DEBUG_USB_HOST
266 #ifdef DEBUG_USB_HOST
272 #ifdef DEBUG_USB_HOST
273 USBTRACE(
"\r\nAccessory mode switch attempt");
336 Notify(PSTR(
"Endpoint descriptor:"), 0x80);
337 Notify(PSTR(
"\r\nLength:\t\t"), 0x80);
338 PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
339 Notify(PSTR(
"\r\nType:\t\t"), 0x80);
341 Notify(PSTR(
"\r\nAddress:\t"), 0x80);
343 Notify(PSTR(
"\r\nAttributes:\t"), 0x80);
345 Notify(PSTR(
"\r\nMaxPktSize:\t"), 0x80);
347 Notify(PSTR(
"\r\nPoll Intrv:\t"), 0x80);
348 PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
349 Notify(PSTR(
"\r\n"), 0x80);
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
#define ACCESSORY_STRING_MODEL
static const uint8_t epDataInIndex
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
#define USB_ERROR_EPINFO_IS_NULL
virtual uint8_t Release()
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
#define ACCESSORY_STRING_URI
#define ACCESSORY_STRING_MANUFACTURER
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
#define NotifyFailGetDevDescr(...)
static const uint8_t epDataOutIndex
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
virtual void FreeAddress(uint8_t addr)=0
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
#define NotifyFailGetConfDescr(...)
#define USB_NAK_MAX_POWER
#define ACCESSORY_STRING_SERIAL
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
#define ACCESSORY_STRING_VERSION
ADK(USB *pUsb, const char *manufacturer, const char *model, const char *description, const char *version, const char *uri, const char *serial)
EpInfo epInfo[ADK_MAX_ENDPOINTS]
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
#define ADK_MAX_ENDPOINTS
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
AddressPool & GetAddressPool()
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
#define ACCESSORY_STRING_DESCRIPTION
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
#define NotifyFailSetConfDescr(...)
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
#define NotifyFailSetDevTblEntry(...)
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET