Go to the documentation of this file.00001 #ifndef _DEV_TLV320DAC_H_
00002 #define _DEV_TLV320DAC_H_
00003
00056 #define DAC_LLI_VOL 0x00
00057 #define DAC_LLI_VOL_LRS 0x0100
00058 #define DAC_LLI_VOL_LIM 0x0080
00059 #define DAC_LLI_VOL_LIV 0x001F
00063 #define DAC_LLI_VOL_LIV_LSB 0
00065
00066
00068 #define DAC_RLI_VOL 0x01
00069 #define DAC_RLI_VOL_RLS 0x0100
00070 #define DAC_RLI_VOL_RIM 0x0080
00071 #define DAC_RLI_VOL_RIV 0x001F
00075 #define DAC_RLI_VOL_RIV_LSB 0
00077
00078
00081 #define DAC_LHP_VOL 0x02
00082 #define DAC_LHP_VOL_LRS 0x0100
00083 #define DAC_LHP_VOL_LZC 0x0080
00084 #define DAC_LHP_VOL_LHV 0x007F
00088 #define DAC_LHP_VOL_LHV_LSB 0
00090
00091
00093 #define DAC_RHP_VOL 0x03
00094 #define DAC_RHP_VOL_RLS 0x0100
00095 #define DAC_RHP_VOL_LZC 0x0080
00096 #define DAC_RHP_VOL_LHV 0x007F
00100 #define DAC_RHP_VOL_LHV_LSB 0
00102
00103
00105 #define DAC_ANA_PATH 0x04
00106 #define DAC_ANA_PATH_STA 0x01C0
00107 #define DAC_ANA_PATH_STA_LSB 6
00108 #define DAC_ANA_PATH_STA_0DB 0x0100
00109 #define DAC_ANA_PATH_STA_M6DB 0x0000
00110 #define DAC_ANA_PATH_STA_M9DB 0x0040
00111 #define DAC_ANA_PATH_STA_M12DB 0x0080
00112 #define DAC_ANA_PATH_STA_M18DB 0x00C0
00113 #define DAC_ANA_PATH_STE 0x0020
00114 #define DAC_ANA_PATH_DAC 0x0010
00115 #define DAC_ANA_PATH_BYP 0x0008
00116 #define DAC_ANA_PATH_INSEL 0x0004
00117 #define DAC_ANA_PATH_MICM 0x0002
00118 #define DAC_ANA_PATH_MICB 0x0001
00120
00121
00123 #define DAC_DIG_PATH 0x05
00124 #define DAC_DIG_PATH_DACM 0x0008
00125 #define DAC_DIG_PATH_DEEMP 0x0006
00126 #define DAC_DIG_PATH_DEEMP_LSB 1
00127 #define DAC_DIG_PATH_DEEMP_NONE 0x0000
00128 #define DAC_DIG_PATH_DEEMP_32KHZ 0x0002
00129 #define DAC_DIG_PATH_DEEMP_44_1KHZ 0x0004
00130 #define DAC_DIG_PATH_DEEMP_48KHZ 0x0006
00131 #define DAC_DIG_PATH_ADCHP 0x0001
00133
00134
00136 #define DAC_PWRDN 0x06
00137 #define DAC_PWRDN_OFF 0x0080
00138 #define DAC_PWRDN_CLK 0x0040
00139 #define DAC_PWRDN_OSC 0x0020
00140 #define DAC_PWRDN_OUT 0x0010
00141 #define DAC_PWRDN_DAC 0x0008
00142 #define DAC_PWRDN_ADC 0x0004
00143 #define DAC_PWRDN_MIC 0x0002
00144 #define DAC_PWRDN_LINE 0x0001
00146
00147
00149 #define DAC_DAI_FMT 0x07
00150 #define DAC_DAI_FMT_MS 0x0040
00151 #define DAC_DAI_FMT_LRSWAP 0x0020
00152 #define DAC_DAI_FMT_LRP 0x0010
00153 #define DAC_DAI_FMT_IWL 0x000C
00154 #define DAC_DAI_FMT_IWL_LSB 2
00155 #define DAC_DAI_FMT_IWL_16 0x0000
00156 #define DAC_DAI_FMT_IWL_20 0x0004
00157 #define DAC_DAI_FMT_IWL_24 0x0008
00158 #define DAC_DAI_FMT_IWL_32 0x000C
00159 #define DAC_DAI_FMT_FOR 0x0003
00160 #define DAC_DAI_FMT_FOR_LSB 0
00161 #define DAC_DAI_FMT_FOR_RA 0x0000
00162 #define DAC_DAI_FMT_FOR_LA 0x0001
00163 #define DAC_DAI_FMT_FOR_I2S 0x0002
00164 #define DAC_DAI_FMT_FOR_DSP 0x0003
00166
00167
00169 #define DAC_SRATE 0x08
00170 #define DAC_SRATE_CLKOUT 0x0080
00171 #define DAC_SRATE_CLKIN 0x0040
00172 #define DAC_SRATE_SR 0x003C
00173 #define DAC_SRATE_SR_LSB 2
00174 #define DAC_SRATE_BOSR 0x0002
00179 #define DAC_SRATE_USB 0x0001
00181
00182
00184 #define DAC_DI_ACT 0x09
00185 #define DAC_DI_ACT_ACT 0x0001
00187
00188
00190 #define DAC_RESET 0x0F
00195
00196 #define DAC_MAX_VOLUME 6
00197 #define DAC_MIN_VOLUME -73
00198
00199 extern int Tlv320DacInit(unsigned int rate);
00200 extern int Tlv320DacWrite(void *buf, int len);
00201 extern int Tlv320DacFlush(void);
00202
00203 extern u_char Tlv320DacReadReg(unsigned int reg);
00204 extern void Tlv320DacWriteReg(unsigned int reg, unsigned int val);
00205
00206 extern int Tlv320DacSetVolume(int left, int right);
00207 extern int Tlv320DacSetRate(unsigned int rate);
00208 extern int Tlv320SwitchMode(void);
00209
00210 #endif