Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Description

Configure AudioStreaming interface settings by:

  1. Allocating an AudioStreaming Settings structure.
  2. Initializing this structure with the stream information.
  3. Allocating buffers that will be used by the given AudioStreaming interface.

Files

usbd_audio.h / usbd_audio.c

Prototype

Arguments

p_stream_cfg

Pointer to general stream configuration.

p_as_if_cfg

Pointer to the AudioStreaming interface configuration structure.

p_as_api

Pointer to AudioStreaming interface API.

p_seg

Pointer to memory segment used for buffers allocation. If null pointer, buffers are allocated from the heap. Otherwise, buffers are allocated from a memory region created by the application.

terminal_ID

Terminal ID associated to this AudioStreaming interface.

corr_callback

Application callback for user-defined correction algorithm.

p_err

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

USBD_ERR_NONE
USBD_ERR_NULL_PTR
USBD_ERR_INVALID_ARG
USBD_ERR_ALLOC

Returned Value

Handle to AudioStreaming interface, if NO error(s).

0, otherwise.

Callers

Application.

Notes / Warnings

The listing  presents an example of usage using a memory segment to allocate the stream buffers. Listing  shows the same function using a general heap for the stream buffers.

  • No labels