Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 29 of 157
Apr 1, 2013
<USB_CTL_P_GET_DEVICE_INFO>
int16_t usb_smp_fn;
void usb_apl_task(USB_UTR_t *ptr)
{
USB_CTL_PARAMETER_t smp_parameter;
:
smp_parameter.device_information.tbl = &smp_tbl;
/* Getting USB device information */
control(usb_smp_fn, USB_CTL_P_GET_DEVICE_INFO, (void)&smp_parameter);
/* Device information is set in smp_tbl after processing control API */
}
<USB_CTL_P_WR_SET_STALL>
<USB_CTL_P_RD_SET_STALL>
/* When the user want to call the call-back function after setting STALL */
int16_t usb_smp_fn;
/* Call-back function */
void usb_complete( uint16_t data1, uint16_t data2 )
{
:
}
void usb_apl_task(void)
{
USB_CTL_PARAMETER_t smp_parameter;
:
smp_parameter.setstall.complete = usb_complete; /* Call-back function */
/* Set stall */
control(usb_smp_fn, USB_CTL_P_WR_SET_STALL, (void*)&smp_parameter);
:
}
/* When the user doesn’t want to call the call-back function after setting
STALL */
void usb_apl_task(void)
{
USB_CTL_PARAMETER_t smp_parameter;
:
smp_parameter.setstall.complete = (USB_CB_t)NULL; /* Sets NULL */
/* Set stall */
control(usb_smp_fn, USB_CTL_P_WR_SET_STALL, (void*)&smp_parameter);
:
}
<USB_CTL_RD_NOTIFY_SET>
<USB_CTL_GET_RD_STATE>
<USB_CTL_RD_LENGTH_GET>
Please refer to example of "read" function.
<USB_CTL_WR_NOTIFY_SET>
<USB_CTL_GET_WR_STATE>
<USB_CTL_WR_LENGTH_GET>
Please refer to example of "write" function.