putsUSBUSART Function

Microchip USB Device Library

USB Device Library Help
putsUSBUSART Function
C
void putsUSBUSART(
    char * data
);
Description

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.

Preconditions

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
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. 
Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.