Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
Preconditions
None
Function
void USBDeferStatusStage(void);
1.4.1.1.1.8 USBDeviceAttach Function
Checks if VBUS is present, and that the USB module is not already initalized, and if so, enables the USB module so as to
signal device attachment to the USB host.
File
usb_device.h
Syntax
void USBDeviceAttach();
Description
This function indicates to the USB host that the USB device has been attached to the bus. This function needs to be called in
order for the device to start to enumerate on the bus.
Remarks
See also the USBDeviceDetach() API function documentation.
Preconditions
Should only be called when USB_INTERRUPT is defined. Also, should only be called from the main() loop context. Do not
call USBDeviceAttach() from within an interrupt handler, as the USBDeviceAttach() function may modify global interrupt
enable bits and settings.
For normal USB devices: Make sure that if the module was previously on, that it has been turned off for a long time (ex:
100ms+) before calling this function to re-enable the module. If the device turns off the D+ (for full speed) or D- (for low
speed) ~1.5k ohm pull up resistor, and then turns it back on very quickly, common hosts will sometimes reject this event,
since no human could ever unplug and reattach a USB device in a microseconds (or nanoseconds) timescale. The host
could simply treat this as some kind of glitch and ignore the event altogether.
Function
void USBDeviceAttach(void)
1.4.1.1.1.9 USBDeviceDetach Function
This function configures the USB module to "soft detach" itself from the USB host.
File
usb_device.h
Syntax
void USBDeviceDetach();
Description
This function configures the USB module to perform a "soft detach" operation, by disabling the D+ (or D-) ~1.5k pull up
resistor, which lets the host know the device is present and attached. This will make the host think that the device has been
unplugged. This is potentially useful, as it allows the USB device to force the host to re-enumerate the device (on the
firmware has re-enabled the USB module/pull up, by calling USBDeviceAttach(), to "soft re-attach" to the host).
1.4 Library Interface MLA - USB Library Help Device/Peripheral
44
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_usb.pdf