27 const char* description,
33 manufacturer(manufacturer),
35 description(description),
60 return Init(parent, port, lowspeed);
64 uint8_t
ADK::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
111 goto FailGetDevDescr;
147 goto FailSetDevTblEntry;
153 USBTRACE(
"\r\nAcc.mode device detected");
155 num_of_conf = udd->bNumConfigurations;
158 for(uint8_t i = 0; i < num_of_conf; i++) {
165 USBTRACE2(
"\r\nGot 1st bad code for config: ", rcode);
171 goto FailGetConfDescr;
182 goto FailSetDevTblEntry;
189 goto FailSetConfDescr;
208 USBTRACE(
"\r\nConfiguration successful");
215 uint16_t adkproto = -1;
217 rcode = getProto((uint8_t*) & adkproto);
221 USBTRACE2(
"\r\nGot 1st bad code for proto: ", rcode);
223 rcode = getProto((uint8_t*) & adkproto);
229 USBTRACE2(
"\r\nADK protocol rev. ", adkproto);
261 #ifdef DEBUG_USB_HOST 267 #ifdef DEBUG_USB_HOST 273 #ifdef DEBUG_USB_HOST 279 #ifdef DEBUG_USB_HOST 285 #ifdef DEBUG_USB_HOST 291 #ifdef DEBUG_USB_HOST 301 #ifdef DEBUG_USB_HOST 302 USBTRACE(
"\r\nAccessory mode switch attempt");
360 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
370 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 bmUSB_TRANSFER_TYPE
#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, uint8_t bInterval=0)
AddressPool & GetAddressPool()
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
#define USB_TRANSFER_TYPE_BULK
#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