Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 16 of 157
Apr 1, 2013
3.2 How to register Host Class Driver
Please consult function usb_hapl_registration () in r_usb_vendor_hapl.c and register the class driver into USB-BASIC-
FW. For details, please refer to the Chapter
5.5.2.
The following describes how to register user-created class drivers and applications in USB-BASIC-FW.
void usb_hapl_registration(USB_UTR_t *ptr)
{
USB_HCDREG_t driver;
/* Driver registration */
/* Interface Class */
driver.ifclass = (uint16_t)USB_IFCLS_VEN;
/* Target peripheral list */
driver.tpl = (uint16_t*)&usb_gapl_devicetpl;
/* Pipe Define Table address */
driver.pipetbl = (uint16_t*)&usb_shvendor_smpl_def_eptbl;
/* Driver init */
driver.classinit = &usb_cvendor_dummy_function;
/* Driver check */
driver.classcheck = &usb_hvendor_class_check;
/* Device configured */
driver.devconfig = &usb_hvendor_apl_init;
/* Device detach */
driver.devdetach = &usb_hvendor_apl_close;
/* Device suspend */
driver.devsuspend = &usb_cvendor_dummy_function;
/* Device resume */
driver.devresume = &usb_cvendor_dummy_function;
R_usb_hstd_DriverRegistration(ptr, &driver);
}