27 const char* description,
33 manufacturer(manufacturer),
35 description(description),
59 return Init(parent, port, lowspeed);
63 uint8_t
ADK::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
109 goto FailGetDevDescr;
145 goto FailSetDevTblEntry;
151 USBTRACE(
"\r\nAcc.mode device detected");
156 for (uint8_t i = 0; i < num_of_conf; i++) {
163 USBTRACE2(
"\r\nGot 1st bad code for config: ", rcode);
169 goto FailGetConfDescr;
180 goto FailSetDevTblEntry;
187 goto FailSetConfDescr;
206 USBTRACE(
"\r\nConfiguration successful");
213 uint16_t adkproto = -1;
215 rcode = getProto((uint8_t*) & adkproto);
219 USBTRACE2(
"\r\nGot 1st bad code for proto: ", rcode);
221 rcode = getProto((uint8_t*) & adkproto);
227 USBTRACE2(
"\r\nADK protocol rev. ", adkproto);
250 #ifdef DEBUG_USB_HOST
256 #ifdef DEBUG_USB_HOST
262 #ifdef DEBUG_USB_HOST
268 #ifdef DEBUG_USB_HOST
274 #ifdef DEBUG_USB_HOST
280 #ifdef DEBUG_USB_HOST
286 #ifdef DEBUG_USB_HOST
287 USBTRACE(
"\r\nAccessory mode switch attempt");
346 Notify(PSTR(
"Endpoint descriptor:"), 0x80);
347 Notify(PSTR(
"\r\nLength:\t\t"), 0x80);
348 PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
349 Notify(PSTR(
"\r\nType:\t\t"), 0x80);
351 Notify(PSTR(
"\r\nAddress:\t"), 0x80);
353 Notify(PSTR(
"\r\nAttributes:\t"), 0x80);
355 Notify(PSTR(
"\r\nMaxPktSize:\t"), 0x80);
357 Notify(PSTR(
"\r\nPoll Intrv:\t"), 0x80);
358 PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
359 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