void putrsUSBUSART( const ROM char * data );
putrsUSBUSART writes a string of data to the USB including the null character. Use this version, 'putrs', to transfer data literals and data located in program memory.
Typical Usage:
if(USBUSARTIsTxTrfReady()) { putrsUSBUSART("Hello World"); }
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 |
const ROM 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. |