void putsUSBUSART( char * data );
putsUSBUSART writes a string of data to the USB including the null character. Use this version, 'puts', to transfer data from a RAM buffer.
Typical Usage:
if(USBUSARTIsTxTrfReady()) { char data[] = "Hello World"; putsUSBUSART(data); }
The transfer mechanism for device-to-host(put) is more flexible than host-to-device(get). It can handle a string of data larger than the maximum size of bulk IN endpoint. A state machine is used to transfer a long string of data over multiple USB transactions. CDCTxService() must be called periodically to keep sending blocks of data to the host.
USBUSARTIsTxTrfReady() must return TRUE. This indicates that the last transfer is complete and is ready to receive a new block of data. The string of characters pointed to by 'data' must equal to or smaller than 255 BYTEs.
Parameters |
Description |
char *data |
null-terminated string of constant data. If a null character is not found, 255 BYTEs of data will be transferred to the host. |