USBD_Audio_OS_Init

Description

Initialize the audio class OS layer.

Files

usbd_audio_os.h / usbd_audio_os.c

Prototype

void  USBD_Audio_OS_Init (CPU_INT16U   msg_qty,
                          USBD_ERR    *p_err);


Arguments

msg_qty

Maximum quantity of messages for playback and record tasks' queues.

p_err

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

USBD_ERR_NONE
USBD_ERR_OS_INIT_FAIL

Returned Value

None.

Callers

Audio Class.

Implementation guidelines

  1. This function is called only once by the audio class. It usually performs the following operations:
    1. Create one queue for the playback task and one for the record task that can contain up to msg_qty.
    2. Create a task used for playback and another for record. If the task creation fails, set p_err to USBD_ERR_OS_INIT_FAIL and return.
    3. Set p_err to USBD_ERR_NONE if the initialization proceeded as expected.