• 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( __GENERAL_FSM_H__ )
21 #define __GENERAL_FSM_H__
22 
23 
24 
25 typedef struct _general_fsm_t general_fsm_t;
26 typedef struct _general_fsm_t *general_fsm_ptr_t;
27 typedef const struct _general_fsm_t *general_fsm_const_ptr_t;
28 
29 #include "acamera_sbus_api.h"
30 #include "acamera_firmware_config.h"
31 void acamera_reload_isp_calibratons( general_fsm_ptr_t p_fsm );
32 void general_initialize( general_fsm_ptr_t p_fsm );
33 void general_frame_start( general_fsm_ptr_t p_fsm );
34 void general_frame_end( general_fsm_ptr_t p_fsm );
35 void general_set_wdr_mode( general_fsm_ptr_t p_fsm );
36 uint32_t general_calc_fe_lut_output( general_fsm_ptr_t p_fsm, uint16_t val );
37 uint32_t general_calc_fe_lut_input( general_fsm_ptr_t p_fsm, uint16_t val );
38 
39 
40 struct _general_fsm_t {
41     fsm_common_t cmn;
42 
43     acamera_fsm_mgr_t *p_fsm_mgr;
44     fsm_irq_mask_t mask;
45     uint32_t api_color_mode;
46     uint32_t api_scene_mode;
47     uint32_t api_reg_addr;
48     uint16_t api_reg_size;
49     uint16_t api_reg_source;
50     uint16_t calibration_read_status;
51     acamera_sbus_t isp_sbus;
52     uint32_t wdr_mode;
53 
54 #if ISP_WDR_SWITCH
55     uint32_t wdr_mode_req;
56     uint32_t wdr_auto_mode;
57     uint32_t wdr_mode_frames;
58     uint32_t cur_exp_number;
59 #endif
60 
61     uint32_t gamma2_enable;
62 };
63 
64 
65 void general_fsm_clear( general_fsm_ptr_t p_fsm );
66 void general_fsm_init( void *fsm, fsm_init_param_t *init_param );
67 int general_fsm_set_param( void *fsm, uint32_t param_id, void *input, uint32_t input_size );
68 int general_fsm_get_param( void *fsm, uint32_t param_id, void *input, uint32_t input_size, void *output, uint32_t output_size );
69 
70 uint8_t general_fsm_process_event( general_fsm_ptr_t p_fsm, event_id_t event_id );
71 
72 void general_fsm_process_interrupt( general_fsm_const_ptr_t p_fsm, uint8_t irq_event );
73 
74 void general_request_interrupt( general_fsm_ptr_t p_fsm, system_fw_interrupt_mask_t mask );
75 
76 #endif /* __GENERAL_FSM_H__ */
77