esp32-camera: understanding the interrupts
Posted: Mon Mar 25, 2024 12:17 am
Hi, I'm trying to figure out when those interrupts (DMA, ETS_LCD_CAM_INTR_SOURCE) occur exactly
here is a snippet from https://github.com/espressif/esp32-came ... cam.c#L400
My guess is that ETS_LCD_CAM_INTR_SOURCE occur before capturing a frame and the dma occurs after the frame dma transfer copied?
Also how the dma knows when and where to copy the frame data from? I didn't find the code of that
Thanks.
here is a snippet from https://github.com/espressif/esp32-came ... cam.c#L400
Code: Select all
esp_err_t ll_cam_init_isr(cam_obj_t *cam)
{
esp_err_t ret = ESP_OK;
ret = esp_intr_alloc_intrstatus(gdma_periph_signals.groups[0].pairs[cam->dma_num].rx_irq_id,
ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED | CAMERA_ISR_IRAM_FLAG,
(uint32_t)&GDMA.channel[cam->dma_num].in.int_st, GDMA_IN_SUC_EOF_CH0_INT_ST_M,
ll_cam_dma_isr, cam, &cam->dma_intr_handle);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "DMA interrupt allocation of camera failed");
return ret;
}
ret = esp_intr_alloc_intrstatus(ETS_LCD_CAM_INTR_SOURCE,
ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED | CAMERA_ISR_IRAM_FLAG,
(uint32_t)&LCD_CAM.lc_dma_int_st.val, LCD_CAM_CAM_VSYNC_INT_ST_M,
ll_cam_vsync_isr, cam, &cam->cam_intr_handle);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "LCD_CAM interrupt allocation of camera failed");
return ret;
}
return ESP_OK;
}
Also how the dma knows when and where to copy the frame data from? I didn't find the code of that
Thanks.