local fork (temporary)
Dependents: VodafoneUSBModem_bleedingedge2
Fork of USBHostWANDongle_bleedingedge by
USBHost/IUSBEnumerator.h@6:075e36a3463e, 2012-07-27 (annotated)
- Committer:
- donatien
- Date:
- Fri Jul 27 16:14:07 2012 +0000
- Revision:
- 6:075e36a3463e
- Child:
- 9:c9e9817c398c
New enumeration model to only instantiate needed endpoints
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 6:075e36a3463e | 1 | /* Copyright (c) 2010-2012 mbed.org, MIT License |
donatien | 6:075e36a3463e | 2 | * |
donatien | 6:075e36a3463e | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
donatien | 6:075e36a3463e | 4 | * and associated documentation files (the "Software"), to deal in the Software without |
donatien | 6:075e36a3463e | 5 | * restriction, including without limitation the rights to use, copy, modify, merge, publish, |
donatien | 6:075e36a3463e | 6 | * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the |
donatien | 6:075e36a3463e | 7 | * Software is furnished to do so, subject to the following conditions: |
donatien | 6:075e36a3463e | 8 | * |
donatien | 6:075e36a3463e | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
donatien | 6:075e36a3463e | 10 | * substantial portions of the Software. |
donatien | 6:075e36a3463e | 11 | * |
donatien | 6:075e36a3463e | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
donatien | 6:075e36a3463e | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
donatien | 6:075e36a3463e | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
donatien | 6:075e36a3463e | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
donatien | 6:075e36a3463e | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
donatien | 6:075e36a3463e | 17 | */ |
donatien | 6:075e36a3463e | 18 | |
donatien | 6:075e36a3463e | 19 | #ifndef IUSBENUMERATOR_H_ |
donatien | 6:075e36a3463e | 20 | #define IUSBENUMERATOR_H_ |
donatien | 6:075e36a3463e | 21 | |
donatien | 6:075e36a3463e | 22 | #include "stdint.h" |
donatien | 6:075e36a3463e | 23 | |
donatien | 6:075e36a3463e | 24 | #include "Endpoint.h" |
donatien | 6:075e36a3463e | 25 | |
donatien | 6:075e36a3463e | 26 | /* |
donatien | 6:075e36a3463e | 27 | Generic interface to implement for "smart" USB enumeration |
donatien | 6:075e36a3463e | 28 | */ |
donatien | 6:075e36a3463e | 29 | |
donatien | 6:075e36a3463e | 30 | class IUSBEnumerator { |
donatien | 6:075e36a3463e | 31 | public: |
donatien | 6:075e36a3463e | 32 | |
donatien | 6:075e36a3463e | 33 | virtual void setVidPid(uint16_t vid, uint16_t pid) = 0; |
donatien | 6:075e36a3463e | 34 | |
donatien | 6:075e36a3463e | 35 | virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) = 0; //Must return true if the interface should be parsed |
donatien | 6:075e36a3463e | 36 | |
donatien | 6:075e36a3463e | 37 | virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used |
donatien | 6:075e36a3463e | 38 | |
donatien | 6:075e36a3463e | 39 | }; |
donatien | 6:075e36a3463e | 40 | |
donatien | 6:075e36a3463e | 41 | #endif /*IUSBENUMERATOR_H_*/ |