• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 *
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Copyright (C) 2011-2018 ARM or its affiliates
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19 
20 #if !defined(__ACAMERA_FSM_MGR_H__)
21 #define __ACAMERA_FSM_MGR_H__
22 
23 
24 
25 #include "acamera_firmware_config.h"
26 #include "acamera_types.h"
27 
28 #if !defined(__ACAMERA_FW_H__)
29 #error "acamera_fsm_mgr.h file should not be included from source file, include acamera_fw.h instead!"
30 #endif
31 
32 typedef enum _event_id_t
33 {
34     event_id_WB_matrix_ready,
35     event_id_acamera_reset_sensor_hw,
36     event_id_ae_result_ready,
37     event_id_ae_stats_ready,
38     event_id_af_refocus,
39     event_id_af_stats_ready,
40     event_id_antiflicker_changed,
41     event_id_awb_result_ready,
42     event_id_awb_stats_ready,
43     event_id_cmos_refresh,
44     event_id_crop_changed,
45     event_id_crop_updated,
46     event_id_exposure_changed,
47     event_id_frame_buf_reinit,
48     event_id_frame_buffer_ds_ready,
49     event_id_frame_buffer_fr_ready,
50     event_id_frame_buffer_metadata,
51     event_id_frame_end,
52     event_id_gamma_lut_ready,
53     event_id_gamma_new_param_ready,
54     event_id_gamma_stats_ready,
55     event_id_metadata_ready,
56     event_id_metadata_update,
57     event_id_monitor_frame_end,
58     event_id_monitor_notify_other_fsm,
59     event_id_new_frame,
60     event_id_sensor_not_ready,
61     event_id_sensor_ready,
62     event_id_sensor_sw_reset,
63     event_id_sharp_lut_update,
64     event_id_update_iridix,
65     event_id_update_sharp_lut,
66     event_id_drop_frame,
67     number_of_event_ids
68 } event_id_t;
69 
70 
71 typedef enum _fsm_id_t
72 {
73     FSM_ID_SENSOR,
74     FSM_ID_CMOS,
75     FSM_ID_CROP,
76     FSM_ID_GENERAL,
77     FSM_ID_AE,
78     FSM_ID_AWB,
79     FSM_ID_COLOR_MATRIX,
80     FSM_ID_IRIDIX,
81     FSM_ID_NOISE_REDUCTION,
82     FSM_ID_SHARPENING,
83     FSM_ID_MATRIX_YUV,
84     FSM_ID_GAMMA_MANUAL,
85     FSM_ID_MONITOR,
86     FSM_ID_SBUF,
87     FSM_ID_DMA_WRITER,
88     FSM_ID_METADATA,
89     FSM_ID_AF,
90     FSM_ID_AUTOCAP,
91     FSM_ID_MAX
92 } fsm_id_t;
93 
94 #include "fsm_intf.h"
95 
96 
97 
98 #include "acamera_event_queue.h"
99 
100 struct _acamera_fsm_mgr_t
101 {
102     uint8_t ctx_id;
103     uintptr_t isp_base;
104     acamera_context_ptr_t p_ctx;
105     isp_info_t info;
106     fsm_common_t *fsm_arr[FSM_ID_MAX];
107     acamera_event_queue_t event_queue;
108     uint8_t event_queue_data[ACAMERA_EVENT_QUEUE_SIZE];
109     uint32_t reserved;
110 	uint32_t isp_seamless;
111 };
112 
113 void acamera_fsm_mgr_raise_event(acamera_fsm_mgr_t *p_fsm_mgr, event_id_t event_id);
114 
115 #define fsm_raise_event(p_fsm,event_id) \
116     acamera_fsm_mgr_raise_event((p_fsm)->p_fsm_mgr,event_id)
117 
118 void acamera_fsm_mgr_init(acamera_fsm_mgr_t *p_fsm_mgr);
119 void acamera_fsm_mgr_deinit(acamera_fsm_mgr_t *p_fsm_mgr);
120 void acamera_fsm_mgr_process_interrupt(acamera_fsm_mgr_t *p_fsm_mgr, uint8_t event);
121 void acamera_fsm_mgr_process_events(acamera_fsm_mgr_t *p_fsm_mgr, int n_max_events);
122 
123 #endif
124