# Vault 7: Projects

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

### Protego

# MLA -- USB Library

20 December, 2013

- 1
- 2
…
- 114
- 115
- 116
- 117
- 118
…
- 311
- 312

Parameters
Parameters Description
USB_EVENT vbusEvent Vbus event that occured. Valid events:
• EVENT_VBUS_OVERCURRENT
• EVENT_VBUS_POWER_AVAILABLE
uint8_t hubAddress Address of the hub device (USB_ROOT_HUB for the root
hub)
uint8_t portNumber Number of the physical port on the hub (0 - based)
Return Values
Return Values Description
USB_SUCCESS Event handled
USB_ILLEGAL_REQUEST Invalid event, hub, or port
Function
uint8_t USBHostVbusEvent( USB_EVENT vbusEvent, uint8_t hubAddress,
uint8_t portNumber)
1.4.2.1.1.23 USBHostWrite Function
This function initiates a write to the attached device.
File
usb_host.h
Syntax
uint8_t USBHostWrite(uint8_t deviceAddress, uint8_t endpoint, uint8_t * data, uint32_t
size);
Description
This function initiates a write to the attached device. The data buffer pointed to by *data must remain valid during the entire
time that the write is taking place; the data is not buffered by the stack.
If the endpoint is isochronous, special conditions apply. The pData and size parameters have slightly different meanings,
since multiple buffers are required. Once started, an isochronous transfer will continue with no upper layer intervention until
USBHostTerminateTransfer() is called. The ISOCHRONOUS_DATA_BUFFERS structure should not be manipulated until
the transfer is terminated.
To clarify parameter usage and to simplify casting, use the macro USBHostWriteIsochronous() when writing to an
isochronous endpoint.
Remarks
None
Preconditions
None
Parameters
Parameters Description
uint8_t deviceAddress Device address
uint8_t endpoint Endpoint number
uint8_t *data Pointer to where the data is stored. If the endpoint is
isochronous, this points to an
ISOCHRONOUS_DATA_BUFFERS structure, with multiple
data buffer pointers.
1.4 Library Interface MLA - USB Library Help Embedded Host API
116

- 1
- 2
…
- 114
- 115
- 116
- 117
- 118
…
- 311
- 312