# 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
…
- 100
- 101
- 102
- 103
- 104
…
- 311
- 312

Function
bool USB_HOST_APP_DATA_EVENT_HANDLER ( uint8_t address, USB_EVENT event,
void *data, uint32_t size )
1.4.2.1.1.2 USB_HOST_APP_EVENT_HANDLER Function
This is a typedef to use when defining the application level events handler.
File
usb_host.h
Syntax
bool USB_HOST_APP_EVENT_HANDLER(uint8_t address, USB_EVENT event, void * data, uint32_t
size);
Description
This function is implemented by the application. The function name can be anything - the macro
USB_HOST_APP_EVENT_HANDLER must be set in usb_config.h to the name of the application function.
In the application layer, this function is responsible for handling all application-level events that are generated by the stack.
See the enumeration USB_EVENT for a complete list of all events that can occur. Note that some of these events are
intended for client drivers (e.g. EVENT_TRANSFER), while some are intended for for the application layer (e.g.
EVENT_UNSUPPORTED_DEVICE).
If the application can handle the event successfully, the function should return true. For example, if the function receives the
event EVENT_VBUS_REQUEST_POWER and the system can allocate that much power to an attached device, the function
should return true. If, however, the system cannot allocate that much power to an attached device, the function should return
false.
Remarks
If this function is not provided by the application, then all application events are assumed to function without error.
Preconditions
None
Parameters
Parameters Description
uint8_t address Address of the USB device generating the event
USB_EVENT event Event that occurred
void *data Optional pointer to data for the event
uint32_t size Size of the data pointed to by *data
Return Values
Return Values Description
true Event was processed successfully
false Event was not processed successfully
Function
bool USB_HOST_APP_EVENT_HANDLER ( uint8_t address, USB_EVENT event,
void *data, uint32_t size )
1.4.2.1.1.3 USB_HostInterruptHandler Function
This function handles the interrupts when the USB module is running in host mode.
1.4 Library Interface MLA - USB Library Help Embedded Host API
102

- 1
- 2
…
- 100
- 101
- 102
- 103
- 104
…
- 311
- 312