2024-01-16 04:14:28 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <esp_types.h>
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
#include "esp_attr.h"
|
|
|
|
#include "esp_log.h"
|
|
|
|
#include "esp_check.h"
|
|
|
|
#include "esp_heap_caps.h"
|
|
|
|
#include "esp_intr_alloc.h"
|
|
|
|
#include "freertos/FreeRTOS.h"
|
2024-04-10 23:12:26 -04:00
|
|
|
#include "freertos/queue.h"
|
|
|
|
#include "freertos/idf_additions.h"
|
|
|
|
#include "driver/isp_types.h"
|
2024-01-16 04:14:28 -05:00
|
|
|
#include "hal/isp_hal.h"
|
2024-04-10 23:12:26 -04:00
|
|
|
#include "hal/isp_ll.h"
|
2024-01-16 04:14:28 -05:00
|
|
|
#include "hal/isp_types.h"
|
|
|
|
#include "soc/isp_periph.h"
|
|
|
|
#include "soc/soc_caps.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2024-04-10 23:12:26 -04:00
|
|
|
#if CONFIG_ISP_ISR_IRAM_SAFE
|
|
|
|
#define ISP_INTR_ALLOC_FLAGS (ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_IRAM)
|
|
|
|
#define ISP_MEM_ALLOC_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
|
|
|
|
#else
|
|
|
|
#define ISP_INTR_ALLOC_FLAGS (ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_INTRDISABLED)
|
|
|
|
#define ISP_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT
|
|
|
|
#endif
|
|
|
|
|
2024-01-16 04:14:28 -05:00
|
|
|
typedef enum {
|
|
|
|
ISP_FSM_INIT,
|
|
|
|
ISP_FSM_ENABLE,
|
2024-04-10 23:12:26 -04:00
|
|
|
ISP_FSM_START,
|
2024-01-16 04:14:28 -05:00
|
|
|
} isp_fsm_t;
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------
|
|
|
|
Driver Context
|
|
|
|
---------------------------------------------------------------*/
|
2024-04-10 23:12:26 -04:00
|
|
|
typedef struct isp_processor_t {
|
2024-01-16 04:14:28 -05:00
|
|
|
int proc_id;
|
|
|
|
isp_hal_context_t hal;
|
|
|
|
#if SOC_ISP_SHARE_CSI_BRG
|
|
|
|
int csi_brg_id;
|
|
|
|
void *csi_brg_hw;
|
|
|
|
#endif
|
|
|
|
isp_fsm_t isp_fsm;
|
|
|
|
portMUX_TYPE spinlock;
|
|
|
|
|
|
|
|
/* sub module contexts */
|
2024-05-20 22:21:49 -04:00
|
|
|
isp_af_ctrlr_t af_ctlr[SOC_ISP_AF_CTLR_NUMS];
|
|
|
|
isp_fsm_t bf_fsm;
|
2024-04-10 23:12:26 -04:00
|
|
|
} isp_processor_t;
|
2024-01-16 04:14:28 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|