# 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
…
- 95
- 96
- 97
- 98
- 99
…
- 311
- 312

transfer request from the host has arrived. If the USB stack is operated in USB_INTERRUPT mode (a usb_config.h option),
then this function will be executed in the interrupt context. If however the USB stack is operated in the USB_POLLING mode,
then this function executes in the main loop context.
In order to respond to class specific control transfer request(s) in this handler function, it is suggested to use one or more of
the USBEP0SendRAMPtr(), USBEP0SendROMPtr(), or USBEP0Receive() API functions.
Preconditions
None
Function
void USBCheckVendorRequest(void)
1.4.1.6.1.2 USBGEN_H Macro
File
usb_device_generic.h
Syntax
#define USBGEN_H
Description
This is macro USBGEN_H.
1.4.1.6.1.3 USBGenRead Macro
Receives the specified data out the specified endpoint
File
usb_device_generic.h
Syntax
#define USBGenRead(ep,data,len) USBRxOnePacket(ep,data,len)
Description
Receives the specified data out the specified endpoint.
Typical Usage:
//Read 64-bytes from endpoint USBGEN_EP_NUM, into the OUTPacket array.
// Make sure to save the return handle so that we can check it later
// to determine when the transfer is complete.
if(!USBHandleBusy(USBOutHandle))
{
USBOutHandle = USBGenRead(USBGEN_EP_NUM,(BYTE*)&OUTPacket,64);
}
Remarks
None
Preconditions
None
Parameters
Parameters Description
BYTE ep the endpoint you want to receive the data into
BYTE* data pointer to where the data will go when it arrives
WORD len the length of the data that you wish to receive
1.4 Library Interface MLA - USB Library Help Device/Peripheral
97

- 1
- 2
…
- 95
- 96
- 97
- 98
- 99
…
- 311
- 312