STSW-STLKT01: Drivers/BSP/SensorTile/SensorTile_audio_out.h File Reference

STSW-STLKT01

STSW-STLKT01
SensorTile_audio_out.h File Reference

This file contains definitions for SensorTile_audio_out.c driver. More...

#include "PCM1774_CODEC_driver.h" #include "SensorTile.h"

Go to the source code of this file.

Macros

#define CODEC_SENSORS_MAX_NUM   2
 
#define AUDIO_OK   ((uint8_t)0)
 
#define AUDIO_ERROR   ((uint8_t)1)
 
#define AUDIO_TIMEOUT   ((uint8_t)2)
 
#define AUDIO_FREQUENCY_192K   ((uint32_t)192000)
 
#define AUDIO_FREQUENCY_96K   ((uint32_t)96000)
 
#define AUDIO_FREQUENCY_48K   ((uint32_t)48000)
 
#define AUDIO_FREQUENCY_44K   ((uint32_t)44100)
 
#define AUDIO_FREQUENCY_32K   ((uint32_t)32000)
 
#define AUDIO_FREQUENCY_22K   ((uint32_t)22050)
 
#define AUDIO_FREQUENCY_16K   ((uint32_t)16000)
 
#define AUDIO_FREQUENCY_11K   ((uint32_t)11025)
 
#define AUDIO_FREQUENCY_8K   ((uint32_t)8000)
 
#define CODEC_AUDIOFRAME_SLOT_0123   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3
 
#define CODEC_AUDIOFRAME_SLOT_02   SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
 
#define CODEC_AUDIOFRAME_SLOT_13   SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
 
#define AUDIO_SAIx   SAI2_Block_A
 
#define AUDIO_SAIx_CLK_ENABLE()   __HAL_RCC_SAI2_CLK_ENABLE()
 
#define AUDIO_SAIx_MCKB_SCKB_SDB_FSB_AF   GPIO_AF13_SAI2
 
#define AUDIO_SAIx_MCKB_SCKB_SDB_FSB_ENABLE()   __HAL_RCC_GPIOG_CLK_ENABLE()
 
#define AUDIO_SAIx_FSB_PIN   GPIO_PIN_10
 
#define AUDIO_SAIx_SCKB_PIN   GPIO_PIN_9
 
#define AUDIO_SAIx_SDB_PIN   GPIO_PIN_12
 
#define AUDIO_SAIx_MCKB_PIN   GPIO_PIN_11
 
#define AUDIO_SAIx_MCKB_SCKB_SDB_FSB_GPIO_PORT   GPIOG
 
#define AUDIO_SAIx_DMAx_CLK_ENABLE()   __HAL_RCC_DMA2_CLK_ENABLE()
 
#define AUDIO_SAIx_DMAx_CHANNEL   DMA2_Channel3
 
#define AUDIO_SAIx_DMAx_IRQ   DMA2_Channel3_IRQn
 
#define AUDIO_SAIx_DMAx_PERIPH_DATA_SIZE   DMA_PDATAALIGN_HALFWORD
 
#define AUDIO_SAIx_DMAx_MEM_DATA_SIZE   DMA_MDATAALIGN_HALFWORD
 
#define DMA_MAX_SZE   (uint32_t)0xFFFF
 
#define AUDIO_SAIx_DMAx_IRQHandler   DMA2_Channel3_IRQHandler
 
#define AUDIO_OUT_IRQ_PREPRIO   7 /* Select the preemption priority level(0 is the highest) */
 
#define DMA_MAX(_X_)   (((_X_) <= DMA_MAX_SZE)? (_X_):DMA_MAX_SZE)
 

Enumerations

enum  CODEX_ID_t { CODEX_SENSORS_AUTO = -1, PCM1774_0 = 0 }
 

Functions

uint8_t BSP_AUDIO_OUT_Init (CODEX_ID_t id, void **handle, uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq)
 Configures the audio peripherals. More...
 
uint8_t BSP_AUDIO_OUT_Play (void *handle, uint16_t *pBuffer, uint32_t Size)
 Starts playing audio stream from a data buffer for a determined size. More...
 
uint8_t BSP_AUDIO_OUT_Pause (void *handle)
 This function Pauses the audio file stream. In case of using DMA, the DMA Pause feature is used. More...
 
uint8_t BSP_AUDIO_OUT_Resume (void *handle)
 This function Resumes the audio file stream. More...
 
uint8_t BSP_AUDIO_OUT_SetFrequency (void *handle, uint32_t AudioFreq)
 Update the audio frequency. More...
 
__weak uint8_t BSP_AUDIO_OUT_ClockConfig (uint32_t AudioFreq, void *Params)
 Clock Config. More...
 
uint8_t BSP_AUDIO_OUT_SetOutputMode (void *handle, uint8_t Output)
 
uint8_t BSP_AUDIO_OUT_SetMute (void *handle, uint32_t Cmd)
 Enables or disables the MUTE mode by software. More...
 
uint8_t BSP_AUDIO_OUT_SetVolume (void *handle, uint8_t Volume)
 Controls the current audio volume level. More...
 
uint8_t BSP_AUDIO_OUT_Stop (void *handle, uint32_t Option)
 Stops audio playing and Power down the Audio Codec. More...
 
__weak void BSP_AUDIO_OUT_TransferComplete_CallBack (void)
 Manages the DMA full Transfer complete event. More...
 
__weak void BSP_AUDIO_OUT_HalfTransfer_CallBack (void)
 Manages the DMA Half Transfer complete event. More...
 
__weak void BSP_AUDIO_OUT_Error_CallBack (void)
 Manages the DMA FIFO error event. More...
 

Variables

DMA_HandleTypeDef hdma_dfsdmReg_FLT []
 

Detailed Description

This file contains definitions for SensorTile_audio_out.c driver.

Author
Central Labs
Version
V1.3.1
Date
27-Apr-2017
Attention

© COPYRIGHT(c) 2014 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file SensorTile_audio_out.h.

Generated by   doxygen 1.8.13