SAMV71 Xplained Ultra Software Package 1.5

AUDDSpeakerPhoneDriver.h File Reference

#include <USBRequests.h>
#include <USBDescriptors.h>
#include <AUDDescriptors.h>
#include "USBD.h"
#include <USBD_HAL.h>
#include <USBDDriver.h>

Go to the source code of this file.

Data Structures

struct  _AUDHeaderDescriptor2
struct  _AUDFeatureUnitDescriptor3
struct  _AUDDSpeakerPhoneDriverAudioControlDescriptors
struct  _AUDFormatTypeOneDescriptor1
struct  _AUDDSpeakerPhoneDriverConfigurationDescriptors

Defines

#define AUDDSpeakerPhoneDriver_MASTERCHANNEL   0
#define AUDDSpeakerPhoneDriver_LEFTCHANNEL   1
#define AUDDSpeakerPhoneDriver_RIGHTCHANNEL   2
#define AUDDSpeakerPhoneDriver_RECCHANNEL   0
#define AUDDSpeakerPhoneDriverDescriptors_CONTROL   0
#define AUDDSpeakerPhoneDriverDescriptors_STREAMING   1
#define AUDDSpeakerPhoneDriverDescriptors_STREAMINGIN   2
#define AUDDSpeakerPhoneDriverDescriptors_INPUTTERMINAL   0
#define AUDDSpeakerPhoneDriverDescriptors_OUTPUTTERMINAL   1
#define AUDDSpeakerPhoneDriverDescriptors_FEATUREUNIT   2
#define AUDDSpeakerPhoneDriverDescriptors_INPUTTERMINAL_REC   3
#define AUDDSpeakerPhoneDriverDescriptors_OUTPUTTERMINAL_REC   4
#define AUDDSpeakerPhoneDriverDescriptors_FEATUREUNIT_REC   5

Functions

struct _AUDHeaderDescriptor2 __attribute__ ((__packed__)) AUDHeaderDescriptor2
void AUDDSpeakerPhoneDriver_Initialize (const USBDDriverDescriptors *pDescriptors)
void AUDDSpeakerPhoneDriver_ConfigurationChangeHandler (uint8_t cfgnum)
void AUDDSpeakerPhoneDriver_InterfaceSettingChangedHandler (uint8_t interface, uint8_t setting)
void AUDDSpeakerPhoneDriver_RequestHandler (const USBGenericRequest *request)
uint8_t AUDDSpeakerPhoneDriver_Read (void *buffer, uint32_t length, TransferCallback callback, void *argument)
uint8_t AUDDSpeakerPhoneDriver_SetupWrite (void *pListInit, void *pDmaInit, uint16_t listSize, uint16_t delaySize, TransferCallback callback, void *argument)
uint8_t AUDDSpeakerPhoneDriver_Write (void *buffer, uint16_t length)
WEAK void AUDDSpeakerPhoneDriver_MuteChanged (uint8_t mic, uint8_t channel, uint8_t muted)
WEAK void AUDDSpeakerPhoneDriver_StreamSettingChanged (uint8_t mic, uint8_t newSetting)

Variables

AUDHeaderDescriptor header
unsigned char bInterface0
unsigned char bInterface1
AUDFeatureUnitDescriptor feature
unsigned char bmaControls [3]
unsigned char iFeature
AUDInputTerminalDescriptor inputSpeakerPhone
AUDOutputTerminalDescriptor outputSpeakerPhone
AUDFeatureUnitDescriptor3 featureSpeakerPhone
AUDInputTerminalDescriptor inputRec
AUDOutputTerminalDescriptor outputRec
AUDFeatureUnitDescriptor3 featureRec
AUDFormatTypeOneDescriptor formatType
unsigned char tSamFreq [3]
USBConfigurationDescriptor configuration
USBInterfaceDescriptor control
AUDDSpeakerPhoneDriverAudioControlDescriptors controlDescriptors
USBInterfaceDescriptor streamingOutNoIsochronous
USBInterfaceDescriptor streamingOut
AUDStreamingInterfaceDescriptor streamingOutClass
AUDFormatTypeOneDescriptor1 streamingOutFormatType
AUDEndpointDescriptor streamingOutEndpoint
AUDDataEndpointDescriptor streamingOutDataEndpoint
USBInterfaceDescriptor streamingInNoIsochronous
USBInterfaceDescriptor streamingIn
AUDStreamingInterfaceDescriptor streamingInClass
AUDFormatTypeOneDescriptor1 streamingInFormatType
AUDEndpointDescriptor streamingInEndpoint
AUDDataEndpointDescriptor streamingInDataEndpoint

Detailed Description

Purpose

Definition of a USB Audio Speakerphone Driver with two playback channels and one record channel.

Usage

  1. Enable and setup USB related pins (see pio & board.h).
  2. Implement a descriptor list using definitions
  3. Configure the USB Audio Speakerphone driver using AUDDSpeakerPhoneDriver_Initialize
  4. To get audio stream frames from host, use AUDDSpeakerPhoneDriver_Read
  5. To send audio sampling stream to host, use AUDDSpeakerPhoneDriver_Write

Definition in file AUDDSpeakerPhoneDriver.h.


Variable Documentation

unsigned char bInterface0

Id of the first grouped interface - Speaker.

Definition at line 179 of file AUDDSpeakerPhoneDriver.h.

unsigned char bInterface1

Id of the second grouped interface - Speakerphone.

Definition at line 181 of file AUDDSpeakerPhoneDriver.h.

unsigned char bmaControls[3]

Available controls for each channel.

Definition at line 194 of file AUDDSpeakerPhoneDriver.h.

USBConfigurationDescriptor configuration

Standard configuration.

Definition at line 271 of file AUDDSpeakerPhoneDriver.h.

USBInterfaceDescriptor control

Audio control interface.

Definition at line 273 of file AUDDSpeakerPhoneDriver.h.

AUDDSpeakerPhoneDriverAudioControlDescriptors controlDescriptors

Descriptors for the audio control interface.

Definition at line 275 of file AUDDSpeakerPhoneDriver.h.

AUDFeatureUnitDescriptor feature

Feature unit descriptor.

Definition at line 192 of file AUDDSpeakerPhoneDriver.h.

AUDFeatureUnitDescriptor3 featureRec

Feature unit descriptor - SpeakerPhonephone.

Definition at line 228 of file AUDDSpeakerPhoneDriver.h.

AUDFeatureUnitDescriptor3 featureSpeakerPhone

Feature unit descriptor - SpeakerPhone.

Definition at line 222 of file AUDDSpeakerPhoneDriver.h.

AUDFormatTypeOneDescriptor formatType

Format type I descriptor.

Definition at line 229 of file AUDDSpeakerPhoneDriver.h.

AUDHeaderDescriptor2 header

Header descriptor.

Header descriptor (with one slave interface).

Definition at line 177 of file AUDDSpeakerPhoneDriver.h.

unsigned char iFeature

Index of a string descriptor for the feature unit.

Definition at line 196 of file AUDDSpeakerPhoneDriver.h.

AUDInputTerminalDescriptor inputRec

Input terminal descriptor.

Definition at line 224 of file AUDDSpeakerPhoneDriver.h.

AUDInputTerminalDescriptor inputSpeakerPhone

Input terminal descriptor.

Definition at line 218 of file AUDDSpeakerPhoneDriver.h.

AUDOutputTerminalDescriptor outputRec

Output terminal descriptor.

Definition at line 226 of file AUDDSpeakerPhoneDriver.h.

AUDOutputTerminalDescriptor outputSpeakerPhone

Output terminal descriptor.

Definition at line 220 of file AUDDSpeakerPhoneDriver.h.

USBInterfaceDescriptor streamingIn

Streaming in interface descriptor.

Definition at line 293 of file AUDDSpeakerPhoneDriver.h.

AUDStreamingInterfaceDescriptor streamingInClass

Audio class descriptor for the streaming in interface.

Definition at line 295 of file AUDDSpeakerPhoneDriver.h.

AUDDataEndpointDescriptor streamingInDataEndpoint

Audio class descriptor for the streaming in endpoint.

Definition at line 301 of file AUDDSpeakerPhoneDriver.h.

AUDEndpointDescriptor streamingInEndpoint

Streaming in endpoint descriptor.

Definition at line 299 of file AUDDSpeakerPhoneDriver.h.

AUDFormatTypeOneDescriptor1 streamingInFormatType

Stream format descriptor.

Definition at line 297 of file AUDDSpeakerPhoneDriver.h.

USBInterfaceDescriptor streamingInNoIsochronous

Streaming in interface descriptor (with no endpoint, required).

Definition at line 291 of file AUDDSpeakerPhoneDriver.h.

USBInterfaceDescriptor streamingOut

Streaming out interface descriptor.

Definition at line 280 of file AUDDSpeakerPhoneDriver.h.

AUDStreamingInterfaceDescriptor streamingOutClass

Audio class descriptor for the streaming out interface.

Definition at line 282 of file AUDDSpeakerPhoneDriver.h.

AUDDataEndpointDescriptor streamingOutDataEndpoint

Audio class descriptor for the streaming out endpoint.

Definition at line 288 of file AUDDSpeakerPhoneDriver.h.

AUDEndpointDescriptor streamingOutEndpoint

Streaming out endpoint descriptor.

Definition at line 286 of file AUDDSpeakerPhoneDriver.h.

AUDFormatTypeOneDescriptor1 streamingOutFormatType

Stream format descriptor.

Definition at line 284 of file AUDDSpeakerPhoneDriver.h.

USBInterfaceDescriptor streamingOutNoIsochronous

Streaming out interface descriptor (with no endpoint, required).

Definition at line 278 of file AUDDSpeakerPhoneDriver.h.

unsigned char tSamFreq[3]

Sampling frequency in Hz.

Definition at line 231 of file AUDDSpeakerPhoneDriver.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines