1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   Audio Class                                                         */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /* Include necessary system files.  */
25 
26 #define UX_SOURCE_CODE
27 
28 #include "ux_api.h"
29 #include "ux_host_class_audio.h"
30 #include "ux_host_stack.h"
31 
32 
33 /**************************************************************************/
34 /*                                                                        */
35 /*  FUNCTION                                               RELEASE        */
36 /*                                                                        */
37 /*    _ux_host_class_audio_interrupt_notification         PORTABLE C      */
38 /*                                                           6.1.12       */
39 /*  AUTHOR                                                                */
40 /*                                                                        */
41 /*    Chaoqiong Xiao, Microsoft Corporation                               */
42 /*                                                                        */
43 /*  DESCRIPTION                                                           */
44 /*                                                                        */
45 /*    This function receives a completion callback on a interrupt         */
46 /*    transfer request.                                                   */
47 /*                                                                        */
48 /*  INPUT                                                                 */
49 /*                                                                        */
50 /*    transfer_request                      Pointer to transfer request   */
51 /*                                                                        */
52 /*  OUTPUT                                                                */
53 /*                                                                        */
54 /*    None                                                                */
55 /*                                                                        */
56 /*  CALLS                                                                 */
57 /*                                                                        */
58 /*    (ux_host_class_audio_interrupt_callback)                            */
59 /*                                          App notification callback     */
60 /*    _ux_host_stack_transfer_request       Issue the transfer request    */
61 /*                                                                        */
62 /*  CALLED BY                                                             */
63 /*                                                                        */
64 /*    HCD                                                                 */
65 /*                                                                        */
66 /*  RELEASE HISTORY                                                       */
67 /*                                                                        */
68 /*    DATE              NAME                      DESCRIPTION             */
69 /*                                                                        */
70 /*  07-29-2022     Chaoqiong Xiao           Initial Version 6.1.12        */
71 /*                                                                        */
72 /**************************************************************************/
_ux_host_class_audio_interrupt_notification(UX_TRANSFER * transfer_request)73 VOID  _ux_host_class_audio_interrupt_notification(UX_TRANSFER *transfer_request)
74 {
75 
76 UX_HOST_CLASS_AUDIO_AC *ac;
77 
78     /* Check status.  */
79     if (transfer_request -> ux_transfer_request_completion_code != UX_SUCCESS)
80         return;
81 
82     /* Get AC instance.  */
83     ac = (UX_HOST_CLASS_AUDIO_AC *)transfer_request -> ux_transfer_request_class_instance;
84 
85     /* Invoke application callback.  */
86     if (ac -> ux_host_class_audio_interrupt_callback)
87     {
88         ac -> ux_host_class_audio_interrupt_callback(ac,
89                         transfer_request -> ux_transfer_request_data_pointer,
90                         transfer_request -> ux_transfer_request_actual_length,
91                         ac -> ux_host_class_audio_interrupt_callback_arg);
92     }
93 
94     /* Issue another request again.  */
95     _ux_host_stack_transfer_request(transfer_request);
96 }
97