Select one of the symbols to view example projects that use it.
 
Outline
#define __AUDIO_PLAYER_APP_H
Includes
#include "main.h"
#include "../Common/audio_if.h"
#include "spiritEQ.h"
#include "spiritLdCtrl.h"
Exported constants
#define MUTE_OFF
#define MUTE_ON
#define DEFAULT_AUDIO_VOLUME
#define CALIBRATION_AUDIOPLAYER_SETTING_BKP
#define CALIBRATION_AUDIOPLAYER_EQU1_BKP
#define CALIBRATION_AUDIOPLAYER_EQU2_BKP
#define CALIBRATION_AUDIOPLAYER_EQU3_BKP
#define CALIBRATION_AUDIOPLAYER_EQU4_BKP
#define CALIBRATION_AUDIOPLAYER_EQU5_BKP
#define CALIBRATION_AUDIOPLAYER_LOUD_BKP
#define EQUI_DB_TO_PERC
#define PERC_TO_EQUI_DB
#define PERC_TO_LDNS_DB
AUDIOPLAYER_ErrorTypdef
#define AUDIOPLAYER_StateTypdef
Exported types
AUDIOPLAYER_Init(uint8_t);
AUDIOPLAYER_Play(uint32_t);
AUDIOPLAYER_Stop();
AUDIOPLAYER_Pause();
AUDIOPLAYER_Resume();
AUDIOPLAYER_Mute(uint8_t);
AUDIOPLAYER_GetFileInfo(char *, WAV_InfoTypedef *);
AUDIOPLAYER_SelectFile(char *);
AUDIOPLAYER_GetState();
AUDIOPLAYER_Process();
AUDIOPLAYER_DeInit();
AUDIOPLAYER_GetProgress();
AUDIOPLAYER_SetVolume(uint32_t);
AUDIOPLAYER_GetVolume();
AUDIOPLAYER_NotifyEndOfFile();
AUDIOPLAYER_SetPosition(uint32_t);
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTemWinModules/audio_player/audio_player_app.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file audioplayer_app.h * @author MCD Application Team * @brief header of audio player application file ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __AUDIO_PLAYER_APP_H #define __AUDIO_PLAYER_APP_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "../Common/audio_if.h" /* #define AUDIO_USE_SPIRIT_EQUALIZER */ /* Equalizer support removed for this version */ #ifdef AUDIO_USE_SPIRIT_EQUALIZER #undef AUDIO_USE_SPIRIT_EQUALIZER /* Make sure Audio Equalizer support is disabled even if exported outside this file */ #endif #if defined(AUDIO_USE_SPIRIT_EQUALIZER) #include "spiritEQ.h" #include "spiritLdCtrl.h" /* ... */#endif /* AUDIO_USE_SPIRIT_EQUALIZER */ Includes /* Exported constants --------------------------------------------------------*/ #define MUTE_OFF 0x00 #define MUTE_ON 0x01 #define DEFAULT_AUDIO_VOLUME 50 #define CALIBRATION_AUDIOPLAYER_SETTING_BKP RTC_BKP_DR0 #if defined(AUDIO_USE_SPIRIT_EQUALIZER) #define CALIBRATION_AUDIOPLAYER_EQU1_BKP RTC_BKP_DR1 #define CALIBRATION_AUDIOPLAYER_EQU2_BKP RTC_BKP_DR2 #define CALIBRATION_AUDIOPLAYER_EQU3_BKP RTC_BKP_DR3 #define CALIBRATION_AUDIOPLAYER_EQU4_BKP RTC_BKP_DR4 #define CALIBRATION_AUDIOPLAYER_EQU5_BKP RTC_BKP_DR5 #define CALIBRATION_AUDIOPLAYER_LOUD_BKP RTC_BKP_DR6 /* ... */#endif /* AUDIO_USE_SPIRIT_EQUALIZER */ #if defined(AUDIO_USE_SPIRIT_EQUALIZER) #define EQUI_DB_TO_PERC(x) (((int16_t)(x + SPIRIT_EQ_MAX_GAIN_DB) * 100)/40) #define PERC_TO_EQUI_DB(x) (((int16_t)(x - 50) * SPIRIT_EQ_MAX_GAIN_DB) / 50) #define PERC_TO_LDNS_DB(x) (1 << (SPIRIT_LDCTRL_GAIN_Q_BITS + (int16_t)(50 - x) * 8 / 100 )) /* Equalizer Band Configuration */ #define SET_BAND_PRMS(band, _fltType, _centerHz, _widthHz, _gainDb) \ (band)->fltType = _fltType; \ (band)->centerHz = _centerHz; \ (band)->widthHz = _widthHz; \ (band)->gainDb = _gainDb;... /* ... */#endif /* AUDIO_USE_SPIRIT_EQUALIZER */ typedef enum { AUDIOPLAYER_ERROR_NONE = 0, AUDIOPLAYER_ERROR_IO, AUDIOPLAYER_ERROR_HW, AUDIOPLAYER_ERROR_MEM, AUDIOPLAYER_ERROR_FORMAT_NOTSUPPORTED, ...}AUDIOPLAYER_ErrorTypdef; #define AUDIOPLAYER_StateTypdef OUT_StateTypdef Exported constants/* Exported types ------------------------------------------------------------*/ Exported types /* Exported macros -----------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Init(uint8_t volume); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Play(uint32_t frequency); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Stop(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Pause(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Resume(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Mute(uint8_t state); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_GetFileInfo(char* file, WAV_InfoTypedef* info); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SelectFile(char* file); AUDIOPLAYER_StateTypdef AUDIOPLAYER_GetState(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Process(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_DeInit(void); uint32_t AUDIOPLAYER_GetProgress (void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SetVolume(uint32_t volume); uint32_t AUDIOPLAYER_GetVolume(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_NotifyEndOfFile(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SetPosition(uint32_t position); #if defined(AUDIO_USE_SPIRIT_EQUALIZER) void AUDIO_SetEq(uint8_t BandNum, int16_t NewGainValue); void AUDIO_SetEqParams(uint32_t loudness_perc); void AUDIO_SetLoudnessGain(int16_t NewGainValue);/* ... */ #endif /* AUDIO_USE_SPIRIT_EQUALIZER */ #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /*__AUDIO_PLAYER_APP_H */