HPM APP
HPMicro Application solution
i2s_dma_chain.c File Reference
#include "hpm_wm8960.h"
#include "hpm_math.h"
#include "hpm_i2s_drv.h"
#include "hpm_dao_drv.h"
#include "hpm_dma_drv.h"
#include "hpm_dmamux_drv.h"
#include "i2s_dma_chain.h"

Functions

 ATTR_RAMFUNC_WITH_ALIGNMENT (8)
 
void i2s_dao_config (uint32_t sample_rate, uint8_t audio_depth, uint8_t channel_num)
 DAO I2S configuration ;DAO I2S配置 More...
 
void dma_chain_transfer_config_tx (void)
 I2S TX DMA chain configuration ;I2S发送数据的DMA链配置 More...
 
void dma_auto_config_tx (void)
 I2S TX DMA chain start ;I2S发送数据的DMA链启动 More...
 
void i2s_dma_tx_init (void)
 I2S TX and DMA chain init ;发送数据的I2S和DMA链初始化 More...
 
void tx_test (void)
 
void fft_cal (rfft_type_t *buf, rfft_type_t *output, uint16_t points, uint16_t shift)
 FFT calculation:perform FFT calculation on the received audio data ;FFT计算:对接收到音频数据进行FFT运算 More...
 
void dma_chain_transfer_config_rx (void)
 I2S RX DMA chain configuration ;I2S接收数据的DMA链配置 More...
 
void dma_auto_config_rx (void)
 I2S RX DMA chain start ;I2S接收数据的DMA链启动 More...
 
void codec_i2s_init (void)
 CODEC used for microphone I2S init ;麦克风使用的CODEC I2S初始化 More...
 
void i2s_dma_rx_init (void)
 I2S RX and DMA chain init ;接收数据的I2S和DMA链初始化 More...
 
void rx_data_process (void)
 processing received data ;处理接收的数据 More...
 

Variables

uint32_t result [4]
 
u32_t complete_count
 
int mic_rx_test = 1
 
rfft_type_t rfft_buf_r [FFT_POINTS]
 
rfft_type_t rfft_buf_l [FFT_POINTS]
 
rfft_type_t rfft_mag_output [FFT_POINTS]
 
int test_buff [FFT_POINTS]
 
wm8960_control_t wm8960_control
 

Function Documentation

◆ ATTR_RAMFUNC_WITH_ALIGNMENT()

ATTR_RAMFUNC_WITH_ALIGNMENT ( )

◆ codec_i2s_init()

void codec_i2s_init ( void  )

CODEC used for microphone I2S init ;麦克风使用的CODEC I2S初始化

◆ dma_auto_config_rx()

void dma_auto_config_rx ( void  )

I2S RX DMA chain start ;I2S接收数据的DMA链启动

◆ dma_auto_config_tx()

void dma_auto_config_tx ( void  )

I2S TX DMA chain start ;I2S发送数据的DMA链启动

◆ dma_chain_transfer_config_rx()

void dma_chain_transfer_config_rx ( void  )

I2S RX DMA chain configuration ;I2S接收数据的DMA链配置

◆ dma_chain_transfer_config_tx()

void dma_chain_transfer_config_tx ( void  )

I2S TX DMA chain configuration ;I2S发送数据的DMA链配置

◆ fft_cal()

void fft_cal ( rfft_type_t buf,
rfft_type_t output,
uint16_t  points,
uint16_t  shift 
)

FFT calculation:perform FFT calculation on the received audio data ;FFT计算:对接收到音频数据进行FFT运算

Parameters
[in]bufdata buff that requires FFT calculation;需要进行FFT计算的数据buff
[in]outputthe sample depth of audio data,; ;FFT计算结果的输出buff
[in]pointsthe number of data requiring FFT calculation;需要进行FFT计算的数据个数
[in]shiftbase 2 logarithm value of the sample number and it can be set from 4 to 14 ;以2为底的数据个数的对数值,可以设置为4到14

◆ i2s_dao_config()

void i2s_dao_config ( uint32_t  sample_rate,
uint8_t  audio_depth,
uint8_t  channel_num 
)

DAO I2S configuration ;DAO I2S配置

Parameters
[in]sample_ratethe sample rate of audio data;播放音频的采样率
[in]audio_depththe sample depth of audio data,the supports sample depth are as follows: ;音频数据的通道宽度采样深度,支持的采样深度如下:
  • i2s_audio_depth_16_bits: 16bits sample depth;16位采样深度
  • i2s_audio_depth_24_bits: 24bits sample depth;24位采样深度
  • i2s_audio_depth_32_bits: 32bits sample depth;32位采样深度
[in]channel_numthe num of channels;通道数量

◆ i2s_dma_rx_init()

void i2s_dma_rx_init ( void  )

I2S RX and DMA chain init ;接收数据的I2S和DMA链初始化

◆ i2s_dma_tx_init()

void i2s_dma_tx_init ( void  )

I2S TX and DMA chain init ;发送数据的I2S和DMA链初始化

◆ rx_data_process()

void rx_data_process ( void  )

processing received data ;处理接收的数据

◆ tx_test()

void tx_test ( void  )

Variable Documentation

◆ complete_count

u32_t complete_count

◆ mic_rx_test

int mic_rx_test = 1

◆ result

uint32_t result[4]

◆ rfft_buf_l

rfft_type_t rfft_buf_l[FFT_POINTS]

◆ rfft_buf_r

rfft_type_t rfft_buf_r[FFT_POINTS]

◆ rfft_mag_output

rfft_type_t rfft_mag_output[FFT_POINTS]

◆ test_buff

int test_buff[FFT_POINTS]

◆ wm8960_control

wm8960_control_t wm8960_control
Initial value:
= {
.ptr = CODEC_I2C,
.slave_address = WM8960_I2C_ADDR,
}
#define CODEC_I2C
CODEC used for microphone I2S configuration ;麦克风使用的CODEC的相关配置
Definition: i2s_dma_chain.h:44