You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uint8_tep_in_as_intf_num;// Corresponding Standard AS Interface Descriptor (4.9.1) belonging to output terminal to which this EP belongs - 0 is invalid (this fits to UAC2 specification since AS interfaces can not have interface number equal to zero)
237
-
#endif
226
+
uint8_tep_in_alt; // Current alternate setting of TX EP
227
+
#endif
238
228
239
229
#ifCFG_TUD_AUDIO_ENABLE_EP_OUT
240
230
uint8_tep_out; // Incoming (into uC) audio data EP.
241
231
uint16_tep_out_sz; // Current size of RX EP
242
232
uint8_tep_out_as_intf_num;// Corresponding Standard AS Interface Descriptor (4.9.1) belonging to input terminal to which this EP belongs - 0 is invalid (this fits to UAC2 specification since AS interfaces can not have interface number equal to zero)
243
-
233
+
uint8_tep_out_alt; // Current alternate setting of RX EP
244
234
#ifCFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
245
235
uint8_tep_fb;// Feedback EP.
246
236
#endif
@@ -304,9 +294,6 @@ typedef struct
304
294
uint8_t*ctrl_buf;
305
295
uint8_tctrl_buf_sz;
306
296
307
-
// Current active alternate settings
308
-
uint8_t*alt_setting;// We need to save the current alternate setting this way, because it is possible that there are AS interfaces which do not have an EP!
// Look if there is an EP to be closed - for this driver, there are only 3 possible EPs which may be closed (only AS related EPs can be closed, AC EP (if present) is always open)
// USB 2.0, section 5.6.4, third paragraph, states "An isochronous endpoint must specify its required bus access period. However, an isochronous endpoint must be prepared to handle poll rates faster than the one specified."
1480
1452
// That paragraph goes on to say "An isochronous IN endpoint must return a zero-length packet whenever data is requested at a faster interval than the specified interval and data is not available."
1481
1453
// This can only be solved reliably if we load a ZLP after every IN transmission since we can not say if the host requests samples earlier than we declared! Once all samples are collected we overwrite the loaded ZLP.
// This helper function finds for a given audio function and AS interface number the index of the attached driver structure, the index of the interface in the audio function
1698
-
// (e.g. the std. AS interface with interface number 15 is the first AS interface for the given audio function and thus gets index zero), and
1699
-
// finally a pointer to the std. AS interface, where the pointer always points to the first alternate setting i.e. alternate interface zero.
// Condition modified from p_desc < p_desc_end to prevent gcc>=12 strict-overflow warning
1711
-
while (p_desc_end-p_desc>0) {
1712
-
// We assume the number of alternate settings is increasing thus we return the index of alternate setting zero!
1713
-
if (tu_desc_type(p_desc) ==TUSB_DESC_INTERFACE&& ((tusb_desc_interface_tconst*) p_desc)->bAlternateSetting==0) {
1714
-
if (((tusb_desc_interface_tconst*) p_desc)->bInterfaceNumber==itf) {
1715
-
*idxItf=tmp;
1716
-
*pp_desc_int=p_desc;
1717
-
return true;
1718
-
}
1719
-
// Increase index, bytes read, and pointer
1720
-
tmp++;
1721
-
}
1722
-
p_desc=tu_desc_next(p_desc);
1723
-
}
1724
-
}
1725
-
return false;
1726
-
}
1727
-
1728
-
// This helper function finds for a given AS interface number the index of the attached driver structure, the index of the interface in the audio function
1729
-
// (e.g. the std. AS interface with interface number 15 is the first AS interface for the given audio function and thus gets index zero), and
1730
-
// finally a pointer to the std. AS interface, where the pointer always points to the first alternate setting i.e. alternate interface zero.
Copy file name to clipboardExpand all lines: src/class/audio/audio_device.h
-15Lines changed: 0 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -51,21 +51,6 @@
51
51
#endif
52
52
#endif
53
53
54
-
// Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces
55
-
#ifndefCFG_TUD_AUDIO_FUNC_1_N_AS_INT
56
-
#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
57
-
#endif
58
-
#ifCFG_TUD_AUDIO>1
59
-
#ifndefCFG_TUD_AUDIO_FUNC_2_N_AS_INT
60
-
#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
61
-
#endif
62
-
#endif
63
-
#ifCFG_TUD_AUDIO>2
64
-
#ifndefCFG_TUD_AUDIO_FUNC_3_N_AS_INT
65
-
#error You must tell the driver the number of Standard AS Interface Descriptors you have defined in the audio function descriptor!
66
-
#endif
67
-
#endif
68
-
69
54
// Size of control buffer used to receive and send control messages via EP0 - has to be big enough to hold your biggest request structure e.g. range requests with multiple intervals defined or cluster descriptors
70
55
#ifndefCFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ
71
56
#error You must define an audio class control request buffer size!
0 commit comments