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) {
110 goto FailGetDevDescr;
146 goto FailSetDevTblEntry;
152 USBTRACE(
"\r\nAcc.mode device detected");
154 num_of_conf = udd->bNumConfigurations;
157 for(uint8_t i = 0; i < num_of_conf; i++) {
164 USBTRACE2(
"\r\nGot 1st bad code for config: ", rcode);
170 goto FailGetConfDescr;
181 goto FailSetDevTblEntry;
188 goto FailSetConfDescr;
207 USBTRACE(
"\r\nConfiguration successful");
214 uint16_t adkproto = -1;
216 rcode = getProto((uint8_t*) & adkproto);
220 USBTRACE2(
"\r\nGot 1st bad code for proto: ", rcode);
222 rcode = getProto((uint8_t*) & adkproto);
228 USBTRACE2(
"\r\nADK protocol rev. ", adkproto);
260 #ifdef DEBUG_USB_HOST
266 #ifdef DEBUG_USB_HOST
272 #ifdef DEBUG_USB_HOST
278 #ifdef DEBUG_USB_HOST
284 #ifdef DEBUG_USB_HOST
290 #ifdef DEBUG_USB_HOST
300 #ifdef DEBUG_USB_HOST
301 USBTRACE(
"\r\nAccessory mode switch attempt");
359 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
369 D_PrintHex<uint8_t > (ep_ptr->
bInterval, 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
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
#define ACCESSORY_STRING_URI
#define ACCESSORY_STRING_MANUFACTURER
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)
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()
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