...
usbd_audio_drv_<codec-name>.h / usbd_audio_drv_<codec-name>.c
Prototype
Code Block | ||
---|---|---|
| ||
static CPU_BOOLEAN USBD_Audio_DrvStreamStop (USBD_AUDIO_DRV *p_audio_drv,
CPU_INT08U terminal_id_link); |
Arguments
p_audio_drv
Pointer to audio driver structure.
...
This listing shows an example usage of this function handling record and playback streams.
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
static CPU_BOOLEAN USBD_Audio_DrvStreamStop (USBD_AUDIO_DRV *p_audio_drv,
CPU_INT08U terminal_id_link)
{
if (terminal_id_link == Mic_OT_USB_IN_ID) { (1)
/* $$$$ Abort ongoing DMA transfer(s). */ (2)
/* $$$$ Disable record operations on audio chip. */ (3)
} else if (terminal_id_link == Speaker_IT_USB_OUT_ID) {
/* $$$$ Abort ongoing DMA transfer(s). */ (2)
/* $$$$ Disable playback operations on audio chip. */ (3)
}
return (DEF_OK);
} |
Panel |
---|
(1) If the function handles different streams, the terminal ID allows to differentiate them. (2) Abort ongoing DMA transfer(s). The buffer associated to the DMA transfer may be freed with (3) You may have to disable the record or playback operations on the audio chip. It could be disabling some clocks, disabling some modules, etc. It may require sending a series of I2C commands for registers access, |