00001
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef _CONF_AUDIO_MIXER_H_
00047 #define _CONF_AUDIO_MIXER_H_
00048
00049 #include "board.h"
00050
00051 #include "conf_audio_player.h"
00052
00053 #if BOARD == EVK1105
00054 # include "pwm_dac.h"
00055 # include "tlv320aic23b.h"
00056 #endif
00057
00058 #include "tpa6130.h"
00059
00060
00063
00064 #if BOARD == EVK1105
00065 # define AUDIO_MIXER_DAC_PWM_DAC 1
00066 # define AUDIO_MIXER_DAC_AIC23B 2
00067 # define AUDIO_MIXER_DAC_ABDAC 4
00068
00069 #elif BOARD == EVK1104
00070 # define AUDIO_MIXER_DAC_ABDAC 1
00071
00072 #else
00073 # error Board not defined - You should define AUDIO_MIXER_x configuration.
00074 #endif
00076
00077
00079
00080 #if BOARD == EVK1105
00081 #define AUDIO_MIXER_DACS_INTERFACES \
00082 { \
00083 { \
00084 pwm_dac_start, \
00085 pwm_dac_setup, \
00086 pwm_dac_output, \
00087 NULL, \
00088 pwm_dac_increase_volume, \
00089 pwm_dac_decrease_volume, \
00090 pwm_dac_get_volume, \
00091 pwm_dac_set_volume, \
00092 pwm_dac_is_volume_muted, \
00093 pwm_dac_is_volume_boosted, \
00094 pwm_dac_flush, \
00095 pwm_dac_stop, \
00096 pwm_dac_mute \
00097 }, \
00098 { \
00099 aic23b_codec_start, \
00100 aic23b_codec_setup, \
00101 aic23b_dac_output, \
00102 aic23b_adc_input, \
00103 aic23b_dac_increase_volume, \
00104 aic23b_dac_decrease_volume, \
00105 aic23b_dac_get_average_headphone_volume, \
00106 aic23b_dac_set_average_headphone_volume, \
00107 aic23b_dac_is_headphone_volume_muted, \
00108 aic23b_dac_is_headphone_volume_boosted, \
00109 aic23b_codec_flush, \
00110 aic23b_codec_stop, \
00111 aic23b_dac_mute \
00112 }, \
00113 { \
00114 tpa6130_dac_start, \
00115 tpa6130_dac_setup, \
00116 tpa6130_dac_output, \
00117 NULL, \
00118 tpa6130_dac_increase_volume, \
00119 tpa6130_dac_decrease_volume, \
00120 tpa6130_dac_get_volume, \
00121 tpa6130_dac_set_volume, \
00122 tpa6130_dac_is_volume_muted, \
00123 tpa6130_dac_is_volume_boosted, \
00124 tpa6130_dac_flush, \
00125 tpa6130_dac_stop, \
00126 tpa6130_dac_mute \
00127 } \
00128 }
00129 #elif BOARD == EVK1104
00130 #define AUDIO_MIXER_DACS_INTERFACES \
00131 { \
00132 { \
00133 tpa6130_dac_start, \
00134 tpa6130_dac_setup, \
00135 tpa6130_dac_output, \
00136 NULL, \
00137 tpa6130_dac_increase_volume, \
00138 tpa6130_dac_decrease_volume, \
00139 tpa6130_dac_get_volume, \
00140 tpa6130_dac_set_volume, \
00141 tpa6130_dac_is_volume_muted, \
00142 tpa6130_dac_is_volume_boosted, \
00143 tpa6130_dac_flush, \
00144 tpa6130_dac_stop, \
00145 tpa6130_dac_mute \
00146 } \
00147 }
00148 #endif
00149
00150 #if !defined(AUDIO_MIXER_DACS_INTERFACES)
00151 # error The AUDIO_MIXER_DACS_INTERFACES configuration to use is missing.
00152 #endif
00153
00155
00158
00159 #define AUDIO_MIXER_OVERRUN_LED LED2
00160 #define AUDIO_MIXER_UNDERRUN_LED LED3
00162
00163 #define AUDIO_MIXER_OUT_OF_SAMPLES_CALLBACK \
00164 { \
00165 LED_Toggle(AUDIO_MIXER_UNDERRUN_LED); \
00166 }
00167
00168 #include "usb_stream_player.h"
00169 #define AUDIO_MIXER_RELOAD_CALLBACK \
00170 { \
00171 if (usb_stream_get_status() & USB_STREAM_STATUS_IDLE && \
00172 !(usb_stream_get_status() & USB_STREAM_STATUS_DATA_PROCESSING)) \
00173 usb_stream_task(); \
00174 }
00175
00176 #define AUDIO_MIXER_OVERRUN_CALLBACK \
00177 { \
00178 LED_Toggle(AUDIO_MIXER_OVERRUN_LED); \
00179 }
00180
00181 #define USB_STREAM_OVERRUN_CALLBACK() AUDIO_MIXER_OVERRUN_CALLBACK
00182
00183 #if (defined BOARD) && (BOARD==EVK1105)
00184 #define AUDIO_MIXER_ADC_RELOAD_CALLBACK \
00185 { \
00186 adc_sample_sent_cb(); \
00187 }
00188
00189 #define AUDIO_MIXER_ADC_OUT_OF_SAMPLE \
00190 { \
00191 adc_underflow_cb(); \
00192 }
00193 #endif
00194
00195
00196
00197 #if(DEFAULT_DACS==AUDIO_MIXER_DAC_ABDAC)
00198 #define SPEAKER_VOL_MIN 0
00199 #define SPEAKER_VOL_MAX 63
00200 #define SPEAKER_VOL_RES 1
00201 #elif(DEFAULT_DACS==AUDIO_MIXER_DAC_PWM_DAC)
00202 #define SPEAKER_VOL_MIN 0
00203 #define SPEAKER_VOL_MAX 7
00204 #define SPEAKER_VOL_RES 1
00205 #elif(DEFAULT_DACS==AUDIO_MIXER_DAC_AIC23B)
00206 #define SPEAKER_VOL_MIN AIC23B_HP_VOL_MIN
00207 #define SPEAKER_VOL_MAX AIC23B_HP_VOL_MAX
00208 #define SPEAKER_VOL_RES 1
00209 #endif
00210
00211 #endif // _CONF_AUDIO_MIXER_H_