![]() ![]() + /* TODO: We should check that the endpoint number is valid */ + /* TODO: Remote wakeup feature not supported */ + /* Endpoint or interface must be zero */ ![]() +bool USBDevice::requestSetInterface(void) + transfer.remaining = sizeof(currentAlternate) ![]() + /* Return the selected alternate setting for an interface */ +bool USBDevice::requestGetInterface(void) + transfer.remaining = sizeof(nfiguration) +bool USBDevice::requestGetConfiguration(void) + if (USBCallback_setConfiguration(nfiguration)) +bool USBDevice::requestSetConfiguration(void) + if (transfer.direction != DEVICE_TO_HOST) + /* Check we should be transferring data IN */ + /* also have transfer.remaining = 0) */ + /* Check if transfer has completed (status stage transactions */ + USBCallback_requestCompleted(buffer, packetSize) + packet->wValue = (data | (uint16_t)data wIndex = (data | (uint16_t)data wLength = (data | (uint16_t)data transfer.remaining) + packet->bmRequestType.Recipient = data & 0x1f + packet->bmRequestType.Type = (data & 0圆0) > 5 +#define DEVICE_STATUS_SELF_POWERED (1UbmRequestType.dataTransferDirection = (data & 0x80) > 7 +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +* The above copyright notice and this permission notice shall be included in all copies or +* Software is furnished to do so, subject to the following conditions: +* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the +* restriction, including without limitation the rights to use, copy, modify, merge, publish, +* and associated documentation files (the "Software"), to deal in the Software without +* Permission is hereby granted, free of charge, to any person obtaining a copy of this software ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |