Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 141 of 157
Apr 1, 2013
R_usb_cstd_PgetBlk
Allocates an area for storing a request information table.
Format
USB_ER_t R_usb_cstd_PgetBlk(uint8_t id, USB_UTR_t **blk)
Argument
id Task ID of allocating area
**blk Pointer to allocating area
Return Value
USB_E_OK The area is allocated
USB_E_ERROR Task ID is not set
The area is not secured
Description
This function secures an area for storing a message. The function allocates 40 bytes per block.
The function is defined in the R_USB_PGET_BLK macro.
Note
Please call the sceduler macro that this function is defined from the user application or the class drive.
Example
void usb_smp_task()
{
USB_ER_t err;
USB_PCDINFO_t *pp;
/* Allocating the are that the message is stored.*/
err = R_USB_PGET_BLK(USB_SMP_MPL, &p_blf);
if(err == USB_OK)
{
/* Setting Message */
pp = (USB_CLSINFO_t*)p_blf;
pp->msghead = (USB_MH_t)NULL;
pp->msginfo = USB_SMP_REQ;
pp->keyword = keyword;
pp->complete = complete;
pp->ip = ptr->ip;
pp->ipp = ptr->ipp;
/* Send the message */
err = R_USB_SND_MSG(USB_SMP_MBX, (USB_MSG_t*)cp);
:
}
else
{
/* Error Processing */
}
}