Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 34 of 157
Apr 1, 2013
Example
USB_UTR_t 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].segment = 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_pstd_TransferStart((USB_UTR_t *)&trn_Msg [ptr->ip][pipe]);
return err;
}