...
usbd_audio_drv_<codec-name>.h / usbd_audio_drv_<codec-name>.c
Prototype
Code Block | ||
---|---|---|
| ||
static CPU_BOOLEAN USBD_Audio_DrvAS_SamplingFreqManage (USBD_AUDIO_DRV *p_audio_drv,
CPU_INT08U terminal_id_link,
CPU_BOOLEAN set_en,
CPU_INT32U *p_sampling_freq); |
Arguments
p_audio_drv
Pointer to audio driver structure.
...
This listing shows an example usage of this function.
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
static CPU_INT32U ActualSamplingFreq = USBD_AUDIO_FMT_TYPE_I_SAMFREQ_48KHZ;
static CPU_BOOLEAN USBD_Audio_DrvAS_SamplingFreqManage (USBD_AUDIO_DRV *p_audio_drv,
CPU_INT08U terminal_id_link,
CPU_BOOLEAN set_en,
CPU_INT32U *p_sampling_freq)
{
CPU_BOOLEAN req_ok = DEF_FAIL;
(void)&p_audio_drv;
(void)&terminal_id_link;
/* ----------------------- GET ------------------------ */
if (set_en == DEF_FALSE) { (1)
*p_sampling_freq = ActualSamplingFreq; (2)
req_ok = DEF_OK;
/* ----------------------- SET ------------------------ */
} else {
if ((*p_sampling_freq == USBD_AUDIO_FMT_TYPE_I_SAMFREQ_44_1KHZ) || (3)
(*p_sampling_freq == USBD_AUDIO_FMT_TYPE_I_SAMFREQ_48KHZ)) {
ActualSamplingFreq = *p_cur_sampling_freq; (4)
req_ok = DEF_OK;
}
}
return (req_ok); (5)
} |
Panel | ||
---|---|---|
| ||
(1) Based on argument (2) If (3) If (4) If the sampling frequency is supported, update the sampling frequency used and set the flag indicating that the request has been correctly processed is set to (5) Return status of the function. |