Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

pHandle = &Handle1;
pDataBuffer = &UserDataBuffer1[0];
}
}
Preconditions
Will return NULL if the USB device has not yet been configured/the endpoint specified has not yet been initalized by
USBEnableEndpoint().
Parameters
Parameters Description
uint8_t ep_num The endpoint number to get the handle for (valid values are
1-15, 0 is not a valid input value for this API)
uint8_t ep_dir The endpoint direction associated with the endpoint number
to get the handle for (valid values are OUT_FROM_HOST
and IN_TO_HOST).
Return Values
Return Values Description
USB_HANDLE Returns the USB_HANDLE (a pointer) to the BDT that will be
used next time the USBTransferOnePacket() function is
called, for the given ep_num and ep_dir
Function
USB_HANDLE USBGetNextHandle(uint8_t ep_num, uint8_t ep_dir)
1.4.1.1.1.19 USBGetRemoteWakeupStatus Function
This function indicates if remote wakeup has been enabled by the host. Devices that support remote wakeup should use this
function to determine if it should send a remote wakeup.
File
usb_device.h
Syntax
bool USBGetRemoteWakeupStatus();
Description
This function indicates if remote wakeup has been enabled by the host. Devices that support remote wakeup should use this
function to determine if it should send a remote wakeup.
If a device does not support remote wakeup (the Remote wakeup bit, bit 5, of the bmAttributes field of the Configuration
descriptor is set to 1), then it should not send a remote wakeup command to the PC and this function is not of any use to the
device. If a device does support remote wakeup then it should use this function as described below.
If this function returns false and the device is suspended, it should not issue a remote wakeup (resume).
If this function returns true and the device is suspended, it should issue a remote wakeup (resume).
A device can add remote wakeup support by having the _RWU symbol added in the configuration descriptor (located in the
usb_descriptors.c file in the project). This done in the 8th byte of the configuration descriptor. For example:
const uint8_t configDescriptor1[]={
0x09, // Size
USB_DESCRIPTOR_CONFIGURATION, // descriptor type
DESC_CONFIG_WORD(0x0022), // Total length
1, // Number of interfaces
1, // Index value of this cfg
0, // Configuration string index
_DEFAULT | _SELF | _RWU, // Attributes, see usb_device.h
50, // Max power consumption in 2X mA(100mA)
//The rest of the configuration descriptor should follow
1.4 Library Interface MLA - USB Library Help Device/Peripheral
53

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh