📄 l1audio_const.h
字号:
#define C_BGD_RECOGN 5 // TEMPORARY: DSP Background recognition task code (also used for bitmaps).
#define C_BGD_ALIGN 6 // TEMPORARY: DSP Background alignement
// bits in d_gsm_bgd_mgt - background task management
#define B_DSPBGD_RECO 1 // start of reco in dsp background
#define B_DSPBGD_UPD 2 // start of alignement update in dsp background
#endif
#if (AUDIO_MODE)
#define B_GSM_ONLY ((TRUE_L << 13) | (TRUE_L << 11)) // GSM normal mode
#define B_BT_CORDLESS (TRUE_L << 12) // Bluetooth cordless mode
#define B_BT_HEADSET (TRUE_L << 14) // Bluetooth headset mode
#endif
#define SC_AUDIO_MCU_API_BEGIN_ADDRESS (0xFFD00000) // Start address of the API memory in MCU side
#define SC_AUDIO_DSP_API_BEGIN_ADDRESS (0x0800) // Start address o fthe API memory in DSP side
#if (MELODY_E2)
// Number of oscillator available in the melody E2
#define SC_MELODY_E2_NUMBER_OF_OSCILLATOR (16)
// Code of extension for data=time
#define SC_TIME_CODE_OF_EXTENSION (1)
// Position of the GlobalTimeFactor parameter
#define SC_MELODY_E2_GLOBALTIMEFACTOR_MASK (0xFF)
#define SC_MELODY_E2_GLOBALTIMEFACTOR_SHIFT (0)
// Position of the Number of instrument parameter
#define SC_MELODY_E2_NUMBEROFINSTRUMENT_MASK (0xFF)
#define SC_MELODY_E2_NUMBEROFINSTRUMENT_SHIFT (0)
// Position of the extension flag
#define SC_MELODY_E2_EXTENSION_FLAG_MASK (0x80)
#define SC_MELODY_E2_EXTENSION_FLAG_SHIFT (7)
// Position of the code of extension
#define SC_MELODY_E2_CODE_OF_EXTENSION_MASK (0x70)
#define SC_MELODY_E2_CODE_OF_EXTENSION_SHIFT (4)
// Position of data time
#define SC_MELODY_E2_DATA_TIME_MSB_MASK (0x07)
#define SC_MELODY_E2_DATA_TIME_MSB_SHIFT (0)
// Position of data time
#define SC_MELODY_E2_DATA_TIME_LSB_MASK (0xFF00)
#define SC_MELODY_E2_DATA_TIME_LSB_SHIFT (8)
// Position of the Delta Time
#define SC_MELODY_E2_DELTA_TIME_MASK (0x7F)
#define SC_MELODY_E2_DELTA_TIME_SHIFT (0)
// Mask of the semaphore
#define SC_MELODY_E2_SEMAPHORE_MASK (0x0001)
// Maximum size of the header of the melody E2
#define SC_MELODY_E2_MAXIMUM_HEADER_SIZE (3 + SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT)
// Maximum number of extension
#define SC_MELODY_E2_MAXIMUM_NUMBER_OF_EXTENSION (2)
#endif // MELODY_E2
// Selection of the melody format
#define NO_MELODY_SELECTED (0)
#define MELODY_E0_SELECTED (1)
#define MELODY_E1_SELECTED (2)
#define MELODY_E2_SELECTED (3)
#if (L1_STEREOPATH == 1)
// configuration
#define AUDIO_SP_SELF_CONF 0
#define AUDIO_SP_MIDI_CONF 1
#define AUDIO_SP_MP3_CONF 2
#define AUDIO_SP_EXTAUDIO_CONF 3
#if (ANLG_FAM == 3)
// sampling frequency
#define AUDIO_SP_FREQ_8 7
#define AUDIO_SP_FREQ_11 6
#define AUDIO_SP_FREQ_16 5
#define AUDIO_SP_FREQ_22 4
#define AUDIO_SP_FREQ_32 3
#define AUDIO_SP_FREQ_44 2
#define AUDIO_SP_FREQ_48 0
#endif
#if (ANLG_FAM == 11 || CODE_VERSION == SIMULATION)
// sampling frequency index for Triton. This would be set in the
//SRW[0:3] bits of the CTRL5 register.
#define AUDIO_SP_FREQ_8 0
#define AUDIO_SP_FREQ_11 1
#define AUDIO_SP_FREQ_12 2
#define AUDIO_SP_FREQ_16 3
#define AUDIO_SP_FREQ_22 4
#define AUDIO_SP_FREQ_24 5
#define AUDIO_SP_FREQ_32 6
#define AUDIO_SP_FREQ_44 7
#define AUDIO_SP_FREQ_48 8
#endif
// DMA allocation
#define AUDIO_SP_DMA_ALLOC_MCU 0
#define AUDIO_SP_DMA_ALLOC_DSP 1
// Data type
#define AUDIO_SP_DATA_S8 0
#define AUDIO_SP_DATA_S16 1
#define AUDIO_SP_DATA_S32 2
// Source port
#define AUDIO_SP_SOURCE_IMIF 0
#define AUDIO_SP_SOURCE_API 2
#if (CHIPSET == 15)
//In Locosto, EMIF is also a source port for the audio
#define AUDIO_SP_SOURCE_EMIF 4
#endif
// output type
#define AUDIO_SP_MONO_OUTPUT 0
#define AUDIO_SP_STEREO_OUTPUT 1
// feature identifier
#define AUDIO_SP_MIDI_ID 0
#define AUDIO_SP_EXT_AUDIO_ID 1
#define AUDIO_SP_MP3_ID 2
#define AUDIO_SP_TESTS_ID 3
#if (L1_AAC == 1)
#define AUDIO_SP_AAC_ID 4 //added for AAC
#endif
// Pattern
#define AUDIO_SP_SILENCE_PATTERN 0
#define AUDIO_SP_SINUS1_PATTERN 1
#define AUDIO_SP_SINUS2_PATTERN 2
#define AUDIO_SP_SINUS3_PATTERN 3
#endif
#endif // AUDIO_TASK
#if (DSP == 17) || (DSP == 32)
#define B_FIR_START (TRUE_L << 0) // Bit set by the MCU to start the FIR task for the DSP code 32 and 17.
#endif
#define B_FIR_LOOP (TRUE_L << 1) // Bit set by the MCU to close the loop between the audio UL and DL path.
// This features is used to find the FIR coefficient.
/*************************************/
/* ACOUSTIC interface */
/*************************************/
/* Control values */
/*----------------*/
#define B_ANR_ENABLE (TRUE_L << 0)
#define B_ANR_DISABLE (TRUE_L << 1)
#define B_ANR_FULL_UPDATE (TRUE_L << 2)
#define B_IIR_ENABLE (TRUE_L << 0)
#define B_IIR_DISABLE (TRUE_L << 1)
#define B_IIR_FULL_UPDATE (TRUE_L << 2)
#define B_AGC_ENABLE (TRUE_L << 0)
#define B_AGC_DISABLE (TRUE_L << 1)
#define B_AGC_FULL_UPDATE (TRUE_L << 2)
#define B_WCM_ENABLE (TRUE_L << 0)
#define B_WCM_DISABLE (TRUE_L << 1)
#define B_WCM_FULL_UPDATE (TRUE_L << 2)
#if (L1_DRC == 1)
#define DRC_LPF_LENGTH 17
#define DRC_BPF_LENGTH 17
#endif
#define B_DRC_ENABLE (TRUE_L << 0)
#define B_DRC_DISABLE (TRUE_L << 1)
#define B_DRC_FULL_UPDATE (TRUE_L << 2)
#define B_LIM_ENABLE (TRUE_L << 0)
#define B_LIM_DISABLE (TRUE_L << 1)
#define B_LIM_FULL_UPDATE (TRUE_L << 2)
#define B_LIM_UPDATE (TRUE_L << 3)
#define B_ES_ENABLE (TRUE_L << 0)
#define B_ES_DISABLE (TRUE_L << 1)
#define B_ES_FULL_UPDATE (TRUE_L << 2)
#if (L1_IIR == 2)
#define IIR_4X_ORDER_OF_SECTION 2
#define IIR_4X_FIR_MAX_LENGTH 40
#endif
#if (L1_WCM == 1)
#define WCM_1X_GAIN_TABLE_LENGTH 16
#endif
/* d_aqi_status bits */
/*-------------------*/
#if (DSP == 38) || (DSP == 39)
#define B_DRC_DL_STATE (TRUE_L << 3)
#define B_IIR_DL_STATE (TRUE_L << 4)
#define B_LIM_STATE (TRUE_L << 5)
#define B_AGC_DL_STATE (TRUE_L << 6)
#define B_AEC_STATE (TRUE_L << 11)
#define B_ANR_UL_STATE (TRUE_L << 12)
#define B_ES_STATE (TRUE_L << 13)
#define B_AGC_UL_STATE (TRUE_L << 14)
#else
#define B_IIR_STATE (TRUE_L << 4)
#define B_LIM_STATE (TRUE_L << 5)
#define B_ANR_STATE (TRUE_L << 12)
#define B_ES_STATE (TRUE_L << 13)
#endif
/* d_audio_apps_status bits */
/*-------------------*/
#if (DSP == 38) || (DSP == 39)
#define B_WCM_STATE (TRUE_L << 0)
#endif
/*****************/
/* ANR constants */
/*****************/
#if (L1_ANR == 1)
#define C_ANR_VAD_THR 0x1333
#define C_ANR_GAMMA_SLOW 0x7F1B
#define C_ANR_GAMMA_FAST 0x75C3
#define C_ANR_GAMMA_GAIN_SLOW 28836
#define C_ANR_GAMMA_GAIN_FAST 32113
#define C_ANR_THR2 0x01E0
#define C_ANR_THR4 0x03DE
#define C_ANR_THR5 0x012C
#define C_ANR_MEAN_RATIO_THR1 10000
#define C_ANR_MEAN_RATIO_THR2 6000
#define C_ANR_MEAN_RATIO_THR3 5000
#define C_ANR_MEAN_RATIO_THR4 4000
#endif
#if (L1_ES == 1)
/*******************/
/* ES constants */
/*******************/
// ES custom mode
#define ES_CUSTOM_PARAM 0xFF
// ES mode definition
#define B_ES_UL (0x1 << 0) // ES UL enable
#define B_ES_DL (0x1 << 1) // ES DL enable
#define B_ES_CNG (0x1 << 2) // CNG enable
#define B_ES_NSF (0x1 << 3) // NSF enable
#define B_ES_ALS_UL (0x1 << 4) // ALS UL enable
#define B_ES_ALS_DL (0x1 << 5) // ALS DL enable
// ES parameter values
#define C_ES_GAIN_DL_OFF 0x0
#define C_ES_GAIN_UL_1_OFF 0x0
#define C_ES_GAIN_UL_2_OFF 0x0
#define C_ES_TCL_M23DB 0x005E // ref. -23dB
#define C_ES_TCL_M6DB 0x0176 // ref. -6dB
#define C_ES_TCL_M3DB 0x02EA // ref. -6dB
#define C_ES_TCL_0DB 0x05D1 // ref. 0dB
#define C_ES_TCL_4DB 0x0E9D // ref. 4dB
#define C_ES_TCL_6DB 0x1729 // ref. 6dB
#define C_ES_TCL_10DB 0x3A2F // ref. 10dB
#define C_ES_TCL_12DB 0x5C36 // ref. 12dB
#define C_ES_TCL_B3_FE_LS 0x0004 // ref. -10dB
#define C_ES_TCL_B3_DT_LS 0x0001 // ref. -16dB
#define C_ES_TCL_B3_FE_NS 0x000F // ref. -10dB
#define C_ES_TCL_B3_DT_NS 0x0004 // ref. -16dB
#define C_ES_TCL_B3_NE 0x000F // ref. 0dB
#define C_ES_TCL_FE_0 0x05D1 // ref. 0dB
#define C_ES_TCL_DT_0 0x05D1 // ref. 0dB
#define C_ES_TCL_NE_0 0x05D1 // ref. 0dB
#define C_ES_TCL_LOUD 0x00BF // ref. 70dB
#define C_ES_SW_CNT 5 // ref. switching time 100ms
#define C_ES_DT_CNT 5 // ref. double-talk time 100ms
#define C_ES_HG_CNT_1 8 // ref. hangover time 150ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_1A 8 // ref. hangover time 150ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_2A 10 // ref. hangover time 200ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_2B 13 // ref. hangover time 250ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_2C 13 // ref. hangover time 250ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_2C_IDLE 13 // ref. hangover time 250ms, A_S(IDLE) = -3dB
#define C_ES_HG_CNT_3 20 // ref. hangover time 400ms
#define C_ES_ATT_LIN_0DB 0x7fff // ref. 0dB
#define C_ES_ATT_LIN_3DB 0x5A9D // ref. -3dB
#define C_ES_ATT_LIN_5DB 0x47FA // ref. -5dB
#define C_ES_ATT_LIN_6DB 0x4026 // ref. -6dB
#define C_ES_ATT_LIN_8DB 0x32F4 // ref. -8dB
#define C_ES_ATT_LIN_9DB 0x2D6A // ref. -9dB
#define C_ES_ATT_LIN_10DB 0x2879 // ref. -10dB
#define C_ES_ATT_LIN_12DB 0x2026 // ref. -12dB
#define C_ES_ATT_LIN_15DB 0x16C2 // ref. -15dB
#define C_ES_ATT_LIN_16DB 0x1449 // ref. -16dB
#define C_ES_ATT_LIN_19DB 0x0E5D // ref. -19dB
#define C_ES_ATT_LIN_21DB 0x0B68 // ref. -21dB
#define C_ES_ATT_LIN_24DB 0x0813 // ref. -24dB
#define C_ES_ATT_LIN_36DB 0x0207 // ref. -36dB
#define C_ES_ATT_LIN_48DB 0x0082 // ref. -48dB
#define C_ES_ATT_LIN_66DB 0x0010 // ref. -56dB
#endif // L1_ES
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -