Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 39 of 157
Apr 1, 2013
R_usb_pstd_DriverRegistration
Register a PDCD
Format
void R_usb_pstd_DriverRegistration (USB_UTR_t *ptr, USB_PCDREG_t *registinfo)
Arguments
*ptr Pointer to a USB Transfer Structure
*registinfo Pointer to class driver structure. (See section
4.3.1 for information on this structure)
Return Value
- -
Description
This function registers the PDCD information, which is registered in the class driver structure, in the PCD. After
registration is complete, the initialization call-back function is executed.
Note
1. Besides above arguments, also set the following members of the USB Transfer Structure before calling this
function:
USB_REGADR_t ipp :USB register base address
uint16_t ip :USB IP number
2. The user must call this function from the user’s program during initialization.
3. Only one device can be registered.
Example
void usb_smp_registration(USB_UTR_t *ptr)
{
USB_PCDREG_t driver;
:
/* Register PDCD information to driver */
/* Pipe Define Table address */
driver.pipetbl = (uint16_t**)&usb_gpvendor_smpl_epptr;
/* Device descriptor Table address */
driver.devicetbl = (uint8_t*)&usb_gpvendor_smpl_DeviceDescriptor;
/* Qualifier descriptor Table address */
driver.qualitbl = (uint8_t*)&usb_gpvendor_smpl_QualifierDescriptor;
/* Configuration descriptor Table address */
driver.configtbl = (uint8_t**)&usb_gpvendor_smpl_ConPtr;
/* Other configuration descriptor Table address */
driver.othertbl = (uint8_t**)&usb_gpvendor_smpl_ConPtrOther;
/* String descriptor Table address */
driver.stringtbl = (uint8_t**)&usb_gpvendor_str_ptr;
/* Driver init */
driver.classinit = &usb_cvendor_dummy_function;
R_usb_pstd_DriverRegistration(ptr, &driver);
}