1 /*
2  * Copyright 2018, 2020 NXP
3  * All rights reserved.
4  *
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef _FSL_MAX9286_H_
10 #define _FSL_MAX9286_H_
11 
12 #include "fsl_common.h"
13 #include "fsl_camera_device.h"
14 #include "fsl_video_i2c.h"
15 
16 /*
17  * Change Log:
18  *
19  * 1.0.2:
20  *   - Bug Fixes:
21  *     - Fix MISRA 2012 issues.
22  *
23  * 1.0.1:
24  *   - Bug Fixes:
25  *     - Fixed the bug that camera does not work after warm reset.
26  *
27  * 1.0.0:
28  *   - Initial version.
29  *
30  */
31 
32 /*
33  * The MAX9286 supports 4 camera output. Currently the driver only support
34  * one camera output. User could select which camera to enable by the extended
35  * configuration max9286_ext_config_t. If not specified, the first valid camera
36  * is used.
37  */
38 
39 /*******************************************************************************
40  * Definitions
41  ******************************************************************************/
42 
43 /*******************************************************************************
44  * Prototypes
45  ******************************************************************************/
46 
47 /*!
48  * @brief MAX9286 resource.
49  *
50  * Before initialize the MAX9286, the resource must be initialized that the
51  * Two-Wire-Serial-Interface I2C could start to work.
52  *
53  * The input clock must be 27MHz.
54  */
55 typedef struct _max9286_resource
56 {
57     video_i2c_send_func_t i2cSendFunc;       /*!< I2C send function. */
58     video_i2c_receive_func_t i2cReceiveFunc; /*!< I2C receive function. */
59     void (*pullPowerDownPin)(bool pullUp);   /*!< Function to pull power down pin high or low. */
60 } max9286_resource_t;
61 
62 /*!
63  * @brief MAX9286 extended configuration.
64  */
65 typedef struct _max9286_ext_config
66 {
67     uint8_t enableCameraMask; /*!< Select which camera to enable, there are 4 cameras. For example,
68                                    use 0x01 to use camera 0, use 0x08 to use camera 3.
69                                    Currently only support one camera. If multiple cameras are
70                                    selected, the first available selected camera is used.
71                                    */
72 } max9286_ext_config_t;
73 
74 /*! @brief MAX9286 operation functions. */
75 extern const camera_device_operations_t max9286_ops;
76 
77 /*******************************************************************************
78  * API
79  ******************************************************************************/
80 
81 #if defined(__cplusplus)
82 extern "C" {
83 #endif
84 
85 #if defined(__cplusplus)
86 }
87 #endif
88 
89 #endif /* _FSL_MAX9286_H_ */
90