Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 96 of 157
Apr 1, 2013
R_usb_hstd_ChkPipeInfo
Setting the pipe information tabl
Format
uint16_t R_usb_hstd_ChkPipeInfo(uint16_t speed, uint16_t *EpTbl, uint8_t *Descriptor)
Argument
speed Device Speed
EpTbl Pipe Information Table
Descriptor Endpoint Descriptor
Return Value
USB_DIR_H_IN Set the IN endpoint.
USB_DIR_H_OUT Set the OPUT endpoint.
USB_ERROR Failure
Description
Analyze the endpoint descriptor and create the pipe information table for a pipe.
Fields where information is updated are as follows:
USB_TYPFIELD USB_BULK .or. USB_INT
USB_SHTNAKFIELD USB_SHTNAKON(USB_TYPFIELD == USB_DIR_H_IN)
USB_DIRFIELD USB_DIR_H_IN .or. USB_DIR_H_OUT
USB_EPNUMFIELD Endpoint number shown in the endpoint descriptor
USB_IITVFIELD Interval counter (specified by 2 to the nth power)
Note
1. Refer to Chapter
5.9.2 for the pipe information table.
2. Set the interval counter by 2 to the nth.
3. Call this function after getting the configuration descriptor during the enumeration processing when using
ANSI,
4. Call this function from the callback function for the class check when using non-ANSI.
Example
void usb_hsmpl_pipe_info(uint8_t *table)
{
usb_er_t retval = USB_YES;
uint16_t *ptr;
/* Check Endpoint Descriptor */
ptr = g_usb_hsmpl_DefEpTbl;
for (; table[1] == USB_DT_ENDPOINT, retval != USB_ERROR; table += table[0],
ptr += USB_EPL)
{
retval = R_usb_hstd_ChkPipeInfo(speed, &ptr, table);
}
return retval;
}