SAMV71 Xplained Ultra Software Package 1.5

Usbd_aud_fun
[USB Stack Device]

Collaboration diagram for Usbd_aud_fun:

Data Structures

struct  AUDDFunction
 Audio speaker driver struct. More...

Modules

 USBD Audio Function definitions

Functions

void AUDDFunction_Initialize (USBDDriver *pUsbd, uint8_t bInterface)
void AUDDFunction_Configure (USBGenericDescriptor *pDescriptors, uint16_t wLength)
void AUDDFunction_InterfaceSettingChangedHandler (uint8_t interface, uint8_t setting)
uint32_t AUDDFunction_RequestHandler (const USBGenericRequest *request)
uint8_t AUDDFunction_Read (void *buffer, uint32_t length, TransferCallback callback, void *argument)
uint8_t AUDDFunction_SetupWrite (void *pListInit, void *pDmaInit, uint16_t listSize, uint16_t delaySize, TransferCallback callback, void *argument)
uint8_t AUDDFunction_Write (void *buffer, uint16_t length)
void AUDDFunction_MuteChanged (uint8_t idMic, uint8_t ch, uint8_t mute)
void AUDDFunction_StreamSettingChanged (uint8_t idMic, uint8_t setting)

Function Documentation

void AUDDFunction_Configure ( USBGenericDescriptor *  pDescriptors,
uint16_t  wLength 
)

Configure function with expected descriptors and start functionality. Usually invoked when device is configured. Pointer to the descriptors for function configure. Length of descriptors in number of bytes.

void AUDDFunction_Initialize ( USBDDriver pUsbd,
uint8_t  bInterface 
)

Initializes an USB audio speaker device driver, as well as the underlying USB controller.

void AUDDFunction_InterfaceSettingChangedHandler ( uint8_t  interface,
uint8_t  setting 
)

Invoked whenever the active setting of an interface is changed by the host. Changes the status of the third LED accordingly.

Parameters:
interface Interface number.
setting Newly active setting.
void AUDDFunction_MuteChanged ( uint8_t  mic,
uint8_t  channel,
uint8_t  muted 
)

Invoked when an audio channel get muted or unmuted. Mutes/unmutes the channel at the DAC level.

Parameters:
mic Microphone/Speaker stream changed.
channel Channel number that changed.
muted Indicates the new mute status of the channel.

Invoked when an audio channel get muted or unmuted. Mute/unmute the channel at the DAC level.

Parameters:
mic Microphone/Speaker stream changed.
channel Channel number that changed.
muted Indicates the new mute status of the channel.

Definition at line 620 of file main.c.

uint8_t AUDDFunction_Read ( void *  buffer,
uint32_t  length,
TransferCallback  callback,
void *  argument 
)

Reads incoming audio data sent by the USB host into the provided buffer. When the transfer is complete, an optional callback function is invoked.

Parameters:
buffer Pointer to the data storage buffer.
length Size of the buffer in bytes.
callback Optional callback function.
argument Optional argument to the callback function.
Returns:
<USBD_STATUS_SUCCESS> if the transfer is started successfully; otherwise an error code.
uint32_t AUDDFunction_RequestHandler ( const USBGenericRequest request  ) 

Handles AUDIO-specific USB requests sent by the host

Parameters:
request Pointer to a USBGenericRequest instance.
Returns:
USBRC_SUCCESS if request is handled.
uint8_t AUDDFunction_SetupWrite ( void *  pListInit,
void *  pDmaInit,
uint16_t  listSize,
uint16_t  delaySize,
TransferCallback  callback,
void *  argument 
)

Initialize Frame List for sending audio data.

Parameters:
pListInit Pointer to the allocated list for audio write.
pDmaInit Pointer to the allocated DMA descriptors for autio write (if DMA supported).
listSize Circular list size.
delaySize Start transfer after delaySize frames filled in.
callback Optional callback function for transfer.
argument Optional callback argument.
Returns:
USBD_STATUS_SUCCESS if setup successfully; otherwise an error code.
void AUDDFunction_StreamSettingChanged ( uint8_t  mic,
uint8_t  newSetting 
)

Invoked when an audio streaming interface setting changed. Actually control streaming rate.

Parameters:
mic 1 to indicate microphone mute changed.
newSetting New stream (interface) setting.

Invoked when an audio streaming interface setting changed. Audio stream is automatically rosetted. Actually control streaming rate.

Parameters:
mic Microphone/Speaker stream changed.
newSetting New stream (interface) setting.

Definition at line 642 of file main.c.

Here is the call graph for this function:

uint8_t AUDDFunction_Write ( void *  buffer,
uint16_t  length 
)

Add frame buffer to audio sending list. Pointer to data frame to send. Frame size in bytes.

Returns:
USBD_STATUS_SUCCESS if the transfer is started successfully; otherwise an error code.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines