# 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
…
- 82
- 83
- 84
- 85
- 86
…
- 311
- 312

state. Unexpected behavior will occur if this function is called when cdc_trf_state != CDC_TX_READY
Typical Usage:
if(USBUSARTIsTxTrfReady())
{
mUSBUSARTTxRam(&UserDataBuffer[0], 200);
}
Remarks
This macro only handles the setup of the transfer. The actual transfer is handled by CDCTxService(). This macro does not
"double buffer" the data. The application firmware should not modify the contents of the pData buffer until all of the data has
been sent, as indicated by the USBUSARTIsTxTrfReady() function returning true, subsequent to calling
mUSBUSARTTxRam().
Preconditions
cdc_trf_state must be in the CDC_TX_READY state. Value of 'len' must be equal to or smaller than 255 bytes. The USB
stack should have reached the CONFIGURED_STATE prior to calling this API function for the first time.
Paramters: pDdata : Pointer to the starting location of data bytes len : Number of bytes to be transferred
Function
void mUSBUSARTTxRam(uint8_t *pData, uint8_t len)
1.4.1.3.2.17 mUSBUSARTTxRom Macro
File
usb_device_cdc.h
Syntax
#define mUSBUSARTTxRom(pData,len) \
{ \
pCDCSrc.bRom = pData; \
cdc_tx_len = len; \
cdc_mem_type = USB_EP0_ROM; \
cdc_trf_state = CDC_TX_BUSY; \
}
Description
Use this macro to transfer data located in program memory. Use this macro when:
1. Data stream is not null-terminated
2. Transfer length is known
Remember: cdc_trf_state must == CDC_TX_READY Unlike putrsUSBUSART, there is not code double checking the
transfer state. Unexpected behavior will occur if this function is called when cdc_trf_state != CDC_TX_READY
Typical Usage:
if(USBUSARTIsTxTrfReady())
{
mUSBUSARTTxRom(&SomeRomString[0], 200);
}
Remarks
This macro only handles the setup of the transfer. The actual transfer is handled by CDCTxService().
Preconditions
cdc_trf_state must be in the CDC_TX_READY state. Value of 'len' must be equal to or smaller than 255 bytes.
1.4 Library Interface MLA - USB Library Help Device/Peripheral
84

- 1
- 2
…
- 82
- 83
- 84
- 85
- 86
…
- 311
- 312