📄 tsc2101regs.h
字号:
// DAC Left Channel PGA Flag
#define AUDCTL2_DLGAF_SOFT 0x0000
#define AUDCTL2_DLGAF_DONE 0x0008
// DAC Right Channel PGA Flag
#define AUDCTL2_DRGAF_SOFT 0x0000
#define AUDCTL2_DRGAF_DONE 0x0004
// DAC Channel PGA Soft-stepping control
#define AUDCTL2_DASTC_ONE 0x0000
#define AUDCTL2_DASTC_TWO 0x0002
// Headset/Aux or Handset PGA Flag
#define AUDCTL2_ADGAF_SOFT 0x0000
#define AUDCTL2_ADGAF_DONE 0x0001
// Codec Power Control Register: TSC2101_AUDPD
// MICBIAS_HND power down
#define AUDPD_MBIAS_HND_ON 0x0000
#define AUDPD_MBIAS_HND_OFF 0x8000
// MICBIAS_HED power down
#define AUDPD_MBIAS_HED_ON 0x0000
#define AUDPD_MBIAS_HED_OFF 0x4000
// Analog sidetone power down
#define AUDPD_ASTPWD_ON 0x0000
#define AUDPD_ASTPWD_OFF 0x2000
// SPK1/OUT32N power down
#define AUDPD_SP1PWDN_ON 0x0000
#define AUDPD_SP1PWDN_OFF 0x1000
// SPK2 power down
#define AUDPD_SP2PWDN_ON 0x0000
#define AUDPD_SP2PWDN_OFF 0x0800
// DAC power down
#define AUDPD_DAPWDN_ON 0x0000
#define AUDPD_DAPWDN_OFF 0x0400
// ADC power down
#define AUDPD_ADPWDN_ON 0x0000
#define AUDPD_ADPWDN_OFF 0x0200
// Virtual ground power down
#define AUDPD_VGPWDN_ON 0x0000
#define AUDPD_VGPWDN_OFF 0x0100
// CP_OUT power down
#define AUDPD_COPWDN_ON 0x0000
#define AUDPD_COPWDN_OFF 0x0080
// Loudspeaker power down
#define AUDPD_LSPWDN_ON 0x0000
#define AUDPD_LSPWDN_OFF 0x0040
#define AUDPD_ADPWDF 0x0020 // ADC power down flag
#define AUDPD_LDAPWDF 0x0010 // DAC Left power down flag
#define AUDPD_RDAPWDF 0x0008 // DAC Right power down flag
#define AUDPD_ASTPWF 0x0004 // Sidetone power down flag
// Bass boost control
#define AUDPD_BASSBCF_DISABLE 0x0000
#define AUDPD_BASSBCF_ENABLE 0x0002
// De-emphasis filter enable
#define AUDPD_DEEMPF_DISABLE 0x0000
#define AUDPD_DEEMPF_ENABLE 0x0001
// Audio Control 3 Register: TSC2101_AUDCTL3
// DAC Channel Master Volume Control
#define AUDCTL3_DMSVOL_INDEP 0x0000
#define AUDCTL3_DMSVOL_RIGHT 0x4000
#define AUDCTL3_DMSVOL_LEFT 0x8000
// Reference Sampling Rate
#define AUDCTL3_REFFS_48 0x0000
#define AUDCTL3_REFFS_44_1 0x2000
// Master transfer mode
#define AUDCTL3_DAXFM_CONT 0x0000
#define AUDCTL3_DAXFM_256S 0x1000
// Codec master slave selection
#define AUDCTL3_SLVMS_SLAVE 0x0000
#define AUDCTL3_SLVMS_MASTER 0x0800
// AGC clip stepping disable
#define AUDCTL3_CLPST_DISABLE 0x0000
#define AUDCTL3_CLPST_ENABLE 0x0008
#define AUDCTL3_REVID_MASK 0x0007
// PLL Program Register: TSC2101_PLL1
// PLL Enable
#define PLL1_PLLSEL_DISABLE 0x0000
#define PLL1_PLLSEL_ENABLE 0x8000
#define PLL1_QVAL_MASK 0x7800 // Q Value
#define PLL1_PVAL_MASK 0x0700 // P Value
#define PLL1_IVAL_MASK 0x00fc // I Value
// PLL Program Register: TSC2101_PLL2
#define PLL2_DVAL_MASK 0xfffc // D Value
// Audio Control 4 Register: TSC2101_AUDCTL4
// Headset/Aux or Handset PGA soft stepping
#define AUDCTL4_ADSTPD_ENABLE 0x0000
#define AUDCTL4_ADSTPD_DISABLE 0x8000
// DAC PGA soft stepping
#define AUDCTL4_DASTPD_ENABLE 0x0000
#define AUDCTL4_DASTPD_DISABLE 0x4000
// Sidetone PGA soft stepping
#define AUDCTL4_ASSTPD_ENABLE 0x0000
#define AUDCTL4_ASSTPD_DISABLE 0x2000
// Cell-phone PGA soft stepping
#define AUDCTL4_CISTPD_ENABLE 0x0000
#define AUDCTL4_CISTPD_DISABLE 0x1000
// Buzzer PGA soft stepping
#define AUDCTL4_BISTPD_ENABLE 0x0000
#define AUDCTL4_BISTPD_DISABLE 0x0800
// AGC Hysteresis selection
#define AUDCTL4_AGCHYS_1 0x0000
#define AUDCTL4_AGCHYS_2 0x0200
#define AUDCTL4_AGCHYS_4 0x0400
#define AUDCTL4_AGCHYS_0 0x0600
// Micbias for headset
#define AUDCTL4_MB_HED_3_3 0x0000
#define AUDCTL4_MB_HED_2_5 0x0080
#define AUDCTL4_MB_HED_2_0 0x0100
// Micbias for handset
#define AUDCTL4_MB_HND_2_5 0x0000
#define AUDCTL4_MB_HND_2_0 0x0040
// Gain control for Handset: TSC2101_HNDVOL
// Handset intput mute
#define HNDVOL_ADMUT_ACTIVE 0x0000
#define HNDVOL_ADMUT_MUTE 0x8000
// ADC Handset PGA Settings
#define HNDVOL_ADPGA_MASK 0x7f00
// AGC Target Gain for Handset input.
#define HNDVOL_AGCTG_05_5 0x0000
#define HNDVOL_AGCTG_08 0x0020
#define HNDVOL_AGCTG_10 0x0040
#define HNDVOL_AGCTG_12 0x0060
#define HNDVOL_AGCTG_14 0x0080
#define HNDVOL_AGCTG_17 0x00a0
#define HNDVOL_AGCTG_20 0x00c0
#define HNDVOL_AGCTG_24 0x00e0
// AGC Time constant for Handset Input
#define HNDVOL_AGCTC_8_100 0x0000
#define HNDVOL_AGCTC_11_100 0x0002
#define HNDVOL_AGCTC_16_100 0x0004
#define HNDVOL_AGCTC_20_100 0x0006
#define HNDVOL_AGCTC_8_200 0x0008
#define HNDVOL_AGCTC_11_200 0x000a
#define HNDVOL_AGCTC_16_200 0x000c
#define HNDVOL_AGCTC_20_200 0x000e
#define HNDVOL_AGCTC_8_400 0x0010
#define HNDVOL_AGCTC_11_400 0x0012
#define HNDVOL_AGCTC_16_400 0x0014
#define HNDVOL_AGCTC_20_400 0x0016
#define HNDVOL_AGCTC_8_500 0x0018
#define HNDVOL_AGCTC_11_500 0x001a
#define HNDVOL_AGCTC_16_500 0x001c
#define HNDVOL_AGCTC_20_500 0x001e
// AGC Enable for Handset Input
#define HNDVOL_AGCEN_OFF 0x0000
#define HNDVOL_AGCEN_ON 0x0001
// Gain control for cell and buzzer input: TSC2101_CELLVOL
// cell intput mute
#define CELLVOL_MUT_CP_ACTIVE 0x0000
#define CELLVOL_MUT_CP_MUTE 0x8000
// Cell PGA Settings
#define CELLVOL_CPGA_MASK 0x7f00
#define CELLVOL_MUT_BU_ACTIVE 0x0000
#define CELLVOL_MUT_BU_MUTE 0x0040
#define CELLVOL_BPGA_MASK 0x003c
// Audio Control 5 Register: TSC2101_AUDCTL5
// Single-ended or differential output selection
#define AUDCTL5_DIFFIN_SINGLE 0x0000
#define AUDCTL5_DIFFIN_DIFF 0x8000
// DAC Channel routing the SPK1
#define AUDCTL5_DAC2SPK1_NONE 0x0000
#define AUDCTL5_DAC2SPK1_LEFT 0x2000
#define AUDCTL5_DAC2SPK1_RIGHT 0x4000
#define AUDCTL5_DAC2SPK1_BOTH 0x6000
// sidetone routing to SPK1
#define AUDCTL5_AST2SPK1_OFF 0x0000
#define AUDCTL5_AST2SPK1_ON 0x1000
// Buzzer routing to SPK1
#define AUDCTL5_BUZ2SPK1_OFF 0x0000
#define AUDCTL5_BUZ2SPK1_ON 0x0800
// Keyclick routing to SPK1
#define AUDCTL5_KCL2SPK1_OFF 0x0000
#define AUDCTL5_KCL2SPK1_ON 0x0400
// Cell input routing to SPK1
#define AUDCTL5_CPI2SPK1_OFF 0x0000
#define AUDCTL5_CPI2SPK1_ON 0x0200
// DAC Channel routing the SPK2
#define AUDCTL5_DAC2SPK2_NONE 0x0000
#define AUDCTL5_DAC2SPK2_LEFT 0x0080
#define AUDCTL5_DAC2SPK2_RIGHT 0x0100
#define AUDCTL5_DAC2SPK2_BOTH 0x0180
// sidetone routing to SPK2
#define AUDCTL5_AST2SPK2_OFF 0x0000
#define AUDCTL5_AST2SPK2_ON 0x0040
// Buzzer routing to SPK2
#define AUDCTL5_BUZ2SPK2_OFF 0x0000
#define AUDCTL5_BUZ2SPK2_ON 0x0020
// Keyclick routing to SPK2
#define AUDCTL5_KCL2SPK2_OFF 0x0000
#define AUDCTL5_KCL2SPK2_ON 0x0010
// Cell input routing to SPK2
#define AUDCTL5_CPI2SPK2_OFF 0x0000
#define AUDCTL5_CPI2SPK2_ON 0x0008
// Mute control for SPK1
#define AUDCTL5_MUTSPK1_ACTIVE 0x0000
#define AUDCTL5_MUTSPK1_MUTE 0x0004
// Mute control for SPK2
#define AUDCTL5_MUTSPK2_ACTIVE 0x0000
#define AUDCTL5_MUTSPK2_MUTE 0x0002
// Headphone short-circuit protection control
#define AUDCTL5_HDSCPTC_ENABLE 0x0000
#define AUDCTL5_MUTSPK2_DISABLE 0x0001
// Audio Control 6 Register: TSC2101_AUDCTRL6
// Routing to SPK1 goes to Loudspeaker as well
#define AUDCTL6_SPL2LSK_OFF 0x0000
#define AUDCTL6_SPL2LSK_ON 0x8000
// sidetone routing to loudspeaker
#define AUDCTL6_AST2LSK_OFF 0x0000
#define AUDCTL6_AST2LSK_ON 0x4000
// Buzzer routing to loudspeaker
#define AUDCTL6_BUZ2LSK_OFF 0x0000
#define AUDCTL6_BUZ2LSK_ON 0x2000
// Keyclick routing to loudspeaker
#define AUDCTL6_KCL2LSK_OFF 0x0000
#define AUDCTL6_KCL2LSK_ON 0x1000
// Cell input routing to loudspeaker
#define AUDCTL6_CPI2LSK_OFF 0x0000
#define AUDCTL6_CPI2LSK_ON 0x0800
// MICSEL routing to cell phone output
#define AUDCTL6_MIC2CPO_OFF 0x0000
#define AUDCTL6_MIC2CPO_ON 0x0400
// SPK1 routing to cell phone output
#define AUDCTL6_SPL2CPO_OFF 0x0000
#define AUDCTL6_SPL2CPO_ON 0x0200
// SPK2 routing to cell phone output
#define AUDCTL6_SPR2CPO_OFF 0x0000
#define AUDCTL6_SPR2CPO_ON 0x0100
// Mute control for loudspeaker
#define AUDCTL6_MUTLSPK_ACTIVE 0x0000
#define AUDCTL6_MUTLSPK_MUTE 0x0080
// Mute control for cell phone output
#define AUDCTL6_MUTSPK2_ACTIVE 0x0000
#define AUDCTL6_MUTSPK2_MUTE 0x0040
// Loadspeaker short circuit protection
#define AUDCTL6_LDSCPTC_ENABLE 0x0000
#define AUDCTL6_LDSCPTC_DISABLE 0x0020
// VGND short circuit protection
#define AUDCTL6_VGNDSCPTC_ENABLE 0x0000
#define AUDCTL6_VGNDSCPTC_DISABLE 0x0010
// Cap/Capless interface select for headset
#define AUDCTL6_CAPINTF_CAPLESS 0x0000
#define AUDCTL6_CAPINTF_CAP 0x0008
// Audio Control 7 Register: TSC2101_AUDCTRL7
// Headset detection
#define AUDCTL7_DETECT_DISABLE 0x0000
#define AUDCTL7_DETECT_ENABLE 0x8000
// Headset detection debouncing
#define AUDCTL7_HDDEBNPG_16 0x0000
#define AUDCTL7_HDDEBNPG_32 0x0200
#define AUDCTL7_HDDEBNPG_64 0x0400
#define AUDCTL7_HDDEBNPG_128 0x0600
// Button press debouncing
#define AUDCTL7_BDEBNPG_0 0x0000
#define AUDCTL7_BDEBNPG_8 0x0040
#define AUDCTL7_BDEBNPG_16 0x0080
#define AUDCTL7_BDEBNPG_32 0x00c0
// Enable GPIO2 for headset detection interrupt
#define AUDCTL7_DGPIO2_DISABLE 0x0000
#define AUDCTL7_DGPIO2_ENABLE 0x0010
// Enable GPIO1 for headset detection interrupt
#define AUDCTL7_DGPIO1_DISABLE 0x0000
#define AUDCTL7_DGPIO1_ENABLE 0x0008
// Enable GPIO2 for clkout
#define AUDCTL7_CLKGPIO2_DISABLE 0x0000
#define AUDCTL7_CLKGPIO2_ENABLE 0x0004
// ADWS Selection
#define AUDCTL7_ADWSF_TRI 0x0000
#define AUDCTL7_ADWSF_BTN 0x0002
#define AUDCTL7_ADWSF_ADWS 0x0003
// GPIO Control Register: TSC2101_GPIO
// GPIO Pin Direction
#define GPIO_GPO2EN 0x8000
#define GPIO_GPO2SG 0x4000
#define GPIO_GPI2EN 0x2000
#define GPIO_GPI2SGF 0x1000
#define GPIO_GPO1EN 0x0800
#define GPIO_GPO1SG 0x0400
#define GPIO_GPI1EN 0x0200
#define GPIO_GPI1SGF 0x0100
// AGC for Cellphone input control: TSC2101_CELLAGC
// AGC Noise Threshold
#define CELLAGC_AGCNL_30 0x0000
#define CELLAGC_AGCNL_40 0x1000
#define CELLAGC_AGCNL_50 0x1800
#define CELLAGC_AGCNL_60 0x2000
#define CELLAGC_AGCNL_70 0x2800
#define CELLAGC_AGCNL_80 0x3000
#define CELLAGC_AGCNL_90 0x3800
// AGC Hysteresis selection for cell phone input
#define CELLAGC_AGCHYS_1 0x0000
#define CELLAGC_AGCHYS_2 0x0200
#define CELLAGC_AGCHYS_3 0x0400
#define CELLAGC_AGCHYS_0 0x0600
// AGC clip stepping disable for cell phone input
#define CELLAGC_CLPST_DISABLE 0x0000
#define CELLAGC_CLPST_ENABLE 0x0100
// AGC target gain for cell phone input
#define CELLAGC_AGCTG_5_5 0x0000
#define CELLAGC_AGCTG_8 0x0020
#define CELLAGC_AGCTG_10 0x0040
#define CELLAGC_AGCTG_12 0x0060
#define CELLAGC_AGCTG_14 0x0080
#define CELLAGC_AGCTG_17 0x00a0
#define CELLAGC_AGCTG_20 0x00c0
#define CELLAGC_AGCTG_24 0x00e0
// AGC Time constant for cell Input
#define CELLAGC_AGCTC_8_100 0x0000
#define CELLAGC_AGCTC_11_100 0x0002
#define CELLAGC_AGCTC_16_100 0x0004
#define CELLAGC_AGCTC_20_100 0x0006
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -