示例#1
0
USBGenericDescriptor *CDCDSerialPort_ParseInterfaces(
    CDCDSerialPort *pCdcd,
    USBGenericDescriptor *pDescriptors,
    uint32_t dwLength)
{
    CDCDParseData parseData;

    parseData.pCdcd   = pCdcd;
    parseData.pIfDesc = 0;

    return USBGenericDescriptor_Parse(
                    pDescriptors, dwLength,
                    (USBDescriptorParseFunction)_Interfaces_Parse,
                    &parseData);
}
示例#2
0
/**
 * Parse USB Audio streaming information for AUDDStream instance.
 * \param pAudf        Pointer to AUDDSpeakerPhone instance.
 * \param pDescriptors Pointer to descriptor list.
 * \param dwLength     Descriptor list size in bytes.
 */
USBGenericDescriptor *AUDDSpeakerPhone_ParseInterfaces(
    AUDDSpeakerPhone *pAudf,
    USBGenericDescriptor *pDescriptors,
    uint32_t dwLength)
{
    AUDDParseData data;

    data.pAudf = pAudf;
    data.pIfDesc = 0;

    return USBGenericDescriptor_Parse(pDescriptors,
                                      dwLength,
                                      (USBDescriptorParseFunction)AUDDSpeakerPhone_Parse,
                                      (void*)&data);
}
示例#3
0
/**
 * Invoked when the configuration of the device changes. 
 * Pass endpoints and resets the mass storage function.
 * \pDescriptors Pointer to the descriptors for function configure.
 * \wLength      Length of descriptors in number of bytes.
 */
void MSDFunction_Configure(USBGenericDescriptor *pDescriptors,
                           uint16_t wLength)
{
    MSDDriver *pMsdDriver = &msdFunction;
    MSDParseData parseData;

    TRACE_INFO_WP("MSDFunCfg ");

    pMsdDriver->state = MSDD_STATE_READ_CBW;
    pMsdDriver->waitResetRecovery = 0;
    pMsdDriver->commandState.state = 0;

    parseData.pIf = 0;
    parseData.pMsdd = pMsdDriver;
    USBGenericDescriptor_Parse((USBGenericDescriptor*)pDescriptors, wLength,
                (USBDescriptorParseFunction)MSDFunction_Parse, &parseData);

    MSDFunction_Reset();
}