Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 25 of 157
Apr 1, 2013
write
USB send
Format
int32_t write (int16_t fileno, uint8_t *buf, int32_t count)
Arguments
fileno File number
*buf Pointer to data buffer
count Data transfer size
Return Value
- Error code
Description
This function executes a data transmit request for the USB device class specified in the file number. The data
transmit function writes data to the FIFO buffer in the specified data transfer size (3rd argument). The data to be
written is read from the data buffer (2nd argument).
When the transmit processing is complete, the call-back function is called. This call-back function is registered by
the Control API. Please refer to control code USB_CTL_WR_NOTIFY_SET in the Control API.
The actual write size can be obtained by using control API after the send processing is complete. Please refer to
control code USB_CTL_WR_LENGTH_GET in the Control API.
Note
1. Call this function from the user application. See “
4.2.2 General operation using ANSI API”, for more
explanation on how to use this function from the context of a user application.
2. After the file number is received, USB device class communications using this function can be performed.
The file number is obtained by using open API. Please refer to the Open API.
3. Use the Control API to register the call-back function for notification of data transfer completion before
calling this function.
4. This function only executes a data transmit request and no processing can be blocked while the data transmit
is processing. Therefore, the return value is always (-1).