USBD_Audio_DrvCtrlFU_DlyManage
Description
Get or set the delay for one or all logical channels inside a cluster.
Files
usbd_audio_drv_<codec-name>.h / usbd_audio_drv_<codec-name>.c
Prototype
static CPU_BOOLEAN USBD_Audio_DrvCtrlFU_DlyManage (USBD_AUDIO_DRV *p_audio_drv, CPU_INT08U req, CPU_INT08U unit_id, CPU_INT08U log_ch_nbr, CPU_INT16U *p_dly);
Arguments
p_audio_drv
Pointer to audio driver structure.
req
Bass request:
USBD_AUDIO_REQ_GET_CUR
USBD_AUDIO_REQ_GET_RES
USBD_AUDIO_REQ_GET_MIN
USBD_AUDIO_REQ_GET_MAX
USBD_AUDIO_REQ_SET_CUR
unit_id
Feature Unit ID.
log_ch_nbr
Logical channel number.
p_dly
Pointer to the Delay request value to set or get
Endianness
p_dly
uses a little endian memory organization. Hence, you should use µC/LIB macros MEM_VAL_GET_INT16U_LITTLE()
and MEM_VAL_SET_INT16U_LITTLE()
when reading or writing the delay from/to it. This will ensure data is accessed correctly regarding your CPU endianness.
Returned Value
DEF_OK
, if NO error(s) occurred and request is supported.
DEF_FAIL
, otherwise.
Callers
Audio Class.
Implementation guidelines
- The Delay Control values range allowed for Feature Unit is:
- From 0 (0x0000) to 1023.9844ms (0xFFFF) for CUR, MIN, MAX and RES attributes.
log_ch_nbr
allows you to get or set the delay for a specific channel. Whenlog_ch_nbr
is 0, you get or set the delay for all channels. Indeed, the logical channel #0 represents the master channel and encompasses all channels.