USBD_Audio_DrvCtrlMU_CtrlManage

Description

Get or set the mix status for a certain logical input and output channels couple.

Files

usbd_audio_drv_<codec-name>.h / usbd_audio_drv_<codec-name>.c

Prototype

static  CPU_BOOLEAN  USBD_Audio_DrvCtrlMU_CtrlManage (USBD_AUDIO_DRV  *p_audio_drv,
                                                      CPU_INT08U       req,
                                                      CPU_INT08U       unit_id,
                                                      CPU_INT08U       log_in_ch_nbr,
                                                      CPU_INT08U       log_out_ch_nbr,
                                                      CPU_INT16U      *p_ctrl);


Arguments

p_audio_drv

Pointer to audio driver structure.

req

Mixer status 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

Mixer Unit ID.

log_in_ch_nbr

Logical channel In number.

log_out_ch_nbr

Logical channel Out number.

p_ctrl

Pointer to the mixer control request value to get or set.

Endianness

p_ctrl 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 mixing control value 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

  1. The Mixer Control values range allowed for Mixer Unit is:
    1. From +127.9961 dB (0x7FFF) down to -127.9961 dB (0x8001) for CUR, MIN, and MAX attributes.
    2. From 1/256 dB (0x0001) to +127.9961 dB (0x7FFF) for RES attribute.