Go to the documentation of this file.
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);
#define ACCESSORY_STRING_DESCRIPTION
ADK(USB *pUsb, const char *manufacturer, const char *model, const char *description, const char *version, const char *uri, const char *serial)
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)
static const uint8_t epDataInIndex
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define ACCESSORY_STRING_URI
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
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 NotifyFailSetDevTblEntry(...)
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)
#define NotifyFailGetConfDescr(...)
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
#define NotifyFailGetDevDescr(...)
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
#define USB_NAK_MAX_POWER
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
EpInfo epInfo[ADK_MAX_ENDPOINTS]
#define bmUSB_TRANSFER_TYPE
#define ADK_MAX_ENDPOINTS
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval=0)
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
static const uint8_t epDataOutIndex
#define USB_ERROR_EPINFO_IS_NULL
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
#define ACCESSORY_STRING_MODEL
#define ACCESSORY_STRING_MANUFACTURER
#define ACCESSORY_STRING_VERSION
#define NotifyFailSetConfDescr(...)
virtual void FreeAddress(uint8_t addr)=0
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
#define ACCESSORY_STRING_SERIAL
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
#define USB_TRANSFER_TYPE_BULK
AddressPool & GetAddressPool()