# 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
…
- 113
- 114
- 115
- 116
- 117
…
- 311
- 312

• USB_ENDPOINT_ERROR_BIT_STUFF
• USB_ENDPOINT_ERROR_DMA
• USB_ENDPOINT_ERROR_TIMEOUT
• USB_ENDPOINT_ERROR_DATA_FIELD
• USB_ENDPOINT_ERROR_CRC16
• USB_ENDPOINT_ERROR_END_OF_FRAME
• USB_ENDPOINT_ERROR_PID_CHECK
• USB_ENDPOINT_ERROR - Other error
Preconditions
None
Parameters
Parameters Description
uint8_t deviceAddress Device address
uint8_t endpoint Endpoint number
uint8_t *errorCode Error code indicating the status of the transfer. Only valid if
the transfer is complete.
uint32_t *byteCount The number of bytes sent or received. Invalid for
isochronous transfers.
Return Values
Return Values Description
true Transfer is complete.
false Transfer is not complete.
Function
bool USBHostTransferIsComplete( uint8_t deviceAddress, uint8_t endpoint,
uint8_t *errorCode, uint32_t *byteCount )
1.4.2.1.1.22 USBHostVbusEvent Function
This function handles Vbus events that are detected by the application.
File
usb_host.h
Syntax
uint8_t USBHostVbusEvent(USB_EVENT vbusEvent, uint8_t hubAddress, uint8_t portNumber);
Description
This function handles Vbus events that are detected by the application. Since Vbus management is application dependent,
the application is responsible for monitoring Vbus and detecting overcurrent conditions and removal of the overcurrent
condition. If the application detects an overcurrent condition, it should call this function with the event
EVENT_VBUS_OVERCURRENT with the address of the hub and port number that has the condition. When a port returns to
normal operation, the application should call this function with the event EVENT_VBUS_POWER_AVAILABLE so the stack
knows that it can allow devices to attach to that port.
Remarks
None
Preconditions
None
1.4 Library Interface MLA - USB Library Help Embedded Host API
115

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