Functions

group group_usb_dev_audio_functions

Functions

cy_en_usb_dev_status_t Cy_USB_Dev_Audio_Init(void const *config, cy_stc_usb_dev_audio_context_t *context, cy_stc_usb_dev_context_t *devContext)

Initializes the Audio class.

This function must be called to enable USB Device Audio functionality.

Return

Status code of the function execution cy_en_usb_dev_status_t.

Parameters
  • config: Pass NULL as an argument (left for future purposes).

  • context: The pointer to the context structure cy_stc_usb_dev_audio_context_t allocated by the user. The structure is used during the Audio Class operation for internal configuration and data retention. The user must not modify anything in this structure.

  • devContext: The pointer to the USB Device context structure cy_stc_usb_dev_context_t.

__STATIC_INLINE void Cy_USB_Dev_Audio_RegisterUserCallback (cy_cb_usb_dev_request_received_t requestReceivedHandle, cy_cb_usb_dev_request_cmplt_t requestCompletedHandle, cy_stc_usb_dev_audio_context_t *context)

Registers the user callbacks to handle Audio class requests.

Parameters
  • requestReceivedHandle: The pointer to a callback function. This function is called when setup packet was received from the USB Host but was not recognized. Therefore this might require Audio class processing. To remove the callback function, pass a NULL as the function pointer.

  • requestCompletedHandle: The pointer to a callback function. This function is called when the USB Device received data from the USB Host as part of current request processing. The requestReceivedHandle function must enable notification to trigger this event. This makes sense only when class request processing requires a data stage. To remove the callback function, pass a NULL as the function pointer.

  • context: The pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the Audio Class operation for internal configuration and data retention. The user must not modify anything in this structure.

__STATIC_INLINE cy_stc_usb_dev_class_t * Cy_USB_Dev_Audio_GetClass (cy_stc_usb_dev_audio_context_t *context)

Returns pointer to the class structure for Audio class.

Return

Status pointer to the class cy_stc_usb_dev_class_t.

Parameters
  • context: The pointer to the context structure cy_stc_usb_dev_context_t allocated by the user. The structure is used during the Audio Class operation for internal configuration and data retention. The user must not modify anything in this structure.