STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
usbd_audio_if.c
Go to the documentation of this file.
1 
28 /* Includes ------------------------------------------------------------------*/
29 #include "usbd_audio_if.h"
31 
32 /* Private typedef -----------------------------------------------------------*/
33 /* Private define ------------------------------------------------------------*/
34 /* Private macro -------------------------------------------------------------*/
35 /* Private function prototypes -----------------------------------------------*/
36 static int8_t Audio_Init(uint32_t AudioFreq, uint32_t Volume, uint32_t options);
37 static int8_t Audio_DeInit(uint32_t options);
38 static int8_t Audio_PlaybackCmd(uint8_t* pbuf, uint32_t size, uint8_t cmd);
39 static int8_t Audio_VolumeCtl(uint8_t vol);
40 static int8_t Audio_MuteCtl(uint8_t cmd);
41 static int8_t Audio_PeriodicTC(uint8_t cmd);
42 static int8_t Audio_GetState(void);
43 
44 /* Private variables ---------------------------------------------------------*/
45 
47  Audio_Init,
48  Audio_DeInit,
49  Audio_PlaybackCmd,
50  Audio_VolumeCtl,
51  Audio_MuteCtl,
52  Audio_PeriodicTC,
53  Audio_GetState,
54 };
55 
56 /* Private functions ---------------------------------------------------------*/
57 
65 static int8_t Audio_Init(uint32_t AudioFreq, uint32_t Volume, uint32_t options)
66 {
67 #if 0
68  BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_AUTO, Volume, AudioFreq);
69 
70  /* Update the Audio frame slot configuration to match the PCM standard instead of TDM */
72 #endif
73 
74  return 0;
75 }
76 
82 static int8_t Audio_DeInit(uint32_t options)
83 {
84 #if 0
86 #endif
87  return 0;
88 }
89 
97 static int8_t Audio_PlaybackCmd(uint8_t *pbuf, uint32_t size, uint8_t cmd)
98 {
99  switch(cmd)
100  {
101  case AUDIO_CMD_START:
102 #if 0
103  BSP_AUDIO_OUT_Play((uint16_t *)pbuf, 2*size);
104 #endif
105  break;
106 
107  case AUDIO_CMD_PLAY:
108 #if 0
109  BSP_AUDIO_OUT_ChangeBuffer((uint16_t *)pbuf, 2*size);
110 #endif
111  break;
112  }
113  return 0;
114 }
115 
121 static int8_t Audio_VolumeCtl(uint8_t vol)
122 {
124  return 0;
125 }
126 
132 static int8_t Audio_MuteCtl(uint8_t cmd)
133 {
135  return 0;
136 }
137 
143 static int8_t Audio_PeriodicTC(uint8_t cmd)
144 {
145  return 0;
146 }
147 
153 static int8_t Audio_GetState(void)
154 {
155  return 0;
156 }
157 
158 #if 0
159 
165 {
167 }
168 
175 {
176  //no need to call
177  //USBD_AUDIO_Sync(&USBD_Device, AUDIO_OFFSET_HALF);
178 }
179 #endif
180 
181 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
Manages the DMA Half Transfer complete interrupt.
Definition: AudioPlayer.c:214
void BSP_AUDIO_OUT_ChangeBuffer(uint16_t *pData, uint16_t Size)
Sends n-Bytes on the SAI interface.
void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
Calculates the remaining file size and new position of the pointer.
Definition: AudioPlayer.c:202
#define CODEC_PDWN_SW
Definition: wm8994.h:94
uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
Stops audio playing and Power down the Audio Codec.
USBD_AUDIO_ItfTypeDef USBD_AUDIO_fops
Definition: usbd_audio_if.c:46
void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
Updates the Audio frame slot configuration.
#define OUTPUT_DEVICE_AUTO
Definition: wm8994.h:77
uint8_t BSP_AUDIO_OUT_SetVolume(uint8_t Volume)
Controls the current audio volume level.
uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
Definition: pbuf.h:108
uint8_t BSP_AUDIO_OUT_Play(uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
uint8_t BSP_AUDIO_OUT_SetMute(uint32_t Cmd)
Enables or disables the MUTE mode by software.
#define CODEC_AUDIOFRAME_SLOT_02
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset)
USBD_AUDIO_SOF handle SOF event.
Definition: usbd_audio.c:582
This file contains the common defines and functions prototypes for the stm32f769i_discovery_audio.c driver.
USBD_HandleTypeDef USBD_Device
Definition: usbd_main.c:10