USB Library
mUSBUSARTTxRam Macro
Syntax
#define mUSBUSARTTxRam(pData,len) \
{                                   \
    pCDCSrc.bRam = pData;           \
    cdc_tx_len = len;               \
    cdc_mem_type = USB_EP0_RAM;     \
    cdc_trf_state = CDC_TX_BUSY;    \
}
Description

Use this macro to transfer data located in data 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 putsUSBUSART, 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())
    {
        mUSBUSARTTxRam(&UserDataBuffer[0], 200);
    }
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.

Parameters
Parameters 
Description 
pDdata 
Pointer to the starting location of data bytes 
len 
Number of bytes to be transferred 
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().

MLA - USB Library Help Version : 2.16
http://www.microchip.com/mla