Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 83 of 157
Apr 1, 2013
Example
USB_UTR_t usb_smp_trn_Msg[USB_NUM_USBIP][USB_MAXPIPE_NUM + 1];
USB_ER_t usb_smp_task(USB_UTR_t *ptr, uint16_t pipe, uint32_t size, uint8_t
*table)
{
:
/* Transfer information setting */
trn_msg[ptr->ip][pipe].msghead = (USB_MH_t)NULL; /* NULL only */
trn_msg[ptr->ip][pipe].keyword = pipe; /* Pipe no. */
trn_msg[ptr->ip][pipe].tranadr = table; /* Pointer to data buffer */
trn_msg[ptr->ip][pipe].tranlen = size; /* Transfer size */
trn_msg[ptr->ip][pipe].setup = 0;
trn_msg[ptr->ip][pipe].complete = ptr->complete; /* Call-back function */
trn_msg[ptr->ip][pipe].msghead = USB_TRAN_END; /* Status */
trn_msg[ptr->ip][pipe].ipp = ptr->ipp; /* USB IP base address */
trn_msg[ptr->ip][pipe].ip = ptr->ip; /* USB IP No */
/* Data transfer request */
err = R_usb_hstd_TransferStart((USB_UTR_t *)&trn_msg [ptr->ip][pipe]);
return err;
:
}