通过设置全局变量I2S0,I2S1触发DMA机制的咨询

wulin76
Posts: 7
Joined: Mon Jan 23, 2023 7:39 am

通过设置全局变量I2S0,I2S1触发DMA机制的咨询

Postby wulin76 » Wed Jan 25, 2023 5:18 am

在跟踪esp32-web-camera的代码时,看到了通过设置全局变量I2S0,I2S1,触发DMA的机制,对于结构体i2s_dev_t的各字段不是很理解,不懂哪里有这方面的文档,另外通过设置变量I2S0而实现DMA机制,能不能帮忙描述下?

以下是样例中,ll_cam.c中设置I2S0的代码
bool ll_cam_start(cam_obj_t *cam, int frame_pos)
{
I2S0.conf.rx_start = 0;

I2S_ISR_ENABLE(in_suc_eof);

I2S0.conf.rx_reset = 1;
I2S0.conf.rx_reset = 0;
I2S0.conf.rx_fifo_reset = 1;
I2S0.conf.rx_fifo_reset = 0;
I2S0.lc_conf.in_rst = 1;
I2S0.lc_conf.in_rst = 0;
I2S0.lc_conf.ahbm_fifo_rst = 1;
I2S0.lc_conf.ahbm_fifo_rst = 0;
I2S0.lc_conf.ahbm_rst = 1;
I2S0.lc_conf.ahbm_rst = 0;

I2S0.rx_eof_num = cam->dma_half_buffer_size / sizeof(dma_elem_t);
I2S0.in_link.addr = ((uint32_t)&cam->dma[0]) & 0xfffff;

I2S0.in_link.start = 1;
I2S0.conf.rx_start = 1;
return true;
}

wulin76
Posts: 7
Joined: Mon Jan 23, 2023 7:39 am

Re: 通过设置全局变量I2S0,I2S1触发DMA机制的咨询

Postby wulin76 » Tue Jan 31, 2023 12:53 pm

I2S0全局变量不是普通的变量,是直接作用于寄存器,修改了I2S0,就等于修改了寄存器,这样就能理解了

Who is online

Users browsing this forum: No registered users and 37 guests