USBD_Audio_SU_Assoc

Description

Specify the entities ID connected to this Selector Unit.

Files

usbd_audio.h / usbd_audio.c

Prototype

void  USBD_Audio_SU_Assoc (CPU_INT08U   class_nbr,
                           CPU_INT08U   su_id,
                           CPU_INT08U  *p_src_entity_id,
                           CPU_INT08U   nbr_input_pins,
                           USBD_ERR    *p_err);


Arguments

class_nbr

Class instance number.

su_id

Selector Unit ID.

p_src_entity_id

Pointer to table containing IDs of Units and/or Terminals to which Input Pins of this Selector Unit are connected.

nbr_input_pins

Number of input pins.

p_err

Pointer to variable that will receive the return error code from this function.

USBD_ERR_NONE
USBD_ERR_CLASS_INVALID_NBR 
USBD_ERR_NULL_PTR
USBD_ERR_INVALID_ARG

Returned Value

None.

Callers

Application.

Notes / Warnings

The Listing - USBD_Audio_SU_Assoc() Example Usage presents an example of usage:

Listing - USBD_Audio_SU_Assoc() Example Usage
CPU_INT08U  SU12_SrcIdTbl[] = {                                 (1)
    0u,
    0u
};

SU12_SrcIdTbl[0u] = FU6_ID;                                     (2)
SU12_SrcIdTbl[1u] = FU9_ID;

USBD_Audio_SU_Assoc(audio_nbr,                                  (3)
                    SU12_ID,
                   &SU12_SrcIdTbl[0u],
                    USBD_SU12_Cfg.NbrInPins,
                   &err);
if (err != USBD_ERR_NONE) {
    /* $$$$ Handle the error. */
}

(1) Declare a table that will contain the ID of terminals and/or units connected to the input pins of the Selector Unit. The table size correspond to the number of inputs pins of the Selector Unit.

(2) Initialize the table with all the IDs obtained when calling the functions USBD_Audio_XX_Add(). In this example, two Feature units are connected to the Selector Unit.

(3) Pass the table address and the number of input pins of the Selector Unit to the function.