Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 5:3f93dd1d4cb3 1 /* Copyright (c) 2010-2012 mbed.org, MIT License
sam_grove 5:3f93dd1d4cb3 2 *
sam_grove 5:3f93dd1d4cb3 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
sam_grove 5:3f93dd1d4cb3 4 * and associated documentation files (the "Software"), to deal in the Software without
sam_grove 5:3f93dd1d4cb3 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
sam_grove 5:3f93dd1d4cb3 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
sam_grove 5:3f93dd1d4cb3 7 * Software is furnished to do so, subject to the following conditions:
sam_grove 5:3f93dd1d4cb3 8 *
sam_grove 5:3f93dd1d4cb3 9 * The above copyright notice and this permission notice shall be included in all copies or
sam_grove 5:3f93dd1d4cb3 10 * substantial portions of the Software.
sam_grove 5:3f93dd1d4cb3 11 *
sam_grove 5:3f93dd1d4cb3 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
sam_grove 5:3f93dd1d4cb3 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
sam_grove 5:3f93dd1d4cb3 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
sam_grove 5:3f93dd1d4cb3 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
sam_grove 5:3f93dd1d4cb3 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sam_grove 5:3f93dd1d4cb3 17 */
sam_grove 5:3f93dd1d4cb3 18
sam_grove 5:3f93dd1d4cb3 19 #ifndef USBHOST_H
sam_grove 5:3f93dd1d4cb3 20 #define USBHOST_H
sam_grove 5:3f93dd1d4cb3 21
sam_grove 5:3f93dd1d4cb3 22 #include "USBHALHost.h"
sam_grove 5:3f93dd1d4cb3 23 #include "USBDeviceConnected.h"
sam_grove 5:3f93dd1d4cb3 24 #include "USBEndpoint.h"
sam_grove 5:3f93dd1d4cb3 25 #include "IUSBEnumerator.h"
sam_grove 5:3f93dd1d4cb3 26
sam_grove 5:3f93dd1d4cb3 27 #define MAX_DEVICE_NB 1
sam_grove 5:3f93dd1d4cb3 28
sam_grove 5:3f93dd1d4cb3 29 // singleton class
sam_grove 5:3f93dd1d4cb3 30 class USBHost : public USBHALHost {
sam_grove 5:3f93dd1d4cb3 31 public:
sam_grove 5:3f93dd1d4cb3 32 /*
sam_grove 5:3f93dd1d4cb3 33 * Static method to create or retrieve the single USBHost instance
sam_grove 5:3f93dd1d4cb3 34 */
sam_grove 5:3f93dd1d4cb3 35 static USBHost * getHostInst();
sam_grove 5:3f93dd1d4cb3 36
sam_grove 5:3f93dd1d4cb3 37 USB_TYPE getDeviceDescriptor(USBDeviceConnected * dev, uint8_t * buf) ;
sam_grove 5:3f93dd1d4cb3 38 USB_TYPE getConfigurationDescriptor(USBDeviceConnected * dev, uint8_t * buf, uint16_t * len_conf_descr = NULL) ;
sam_grove 5:3f93dd1d4cb3 39 USB_TYPE setConfiguration(USBDeviceConnected * dev, uint8_t conf) ;
sam_grove 5:3f93dd1d4cb3 40 USB_TYPE getStringDescriptor(USBDeviceConnected * dev, uint8_t index, uint8_t * buf) ;
sam_grove 5:3f93dd1d4cb3 41 USB_TYPE getReportDescriptor(USBDeviceConnected * dev, uint8_t * buf, uint8_t len) ;
sam_grove 5:3f93dd1d4cb3 42
sam_grove 5:3f93dd1d4cb3 43 /*
sam_grove 5:3f93dd1d4cb3 44 * Control read: setup stage, data stage and status stage
sam_grove 5:3f93dd1d4cb3 45 *
sam_grove 5:3f93dd1d4cb3 46 * @param dev the control read will be done for this device
sam_grove 5:3f93dd1d4cb3 47 * @param requestType request type
sam_grove 5:3f93dd1d4cb3 48 * @param request request
sam_grove 5:3f93dd1d4cb3 49 * @param value value
sam_grove 5:3f93dd1d4cb3 50 * @param index index
sam_grove 5:3f93dd1d4cb3 51 * @param buf pointer on a buffer where will be store the data received
sam_grove 5:3f93dd1d4cb3 52 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 53 *
sam_grove 5:3f93dd1d4cb3 54 * @returns status of the control read
sam_grove 5:3f93dd1d4cb3 55 */
sam_grove 5:3f93dd1d4cb3 56 USB_TYPE controlRead(USBDeviceConnected * dev, uint8_t requestType, uint8_t request, uint32_t value, uint32_t index, uint8_t * buf, uint32_t len) ;
sam_grove 5:3f93dd1d4cb3 57
sam_grove 5:3f93dd1d4cb3 58 /*
sam_grove 5:3f93dd1d4cb3 59 * Control write: setup stage, data stage and status stage
sam_grove 5:3f93dd1d4cb3 60 *
sam_grove 5:3f93dd1d4cb3 61 * @param dev the control write will be done for this device
sam_grove 5:3f93dd1d4cb3 62 * @param requestType request type
sam_grove 5:3f93dd1d4cb3 63 * @param request request
sam_grove 5:3f93dd1d4cb3 64 * @param value value
sam_grove 5:3f93dd1d4cb3 65 * @param index index
sam_grove 5:3f93dd1d4cb3 66 * @param buf pointer on a buffer which will be written
sam_grove 5:3f93dd1d4cb3 67 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 68 *
sam_grove 5:3f93dd1d4cb3 69 * @returns status of the control write
sam_grove 5:3f93dd1d4cb3 70 */
sam_grove 5:3f93dd1d4cb3 71 USB_TYPE controlWrite(USBDeviceConnected * dev, uint8_t requestType, uint8_t request, uint32_t value, uint32_t index, uint8_t * buf, uint32_t len) ;
sam_grove 5:3f93dd1d4cb3 72
sam_grove 5:3f93dd1d4cb3 73
sam_grove 5:3f93dd1d4cb3 74 /*
sam_grove 5:3f93dd1d4cb3 75 * Bulk read
sam_grove 5:3f93dd1d4cb3 76 *
sam_grove 5:3f93dd1d4cb3 77 * @param dev the bulk transfer will be done for this device
sam_grove 5:3f93dd1d4cb3 78 * @param ep USBEndpoint which will be used to read a packet
sam_grove 5:3f93dd1d4cb3 79 * @param buf pointer on a buffer where will be store the data received
sam_grove 5:3f93dd1d4cb3 80 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 81 * @param blocking if true, the read is blocking (wait for completion)
sam_grove 5:3f93dd1d4cb3 82 *
sam_grove 5:3f93dd1d4cb3 83 * @returns status of the bulk read
sam_grove 5:3f93dd1d4cb3 84 */
sam_grove 5:3f93dd1d4cb3 85 USB_TYPE bulkRead(USBDeviceConnected * dev, USBEndpoint * ep, uint8_t * buf, uint32_t len, bool blocking = true) ;
sam_grove 5:3f93dd1d4cb3 86
sam_grove 5:3f93dd1d4cb3 87 /*
sam_grove 5:3f93dd1d4cb3 88 * Bulk write
sam_grove 5:3f93dd1d4cb3 89 *
sam_grove 5:3f93dd1d4cb3 90 * @param dev the bulk transfer will be done for this device
sam_grove 5:3f93dd1d4cb3 91 * @param ep USBEndpoint which will be used to write a packet
sam_grove 5:3f93dd1d4cb3 92 * @param buf pointer on a buffer which will be written
sam_grove 5:3f93dd1d4cb3 93 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 94 * @param blocking if true, the write is blocking (wait for completion)
sam_grove 5:3f93dd1d4cb3 95 *
sam_grove 5:3f93dd1d4cb3 96 * @returns status of the bulk write
sam_grove 5:3f93dd1d4cb3 97 */
sam_grove 5:3f93dd1d4cb3 98 USB_TYPE bulkWrite(USBDeviceConnected * dev, USBEndpoint * ep, uint8_t * buf, uint32_t len, bool blocking = true) ;
sam_grove 5:3f93dd1d4cb3 99
sam_grove 5:3f93dd1d4cb3 100 /*
sam_grove 5:3f93dd1d4cb3 101 * Interrupt read
sam_grove 5:3f93dd1d4cb3 102 *
sam_grove 5:3f93dd1d4cb3 103 * @param dev the bulk transfer will be done for this device
sam_grove 5:3f93dd1d4cb3 104 * @param ep USBEndpoint which will be used to write a packet
sam_grove 5:3f93dd1d4cb3 105 * @param buf pointer on a buffer which will be written
sam_grove 5:3f93dd1d4cb3 106 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 107 * @param blocking if true, the read is blocking (wait for completion)
sam_grove 5:3f93dd1d4cb3 108 *
sam_grove 5:3f93dd1d4cb3 109 * @returns status of the interrupt read
sam_grove 5:3f93dd1d4cb3 110 */
sam_grove 5:3f93dd1d4cb3 111 USB_TYPE interruptRead(USBDeviceConnected * dev, USBEndpoint * ep, uint8_t * buf, uint32_t len, bool blocking = true) ;
sam_grove 5:3f93dd1d4cb3 112
sam_grove 5:3f93dd1d4cb3 113 /*
sam_grove 5:3f93dd1d4cb3 114 * Interrupt write
sam_grove 5:3f93dd1d4cb3 115 *
sam_grove 5:3f93dd1d4cb3 116 * @param dev the bulk transfer will be done for this device
sam_grove 5:3f93dd1d4cb3 117 * @param ep USBEndpoint which will be used to write a packet
sam_grove 5:3f93dd1d4cb3 118 * @param buf pointer on a buffer which will be written
sam_grove 5:3f93dd1d4cb3 119 * @param len length of the transfer
sam_grove 5:3f93dd1d4cb3 120 * @param blocking if true, the write is blocking (wait for completion)
sam_grove 5:3f93dd1d4cb3 121 *
sam_grove 5:3f93dd1d4cb3 122 * @returns status of the interrupt write
sam_grove 5:3f93dd1d4cb3 123 */
sam_grove 5:3f93dd1d4cb3 124 USB_TYPE interruptWrite(USBDeviceConnected * dev, USBEndpoint * ep, uint8_t * buf, uint32_t len, bool blocking = true) ;
sam_grove 5:3f93dd1d4cb3 125
sam_grove 5:3f93dd1d4cb3 126 /*
sam_grove 5:3f93dd1d4cb3 127 * Enumerate a device. This method is responsible for:
sam_grove 5:3f93dd1d4cb3 128 * - set the address of the device
sam_grove 5:3f93dd1d4cb3 129 * - fill a USBDeviceConnected object:
sam_grove 5:3f93dd1d4cb3 130 * - add interfaces, endpoints, ...
sam_grove 5:3f93dd1d4cb3 131 * - set a configuration
sam_grove 5:3f93dd1d4cb3 132 *
sam_grove 5:3f93dd1d4cb3 133 * @param dev device which will be enumerated
sam_grove 5:3f93dd1d4cb3 134 *
sam_grove 5:3f93dd1d4cb3 135 * @returns status of the enumeration
sam_grove 5:3f93dd1d4cb3 136 */
sam_grove 5:3f93dd1d4cb3 137 USB_TYPE enumerate(USBDeviceConnected * dev, IUSBEnumerator* pEnumerator) ;
sam_grove 5:3f93dd1d4cb3 138
sam_grove 5:3f93dd1d4cb3 139 /*
sam_grove 5:3f93dd1d4cb3 140 * Get a device
sam_grove 5:3f93dd1d4cb3 141 *
sam_grove 5:3f93dd1d4cb3 142 * @param index index of the device which will be returned
sam_grove 5:3f93dd1d4cb3 143 *
sam_grove 5:3f93dd1d4cb3 144 * @returns pointer on the "index" device
sam_grove 5:3f93dd1d4cb3 145 */
sam_grove 5:3f93dd1d4cb3 146 USBDeviceConnected * getDevice(uint8_t index) ;
sam_grove 5:3f93dd1d4cb3 147
sam_grove 5:3f93dd1d4cb3 148 /*
sam_grove 5:3f93dd1d4cb3 149 * reset port and hub of a specific device
sam_grove 5:3f93dd1d4cb3 150 *
sam_grove 5:3f93dd1d4cb3 151 * @param pointer on the device hich will be reseted
sam_grove 5:3f93dd1d4cb3 152 */
sam_grove 5:3f93dd1d4cb3 153 USB_TYPE resetDevice(USBDeviceConnected * dev) ;
sam_grove 5:3f93dd1d4cb3 154
sam_grove 5:3f93dd1d4cb3 155 /*
sam_grove 5:3f93dd1d4cb3 156 * If there is a HID device connected, the host stores the length of the report descriptor.
sam_grove 5:3f93dd1d4cb3 157 * This avoid to the driver to re-ask the configuration descriptor to request the report descriptor
sam_grove 5:3f93dd1d4cb3 158 *
sam_grove 5:3f93dd1d4cb3 159 * @returns length of the report descriptor
sam_grove 5:3f93dd1d4cb3 160 */
sam_grove 5:3f93dd1d4cb3 161 uint16_t getLengthReportDescr() {
sam_grove 5:3f93dd1d4cb3 162 return lenReportDescr;
sam_grove 5:3f93dd1d4cb3 163 };
sam_grove 5:3f93dd1d4cb3 164
sam_grove 5:3f93dd1d4cb3 165 /**
sam_grove 5:3f93dd1d4cb3 166 * register a driver into the host associated with a callback function called when the device is disconnected
sam_grove 5:3f93dd1d4cb3 167 *
sam_grove 5:3f93dd1d4cb3 168 * @param dev device
sam_grove 5:3f93dd1d4cb3 169 * @param tptr pointer to the object to call the member function on
sam_grove 5:3f93dd1d4cb3 170 * @param mptr pointer to the member function to be called
sam_grove 5:3f93dd1d4cb3 171 */
sam_grove 5:3f93dd1d4cb3 172 template<typename T>
sam_grove 5:3f93dd1d4cb3 173 void registerDriver(USBDeviceConnected * dev, uint8_t intf, T* tptr, void (T::*mptr)(void)) {
sam_grove 5:3f93dd1d4cb3 174 int index = findDevice(dev);
sam_grove 5:3f93dd1d4cb3 175 if ((index != -1) && (mptr != NULL) && (tptr != NULL)) {
sam_grove 5:3f93dd1d4cb3 176 dev->onDisconnect(intf, tptr, mptr);
sam_grove 5:3f93dd1d4cb3 177 }
sam_grove 5:3f93dd1d4cb3 178 }
sam_grove 5:3f93dd1d4cb3 179
sam_grove 5:3f93dd1d4cb3 180 /**
sam_grove 5:3f93dd1d4cb3 181 * register a driver into the host associated with a callback function called when the device is disconnected
sam_grove 5:3f93dd1d4cb3 182 *
sam_grove 5:3f93dd1d4cb3 183 * @param dev device
sam_grove 5:3f93dd1d4cb3 184 * @param fn callback called when the specified device has been disconnected
sam_grove 5:3f93dd1d4cb3 185 */
sam_grove 5:3f93dd1d4cb3 186 void registerDriver(USBDeviceConnected * dev, uint8_t intf, void (*fn)(void)) {
sam_grove 5:3f93dd1d4cb3 187 int index = findDevice(dev);
sam_grove 5:3f93dd1d4cb3 188 if ((index != -1) && (fn != NULL)) {
sam_grove 5:3f93dd1d4cb3 189 dev->onDisconnect(intf, fn);
sam_grove 5:3f93dd1d4cb3 190 }
sam_grove 5:3f93dd1d4cb3 191 }
sam_grove 5:3f93dd1d4cb3 192
sam_grove 5:3f93dd1d4cb3 193
sam_grove 5:3f93dd1d4cb3 194 protected:
sam_grove 5:3f93dd1d4cb3 195
sam_grove 5:3f93dd1d4cb3 196 /*
sam_grove 5:3f93dd1d4cb3 197 * Virtual method called when a device has been connected
sam_grove 5:3f93dd1d4cb3 198 *
sam_grove 5:3f93dd1d4cb3 199 * @param hub hub number of the device
sam_grove 5:3f93dd1d4cb3 200 * @param port port number of the device
sam_grove 5:3f93dd1d4cb3 201 * @param lowSpeed 1 if low speed, 0 otherwise
sam_grove 5:3f93dd1d4cb3 202 */
sam_grove 5:3f93dd1d4cb3 203 virtual void deviceConnected(int hub, int port, bool lowSpeed) ;
sam_grove 5:3f93dd1d4cb3 204
sam_grove 5:3f93dd1d4cb3 205 /*
sam_grove 5:3f93dd1d4cb3 206 * Virtuel method called when a device has been disconnected
sam_grove 5:3f93dd1d4cb3 207 *
sam_grove 5:3f93dd1d4cb3 208 * @param hub hub number of the device
sam_grove 5:3f93dd1d4cb3 209 * @param port port number of the device
sam_grove 5:3f93dd1d4cb3 210 * @param addr list of the TDs which have been completed to dequeue freed TDs
sam_grove 5:3f93dd1d4cb3 211 */
sam_grove 5:3f93dd1d4cb3 212 virtual void deviceDisconnected(int hub, int port, volatile uint32_t addr) ;
sam_grove 5:3f93dd1d4cb3 213
sam_grove 5:3f93dd1d4cb3 214 /*
sam_grove 5:3f93dd1d4cb3 215 * Virtual method called when a transfer has been completed
sam_grove 5:3f93dd1d4cb3 216 *
sam_grove 5:3f93dd1d4cb3 217 * @param addr list of the TDs which have been completed
sam_grove 5:3f93dd1d4cb3 218 */
sam_grove 5:3f93dd1d4cb3 219 virtual void transferCompleted(volatile uint32_t addr) ;
sam_grove 5:3f93dd1d4cb3 220
sam_grove 5:3f93dd1d4cb3 221
sam_grove 5:3f93dd1d4cb3 222 private:
sam_grove 5:3f93dd1d4cb3 223 // singleton class -> constructor is private
sam_grove 5:3f93dd1d4cb3 224 USBHost();
sam_grove 5:3f93dd1d4cb3 225
sam_grove 5:3f93dd1d4cb3 226 static USBHost * instHost;
sam_grove 5:3f93dd1d4cb3 227
sam_grove 5:3f93dd1d4cb3 228 uint8_t nb_devices;
sam_grove 5:3f93dd1d4cb3 229 uint16_t lenReportDescr;
sam_grove 5:3f93dd1d4cb3 230
sam_grove 5:3f93dd1d4cb3 231 void fillControlBuf(uint8_t requestType, uint8_t request, uint32_t value, uint32_t index, int len) ;
sam_grove 5:3f93dd1d4cb3 232 void parseConfDescr(USBDeviceConnected * dev, uint8_t * conf_descr, uint32_t len, IUSBEnumerator* pEnumerator) ;
sam_grove 5:3f93dd1d4cb3 233 void freeDevice(USBDeviceConnected * dev) ;
sam_grove 5:3f93dd1d4cb3 234 int findDevice(USBDeviceConnected * dev) ;
sam_grove 5:3f93dd1d4cb3 235
sam_grove 5:3f93dd1d4cb3 236
sam_grove 5:3f93dd1d4cb3 237 // endpoints
sam_grove 5:3f93dd1d4cb3 238 void unqueueEndpoint(USBEndpoint * ep) ;
sam_grove 5:3f93dd1d4cb3 239 USBEndpoint endpoints[MAX_ENDPOINT];
sam_grove 5:3f93dd1d4cb3 240 USBEndpoint* volatile control;
sam_grove 5:3f93dd1d4cb3 241
sam_grove 5:3f93dd1d4cb3 242 USBEndpoint* volatile headControlEndpoint;
sam_grove 5:3f93dd1d4cb3 243 USBEndpoint* volatile headBulkEndpoint;
sam_grove 5:3f93dd1d4cb3 244 USBEndpoint* volatile headInterruptEndpoint;
sam_grove 5:3f93dd1d4cb3 245
sam_grove 5:3f93dd1d4cb3 246 USBEndpoint* volatile tailControlEndpoint;
sam_grove 5:3f93dd1d4cb3 247 USBEndpoint* volatile tailBulkEndpoint;
sam_grove 5:3f93dd1d4cb3 248 USBEndpoint* volatile tailInterruptEndpoint;
sam_grove 5:3f93dd1d4cb3 249
sam_grove 5:3f93dd1d4cb3 250 bool controlEndpointAllocated;
sam_grove 5:3f93dd1d4cb3 251
sam_grove 5:3f93dd1d4cb3 252
sam_grove 5:3f93dd1d4cb3 253 // devices connected
sam_grove 5:3f93dd1d4cb3 254 USBDeviceConnected devices[MAX_DEVICE_NB];
sam_grove 5:3f93dd1d4cb3 255 volatile bool deviceInUse[MAX_DEVICE_NB];
sam_grove 5:3f93dd1d4cb3 256 volatile bool deviceReset[MAX_DEVICE_NB];
sam_grove 5:3f93dd1d4cb3 257
sam_grove 5:3f93dd1d4cb3 258 /*
sam_grove 5:3f93dd1d4cb3 259 * Add a transfer on the TD linked list associated to an ED
sam_grove 5:3f93dd1d4cb3 260 *
sam_grove 5:3f93dd1d4cb3 261 * @param ed the transfer is associated to this ed
sam_grove 5:3f93dd1d4cb3 262 * @param buf pointer on a buffer where will be read/write data to send or receive
sam_grove 5:3f93dd1d4cb3 263 * @param len transfer length
sam_grove 5:3f93dd1d4cb3 264 *
sam_grove 5:3f93dd1d4cb3 265 * @return status of the transfer
sam_grove 5:3f93dd1d4cb3 266 */
sam_grove 5:3f93dd1d4cb3 267 USB_TYPE addTransfer(USBEndpoint * ed, uint8_t * buf, uint32_t len) ;
sam_grove 5:3f93dd1d4cb3 268
sam_grove 5:3f93dd1d4cb3 269 /*
sam_grove 5:3f93dd1d4cb3 270 * Link the USBEndpoint to the linked list and attach an USBEndpoint this USBEndpoint to a device
sam_grove 5:3f93dd1d4cb3 271 *
sam_grove 5:3f93dd1d4cb3 272 * @param dev pointer on a USBDeviceConnected object
sam_grove 5:3f93dd1d4cb3 273 * @param ep pointer on the USBEndpoint which will be added
sam_grove 5:3f93dd1d4cb3 274 *
sam_grove 5:3f93dd1d4cb3 275 * return true if successful
sam_grove 5:3f93dd1d4cb3 276 */
sam_grove 5:3f93dd1d4cb3 277 bool addEndpoint(USBDeviceConnected * dev, uint8_t intf_nb, USBEndpoint * ep) ;
sam_grove 5:3f93dd1d4cb3 278
sam_grove 5:3f93dd1d4cb3 279 /*
sam_grove 5:3f93dd1d4cb3 280 * Create an USBEndpoint descriptor. Warning: the USBEndpoint is not linked.
sam_grove 5:3f93dd1d4cb3 281 *
sam_grove 5:3f93dd1d4cb3 282 * @param type USBEndpoint type (CONTROL_ENDPOINT, BULK_ENDPOINT, INTERRUPT_ENDPOINT)
sam_grove 5:3f93dd1d4cb3 283 * @param dir USBEndpoint direction (no meaning for CONTROL_ENDPOINT)
sam_grove 5:3f93dd1d4cb3 284 * @param size USBEndpoint max packet size
sam_grove 5:3f93dd1d4cb3 285 * @param addr USBEndpoint address
sam_grove 5:3f93dd1d4cb3 286 *
sam_grove 5:3f93dd1d4cb3 287 * @returns pointer on the USBEndpoint created
sam_grove 5:3f93dd1d4cb3 288 */
sam_grove 5:3f93dd1d4cb3 289 USBEndpoint * newEndpoint(ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir, uint32_t size, uint8_t addr) ;
sam_grove 5:3f93dd1d4cb3 290
sam_grove 5:3f93dd1d4cb3 291
sam_grove 5:3f93dd1d4cb3 292 // to store a setup packet
sam_grove 5:3f93dd1d4cb3 293 uint8_t setupPacket[8];
sam_grove 5:3f93dd1d4cb3 294
sam_grove 5:3f93dd1d4cb3 295
sam_grove 5:3f93dd1d4cb3 296 /////////////////////////
sam_grove 5:3f93dd1d4cb3 297 /// FOR DEBUG
sam_grove 5:3f93dd1d4cb3 298 /////////////////////////
sam_grove 5:3f93dd1d4cb3 299 void printBulk();
sam_grove 5:3f93dd1d4cb3 300 void printInt();
sam_grove 5:3f93dd1d4cb3 301
sam_grove 5:3f93dd1d4cb3 302 };
sam_grove 5:3f93dd1d4cb3 303
sam_grove 5:3f93dd1d4cb3 304 #endif