Hi all
I want to use the FRDM-KL46 Board as usb to I2S converter.
I've started with the audio generator example code and tried to change the descriptor.c to be both, speaker and mic
(see the code attached), no succes :-(
I'm on KDS 3.0 with ksdk 1.3
Best Regards
Dmitri Becker
Original Attachment has been moved to: usb_descriptor.c.zip
Original Attachment has been moved to: USB_Audio_fd.zip
已解决! 转到解答。
Hello Dimitri,
These structures are accesible when host requests a USB_Desc_Get_Entity request, so they are for information purposal.
I hope this can help you,
Best Regards,
Isaac
I've changed the descriptor, so my device is now play/record device.
There is still an error message:
"too many audio endpoint for the class driver" on the serial.
I've initialized only 2 Endpoints (decriptor-file attached above)Please help me understand, what i've done wrong!
Other question is:
Do I need to create separate task (and separate Callback function) for each read/write, or can it be done in one task?
Regards
Hi Isaac
I'm using ksdk 1.3, no mqx.
The audio generator example code for the FRDM-46z board
The project file is attached in the first post.
I have no idea regarding USB stack version, I simply use the version attached in the example project.
My problem is understanding, how to make the data structure of the usb-descriptor.c full duplex ready
Regards
Dimitri
Hello Dimitri,
There is a document that talks about different USB Audio topologies that are compliant with USB specifications. In this document you can find some examples in how to define your descriptor according to desired topology.
I recommend you to review this document and identify which topology you will be using.
Also, there is macro definition in usb_audio_config.h that limits endpoint usage to 1, so you should change this macro in order to add more endpoints to your application.
#define MAX_AUDIO_CLASS_EP_NUM (0x01)
I hope this can help you,
Best Regards,
Isaac
Hi Isaac.
Thank you, I'll change the define to 2.
I have no problems with USB descriptors, same descriptors are working with other platform.
BUT the data structure in the descriptor.c is quite confusing...
ep, ut, usb_if ... all this structs
Would like to know, how to change them according to my descriptor configuration.
Hello Dimitri,
These structures are accesible when host requests a USB_Desc_Get_Entity request, so they are for information purposal.
I hope this can help you,
Best Regards,
Isaac
Hi Isaac
This is what i don't understand.
All this things are already specified in the descriptor, The Host has the config descriptor with all needed information,
so why making it one more time ? :-) What is the reason for this structures?
Ok, so I have 2 Endpoints (actually one but send and receive with same number), 3 interfaces and 5 audio units.
This code should be Ok, right?
****************************************************************************************************************************************************************************
usb_ep_struct_t ep[AUDIO_DESC_ENDPOINT_COUNT] = // 2 two endpoints with same number
{
{
AUDIO_ENDPOINT, // Endpoint Number
USB_ISOCHRONOUS_PIPE,
USB_SEND,
FS_ISO_OUT_ENDP_PACKET_SIZE
},
{
AUDIO_ENDPOINT,
USB_ISOCHRONOUS_PIPE,
USB_RECV,
FS_ISO_OUT_ENDP_PACKET_SIZE
}
};
usb_endpoints_t usb_desc_ep =
{
(AUDIO_DESC_ENDPOINT_COUNT),
ep
};
static usb_if_struct_t usb_if[3];
usb_class_struct_t usb_dec_class =
{
USB_CLASS_AUDIO,
{
3,
usb_if
}
};
/* *********************************************************************
* definition a struct of Input/output or Feature Unit
************************************************************************ */
audio_ut_struct_t ut[AUDIO_UNIT_COUNT] =
{
{ 0x01, AUDIO_CONTROL_INPUT_TERMINAL },
{ 0x02, AUDIO_CONTROL_FEATURE_UNIT },
{ 0x03, AUDIO_CONTROL_OUTPUT_TERMINAL },
{ 0x04, AUDIO_CONTROL_INPUT_TERMINAL },
{ 0x05, AUDIO_CONTROL_OUTPUT_TERMINAL }//,
};
audio_units_struct_t usb_audio_unit =
{
AUDIO_UNIT_COUNT, // =5
ut
};