\r
#include "Audio.h"\r
\r
-void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo)\r
+void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
- if (USB_ControlRequest.wIndex != AudioInterfaceInfo->StreamingInterfaceNumber)\r
+ if (USB_ControlRequest.wIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber)\r
return;\r
\r
switch (USB_ControlRequest.bRequest)\r
{\r
Endpoint_ClearSETUP();\r
\r
- AudioInterfaceInfo->InterfaceEnabled = (USB_ControlRequest.wValue != 0);\r
+ AudioInterfaceInfo->State.InterfaceEnabled = (USB_ControlRequest.wValue != 0);\r
\r
while (!(Endpoint_IsINReady()));\r
Endpoint_ClearIN();\r
}\r
}\r
\r
-bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)\r
+bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* AudioInterfaceInfo)\r
{\r
- if (AudioInterfaceInfo->DataINEndpointNumber)\r
+ if (AudioInterfaceInfo->Config.DataINEndpointNumber)\r
{\r
- if (!(Endpoint_ConfigureEndpoint(AudioInterfaceInfo->DataINEndpointNumber, EP_TYPE_ISOCHRONOUS,\r
- ENDPOINT_DIR_IN, AudioInterfaceInfo->DataINEndpointSize,\r
+ if (!(Endpoint_ConfigureEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber, EP_TYPE_ISOCHRONOUS,\r
+ ENDPOINT_DIR_IN, AudioInterfaceInfo->Config.DataINEndpointSize,\r
ENDPOINT_BANK_DOUBLE)))\r
{\r
return false;\r
}\r
}\r
\r
- if (AudioInterfaceInfo->DataOUTEndpointNumber)\r
+ if (AudioInterfaceInfo->Config.DataOUTEndpointNumber)\r
{\r
- if (!(Endpoint_ConfigureEndpoint(AudioInterfaceInfo->DataOUTEndpointNumber, EP_TYPE_ISOCHRONOUS,\r
- ENDPOINT_DIR_OUT, AudioInterfaceInfo->DataOUTEndpointSize,\r
+ if (!(Endpoint_ConfigureEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber, EP_TYPE_ISOCHRONOUS,\r
+ ENDPOINT_DIR_OUT, AudioInterfaceInfo->Config.DataOUTEndpointSize,\r
ENDPOINT_BANK_DOUBLE)))\r
{\r
return false;\r
return true;\r
}\r
\r
-void Audio_Device_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo)\r
+void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
\r
}\r
return Sample;\r
}\r
\r
-void Audio_Device_WriteSample8(int8_t Sample)\r
+void Audio_Device_WriteSample8(const int8_t Sample)\r
{\r
Endpoint_Write_Byte(Sample);\r
\r
Endpoint_ClearIN();\r
}\r
\r
-void Audio_Device_WriteSample16(int16_t Sample)\r
+void Audio_Device_WriteSample16(const int16_t Sample)\r
{\r
Endpoint_Write_Word_LE(Sample);\r
\r
Endpoint_ClearIN();\r
}\r
\r
-void Audio_Device_WriteSample24(int32_t Sample)\r
+void Audio_Device_WriteSample24(const int32_t Sample)\r
{\r
Endpoint_Write_Byte(Sample >> 16);\r
Endpoint_Write_Word_LE(Sample);\r
Endpoint_ClearIN();\r
}\r
\r
-bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_t* AudioInterfaceInfo)\r
+bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
- Endpoint_SelectEndpoint(AudioInterfaceInfo->DataOUTEndpointNumber);\r
+ Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataOUTEndpointNumber);\r
return Endpoint_IsOUTReceived();\r
}\r
\r
-bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_t* AudioInterfaceInfo)\r
+bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
- Endpoint_SelectEndpoint(AudioInterfaceInfo->DataINEndpointNumber);\r
+ Endpoint_SelectEndpoint(AudioInterfaceInfo->Config.DataINEndpointNumber);\r
return Endpoint_IsINReady();\r
}\r
\r