#include "board.h"
#include "USBD_LEDs.h"
#include "USBD_Config.h"
#include "AUDDSpeakerDriver.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Detailed Description
This file contains all the specific code for the usb_audio_speaker example.
Definition in file main.c.
Define Documentation
#define BITS_BY_SLOT (16) |
SSC: Number of bits in a slot
Definition at line 129 of file main.c.
#define BUFFER_NUMBER 500 |
Number of available audio buffers.
Definition at line 118 of file main.c.
#define BUFFER_SIZE (AUDDevice_BYTESPERFRAME) |
Size of one buffer in bytes.
Definition at line 120 of file main.c.
Delay in ms for starting the DAC transmission after a frame has been received.
Definition at line 124 of file main.c.
#define I2S_SLAVE_RX_FRM_SETTING |
Value:
Definition at line 149 of file main.c.
#define I2S_SLAVE_RX_SETTING |
Value:
Definition at line 142 of file main.c.
#define I2S_SLAVE_TX_FRM_SETTING |
Value:
Definition at line 136 of file main.c.
#define I2S_SLAVE_TX_SETTING |
Value:((SSC_TCMR_CKS_TK) | \
(SSC_TCMR_CKO_NONE) | \
(SSC_TCMR_START_TF_EDGE) | \
(SSC_TCMR_STTDLY(1)) | \
(SSC_TCMR_PERIOD(0)))
Definition at line 130 of file main.c.
#define SAMPLE_RATE (48000) |
Audio sample rate
Definition at line 157 of file main.c.
#define SLOT_BY_FRAME (2) |
SSC: Number of slots in a frame
Definition at line 127 of file main.c.
TWI clock
Definition at line 155 of file main.c.
Function Documentation
void AUDDSpeakerDriver_MuteChanged |
( |
uint8_t |
channel, |
|
|
uint8_t |
muted | |
|
) |
| | |
Invoked when an audio channel get muted or unmuted. Mutes/unmutes the channel at the DAC level.
- Parameters:
-
| channel | Channel number that changed. |
| muted | Indicates the new mute status of the channel. |
Definition at line 468 of file main.c.
void AUDDSpeakerDriver_StreamSettingChanged |
( |
uint8_t |
newSetting |
) |
|
Invoked when an audio streaming interface setting changed. Actually control streaming rate.
- Parameters:
-
| newSetting | New stream (interface) setting. |
Definition at line 487 of file main.c.
usb_audio_speaker Application entry point.
Starts the driver and waits for an audio input stream to forward to the DAC.
Definition at line 526 of file main.c.
Invoked whenever a SETUP request is received from the host. Forwards the request to the standard handler.
Definition at line 457 of file main.c.
void USBDDriverCallbacks_ConfigurationChanged |
( |
unsigned char |
cfgnum |
) |
|
Invoked when the configuration of the device changes. Parse used endpoints.
- Parameters:
-
| cfgnum | New configuration number. |
Definition at line 436 of file main.c.
void USBDDriverCallbacks_InterfaceSettingChanged |
( |
unsigned char |
interface, |
|
|
unsigned char |
setting | |
|
) |
| | |
Invoked whenever the active setting of an interface is changed by the host. Reset streaming interface.
- Parameters:
-
| interface | Interface number. |
| setting | Newly active setting. |
Definition at line 447 of file main.c.