66 static unsigned long sAudioHeartbeat = 0;
104 xHigherPriorityTaskWoken =
pdFALSE;
119 *out_BufAddr = BufferCtl.
buff;
120 return sizeof(BufferCtl.
buff);
237 static int initDone = 0;
251 static int oState = 0;
279 dbuf = &BufferCtl.
buff[0];
284 memcpy(dbuf + oIdx, buf, len);
307 if ((oIdx + len) <=
sizeof(BufferCtl.
buff))
309 memcpy(&BufferCtl.
buff[oIdx], buf, len);
323 if (oIdx >= (
sizeof(BufferCtl.
buff) / 2 + 192))
330 if (oIdx >=
sizeof(BufferCtl.
buff))
361 memset(BufferCtl.
buff, 0x00,
sizeof(BufferCtl.
buff));
void BSP_AUDIO_OUT_HalfTransfer_CallBack(void)
Manages the DMA Half Transfer complete interrupt.
#define AUDIO_OUT_BUFFER_SIZE
int AUDIO_PLAYER_GetBuffer(uint8_t **out_BufAddr)
void BSP_AUDIO_OUT_TransferComplete_CallBack(void)
Calculates the remaining file size and new position of the pointer.
AUDIO_ErrorTypeDef AUDIO_PLAYER_Process(void)
Manages Audio process.
AUDIO_ErrorTypeDef AUDIO_PLAYER_Stop(void)
Stops Audio streaming.
uint8_t BSP_AUDIO_OUT_Stop(uint32_t Option)
Stops audio playing and Power down the Audio Codec.
int AUDIO_PLAYER_GetClock(void)
SemaphoreHandle_t xSemaphoreAudio
void AUDIO_Player_CpyBuf(uint8_t *buf)
Copy USB input buffer to SAI output buffer.
void BSP_AUDIO_OUT_SetAudioFrameSlot(uint32_t AudioFrameSlot)
Updates the Audio frame slot configuration.
uint8_t buff[AUDIO_OUT_BUFFER_SIZE]
uint8_t BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
Configures the audio peripherals.
void AUDIO_Player_IncHeartbeat(void)
Increment the audio reception counter (heartbeat)
#define OUTPUT_DEVICE_HEADPHONE
void AUDIO_Player_UDANTERestart(void)
Restart and sync audio for Network Audio.
#define AUDIO_TOTAL_BUF_SIZE
void AUDIO_PLAYER_Restart(void)
#define portYIELD_FROM_ISR(x)
int AUDIO_PLAYER_GetState(void)
AUDIO_ErrorTypeDef AUDIO_PLAYER_Start(void)
Starts Audio streaming.
#define CODEC_AUDIOFRAME_SLOT_13
#define OUTPUT_DEVICE_SPEAKER
AUDIO_ErrorTypeDef AUDIO_PLAYER_Init(int outSelection, int sampleFreq)
Initializes Audio Interface.
uint8_t BSP_AUDIO_OUT_Play(uint16_t *pBuffer, uint32_t Size)
Starts playing audio stream from a data buffer for a determined size.
#define xSemaphoreTake(xSemaphore, xBlockTime)
#define CODEC_AUDIOFRAME_SLOT_02
unsigned long AUDIO_Player_GetHeartbeat(void)
Get the counter (heartbeat) if we have audio reception.
void AUDIO_Player_QueueBuf(uint8_t *buf, int len)
Put the Network Audio samples into SAI output buffer.
void AUDIO_PLAYER_ReleaseClock(int trig)
void BSP_AUDIO_OUT_Restart(uint16_t *pBuffer, uint32_t Size)
#define xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken)
QueueHandle_t SemaphoreHandle_t
volatile BUFFER_StateTypeDef state