#define mUSBUSARTTxRam(pData,len) \ { \ pCDCSrc.bRam = pData; \ cdc_tx_len = len; \ cdc_mem_type = USB_EP0_RAM; \ cdc_trf_state = CDC_TX_BUSY; \ }
Use this macro to transfer data located in data memory. Use this macro when:
Typical Usage:
if(USBUSARTIsTxTrfReady()) { mUSBUSARTTxRam(&UserDataBuffer[0], 200); }
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 |
Description |
pDdata |
Pointer to the starting location of data bytes |
len |
Number of bytes to be transferred |
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
![]() |