diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-02 20:05:28 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-02 20:05:28 +0000 |
commit | 1790044dc64c1edd78db07c19c910fa9fd794f9c (patch) | |
tree | 6e834dfe12f90f21e7907c6b1e519a28399e3438 /nuttx/include | |
parent | c9cd8b75048e6a0b8b41ece1da572b032aba67c7 (diff) | |
download | px4-nuttx-1790044dc64c1edd78db07c19c910fa9fd794f9c.tar.gz px4-nuttx-1790044dc64c1edd78db07c19c910fa9fd794f9c.tar.bz2 px4-nuttx-1790044dc64c1edd78db07c19c910fa9fd794f9c.zip |
FunctionAddress no longer hard-coded
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3231 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/usb/usbhost.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h index 9d7919839..2f02056f6 100644 --- a/nuttx/include/nuttx/usb/usbhost.h +++ b/nuttx/include/nuttx/usb/usbhost.h @@ -106,6 +106,8 @@ * class - The USB host class entry previously obtained from a call to create(). * configdesc - A pointer to a uint8_t buffer container the configuration descripor. * desclen - The length in bytes of the configuration descriptor. + * funcaddr - The USB address of the function containing the endpoint that EP0 + * controls * * Returned Values: * On success, zero (OK) is returned. On a failure, a negated errno value is @@ -118,7 +120,8 @@ * ************************************************************************************/ -#define CLASS_CONNECT(class,configdesc,desclen) ((class)->connect(class,configdesc,desclen)) +#define CLASS_CONNECT(class,configdesc,desclen,funcaddr) \ + ((class)->connect(class,configdesc,desclen, funcaddr)) /************************************************************************************ * Name: CLASS_DISCONNECTED @@ -430,7 +433,8 @@ struct usbhost_class_s * initialize properly (such as endpoint selections). */ - int (*connect)(FAR struct usbhost_class_s *class, FAR const uint8_t *configdesc, int desclen); + int (*connect)(FAR struct usbhost_class_s *class, FAR const uint8_t *configdesc, + int desclen, uint8_t funcaddr); /* This method informs the class that the USB device has been disconnected. */ @@ -521,9 +525,11 @@ struct usbhost_driver_s struct usbhost_epdesc_s { - uint8_t addr; /* Endpoint address */ - bool in; /* Direction: TRUE = IN */ - uint8_t funcaddr; /* USB address of function containing endpoint */ + uint8_t addr : 4; /* Endpoint address */ + uint8_t pad1 : 3; + uint8_t in : 1; /* Direction: 1->IN */ + uint8_t funcaddr : 7; /* USB address of function containing endpoint */ + uint8_t pad2 : 1; uint16_t mxpacketsize; /* Max packetsize */ }; @@ -653,6 +659,8 @@ EXTERN FAR struct usbhost_driver_s *usbhost_initialize(int controller); * Input Parameters: * drvr - The USB host driver instance obtained as a parameter from the call to * the class create() method. + * funcaddr - The USB address of the function containing the endpoint that EP0 + * controls * class - If the class driver for the device is successful located * and bound to the driver, the allocated class instance is returned into * this caller-provided memory location. @@ -669,6 +677,7 @@ EXTERN FAR struct usbhost_driver_s *usbhost_initialize(int controller); *******************************************************************************/ EXTERN int usbhost_enumerate(FAR struct usbhost_driver_s *drvr, + uint8_t funcaddr, FAR struct usbhost_class_s **class); #undef EXTERN |