Go to the source code of this file.
Macros | |
#define | AUDIO_DBL_BUF_ENABLE 0 |
Enumerations | |
enum | AudioRate_Typedef { AUDIO_8K, AUDIO_16K, AUDIO_32K, RATE_SIZE } |
enum | AudioInput_Typedef { AMIC, DMIC, I2S_IN, USB_IN, BUF_IN } |
enum | CodecMode_Typedef { CODEC_MODE_MICPHONE_TO_HEADPHONE_LINEOUT_I2S, CODEC_MODE_LINE_TO_HEADPHONE_LINEOUT_I2S, CODEC_MODE_I2S_TO_HEADPHONE_LINEOUT } |
enum | { AUD_VOLUME_MANUAL, AUD_VOLUME_AUTO } |
Functions | |
void | audio_stop (void) |
shut down audio and ADC Module More... | |
static void | audio_reset (void) |
This function serves to reset audio Module. More... | |
static void | audio_set_dmic_clk (unsigned char step, unsigned char mod) |
This function serves to set the clock of dmic. More... | |
static void | audio_set_i2s_clk (unsigned char step, unsigned char mod) |
This function serves to set the clock of i2s. More... | |
static unsigned short | get_mic_wr_ptr (void) |
This function performs to read pointer/write pointer location. More... | |
void | audio_amic_init (AudioRate_Typedef Audio_Rate) |
audio amic initial function. configure ADC corresponding parameters. set hpf,lpf and decimation ratio. More... | |
void | audio_dmic_init (AudioRate_Typedef Audio_Rate) |
audio DMIC init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp. More... | |
void | audio_usb_init (AudioRate_Typedef Audio_Rate) |
audio USB init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp. More... | |
void | audio_buff_init (AudioRate_Typedef Audio_Rate) |
audio buff init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp. More... | |
void | audio_i2s_init (void) |
audio I2S init in function, config the speed of i2s and MCLK to required speed. More... | |
void | audio_set_sdm_output (AudioInput_Typedef InType, AudioRate_Typedef Audio_Rate, unsigned char audio_out_en) |
sdm setting function, enable or disable the sdm output, configure SDM output paramaters. More... | |
void | audio_set_usb_output (void) |
This function servers to set USB input/output. More... | |
void | audio_set_i2s_output (AudioInput_Typedef InType, AudioRate_Typedef Audio_Rate) |
i2s setting function, enable or disable the i2s output, configure i2s output paramaters More... | |
void | audio_set_codec (I2C_GPIO_GroupTypeDef i2c_pin_group, CodecMode_Typedef CodecMode, unsigned sysclk) |
This function serves to set I2S input. More... | |
#define AUDIO_DBL_BUF_ENABLE 0 |
enum AudioRate_Typedef |
enum AudioInput_Typedef |
enum CodecMode_Typedef |
anonymous enum |
void audio_stop | ( | void | ) |
shut down audio and ADC Module
[in] | none. |
|
inlinestatic |
This function serves to reset audio Module.
[in] | none. |
|
inlinestatic |
This function serves to set the clock of dmic.
[in] | step | - the dividing factor of step. |
[in] | mod | - the dividing factor of mod. |
|
inlinestatic |
This function serves to set the clock of i2s.
[in] | step | - the dividing factor of step. |
[in] | mod | - the dividing factor of mod. |
|
inlinestatic |
This function performs to read pointer/write pointer location.
[in] | none. |
void audio_amic_init | ( | AudioRate_Typedef | Audio_Rate | ) |
audio amic initial function. configure ADC corresponding parameters. set hpf,lpf and decimation ratio.
[in] | Audio_Rate | - audio rate value |
void audio_dmic_init | ( | AudioRate_Typedef | Audio_Rate | ) |
audio DMIC init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp.
[in] | Audio_Rate | - set the DMIC speed. such as 1 indicate 1M and 2 indicate 2M. |
void audio_usb_init | ( | AudioRate_Typedef | Audio_Rate | ) |
audio USB init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp.
[in] | Audio_Rate | - set the DMIC speed. such as 1 indicate 1M and 2 indicate 2M. |
void audio_buff_init | ( | AudioRate_Typedef | Audio_Rate | ) |
audio buff init function, config the speed of DMIC and downsample audio data to required speed. actually audio data is dmic_speed/d_samp.
[in] | Audio_Rate | - audio rate. |
void audio_i2s_init | ( | void | ) |
audio I2S init in function, config the speed of i2s and MCLK to required speed.
[in] | none. |
void audio_set_sdm_output | ( | AudioInput_Typedef | InType, |
AudioRate_Typedef | Audio_Rate, | ||
unsigned char | audio_out_en | ||
) |
sdm setting function, enable or disable the sdm output, configure SDM output paramaters.
[in] | InType | - SDM input type, such as AMIC,DMIC,I2S_IN,USB_IN. |
[in] | Audio_Rate | - audio sampling rate, such as 16K,32k etc. |
[in] | audio_out_en | - audio output enable or disable set, '1' enable audio output; '0' disable output. |
void audio_set_usb_output | ( | void | ) |
This function servers to set USB input/output.
[in] | none. |
void audio_set_i2s_output | ( | AudioInput_Typedef | InType, |
AudioRate_Typedef | Audio_Rate | ||
) |
i2s setting function, enable or disable the i2s output, configure i2s output paramaters
[in] | InType | - select audio input type including amic ,dmic ,i2s and usb |
[in] | Audio_Rate | - select audio rate, which will decide on which adc sampling rate and relative decimation configuration will be chosen. |
void audio_set_codec | ( | I2C_GPIO_GroupTypeDef | i2c_pin_group, |
CodecMode_Typedef | CodecMode, | ||
unsigned | sysclk | ||
) |
This function serves to set I2S input.
[in] | i2c_pin_group | - select the pin for I2S. |
[in] | CodecMode | - select I2S mode. |
[in] | sysclk | - system clock. |