1 /******************************************************************************
2  *
3  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
4  * Analog Devices, Inc.),
5  * Copyright (C) 2023-2024 Analog Devices, Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************************/
20 
21 #ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_CAMERAIF_CAMERAIF_REVA_H_
22 #define LIBRARIES_PERIPHDRIVERS_SOURCE_CAMERAIF_CAMERAIF_REVA_H_
23 
24 /****** Includes *******/
25 #include <stdint.h>
26 #include "cameraif_reva_regs.h"
27 
28 /***** Definitions *****/
29 
30 /**
31  * @brief   The list of Camera Interface Datawith options supported
32  *
33  */
34 typedef enum {
35     MXC_PCIF_REVA_DATAWITH_8_BIT = 0, ///<
36     MXC_PCIF_REVA_DATAWITH_10_BIT, ///<
37     MXC_PCIF_REVA_DATAWITH_12_BIT, ///<
38 } mxc_pcif_reva_datawith_t;
39 
40 /**
41  * @brief   The list of Camera Interface ReadMode options supported
42  *
43  */
44 typedef enum {
45     MXC_PCIF_REVA_READMODE_SINGLE_MODE = 1, ///<
46     MXC_PCIF_REVA_READMODE_CONTINUES_MODE, ///<
47 } mxc_pcif_reva_readmode_t;
48 
49 /**
50  * @brief   The list of Camera Interface TimingSel options supported
51  *
52  */
53 typedef enum {
54     MXC_PCIF_REVA_TIMINGSEL_HSYNC_and_VSYNC = 0, ///<
55     MXC_PCIF_REVA_TIMINGSEL_SAV_and_EAV, ///<
56 } mxc_pcif_reva_timingsel_t;
57 
58 /******* Globals *******/
59 
60 /****** Functions ******/
61 int MXC_PCIF_RevA_Init(void);
62 void MXC_PCIF_RevA_SetDatawidth(mxc_cameraif_reva_regs_t *cameraif,
63                                 mxc_pcif_reva_datawith_t datawith);
64 void MXC_PCIF_RevA_SetTimingSel(mxc_cameraif_reva_regs_t *cameraif,
65                                 mxc_pcif_reva_timingsel_t timingsel);
66 void MXC_PCIF_RevA_SetThreshold(mxc_cameraif_reva_regs_t *cameraif, int fifo_thrsh);
67 void MXC_PCIF_RevA_EnableInt(mxc_cameraif_reva_regs_t *cameraif, uint32_t flags);
68 void MXC_PCIF_RevA_DisableInt(mxc_cameraif_reva_regs_t *cameraif, uint32_t flags);
69 void MXC_PCIF_RevA_Start(mxc_cameraif_reva_regs_t *cameraif, mxc_pcif_reva_readmode_t readmode);
70 void MXC_PCIF_RevA_Stop(mxc_cameraif_reva_regs_t *cameraif);
71 unsigned int MXC_PCIF_RevA_GetData(mxc_cameraif_reva_regs_t *cameraif);
72 
73 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_CAMERAIF_CAMERAIF_REVA_H_
74