| M480 BSP V3.05.001 The Board Support Package for M480 Series

ccap.h
Go to the documentation of this file.
1 /**************************************************************************/
9 #ifndef __CCAP_H__
10 #define __CCAP_H__
11
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16
29 /*---------------------------------------------------------------------------------------------------------*/
30 /* CTL constant definitions */
31 /*---------------------------------------------------------------------------------------------------------*/
32 #define CCAP_CTL_CCAPEN (1ul<<CCAP_CTL_CCAPEN_Pos)
33 #define CCAP_CTL_ADDRSW (1ul<<CCAP_CTL_ADDRSW_Pos)
34 #define CCAP_CTL_PKTEN (1ul<<CCAP_CTL_PKTEN_Pos)
35 #define CCAP_CTL_PLNEN (1ul<<CCAP_CTL_PLNEN_Pos)
36 #define CCAP_CTL_SHUTTER (1ul<<CCAP_CTL_SHUTTER_Pos)
37 #define CCAP_CTL_UPDATE (1ul<<CCAP_CTL_UPDATE_Pos)
38 #define CCAP_CTL_RESET (1ul<<CCAP_CTL_VPRST_Pos)
39 #define CCAP_CTL_MY8_MY4 (0ul<<CCAP_CTL_MY8_MY4_Pos)
40 #define CCAP_CTL_MY8_MY8 (1ul<<CCAP_CTL_MY8_MY4_Pos)
42 /*---------------------------------------------------------------------------------------------------------*/
43 /* PAR constant definitions */
44 /*---------------------------------------------------------------------------------------------------------*/
45 #define CCAP_PAR_INFMT_YUV422 (0ul<<CCAP_PAR_INFMT_Pos)
46 #define CCAP_PAR_INFMT_RGB565 (1ul<<CCAP_PAR_INFMT_Pos)
48 #define CCAP_PAR_SENTYPE_CCIR601 (0ul<<CCAP_PAR_SENTYPE_Pos)
49 #define CCAP_PAR_SENTYPE_CCIR656 (1ul<<CCAP_PAR_SENTYPE_Pos)
51 #define CCAP_PAR_INDATORD_YUYV (0x0ul<<CCAP_PAR_INDATORD_Pos)
52 #define CCAP_PAR_INDATORD_YVYU (0x1ul<<CCAP_PAR_INDATORD_Pos)
53 #define CCAP_PAR_INDATORD_UYVY (0x2ul<<CCAP_PAR_INDATORD_Pos)
54 #define CCAP_PAR_INDATORD_VYUY (0x3ul<<CCAP_PAR_INDATORD_Pos)
56 #define CCAP_PAR_INDATORD_RGGB (0x0ul<<CCAP_PAR_INDATORD_Pos)
57 #define CCAP_PAR_INDATORD_BGGR (0x1ul<<CCAP_PAR_INDATORD_Pos)
58 #define CCAP_PAR_INDATORD_GBRG (0x2ul<<CCAP_PAR_INDATORD_Pos)
59 #define CCAP_PAR_INDATORD_GRBG (0x3ul<<CCAP_PAR_INDATORD_Pos)
61 #define CCAP_PAR_OUTFMT_YUV422 (0x0ul<<CCAP_PAR_OUTFMT_Pos)
62 #define CCAP_PAR_OUTFMT_ONLY_Y (0x1ul<<CCAP_PAR_OUTFMT_Pos)
63 #define CCAP_PAR_OUTFMT_RGB555 (0x2ul<<CCAP_PAR_OUTFMT_Pos)
64 #define CCAP_PAR_OUTFMT_RGB565 (0x3ul<<CCAP_PAR_OUTFMT_Pos)
66 #define CCAP_PAR_PLNFMT_YUV422 (0x0ul<<CCAP_PAR_PLNFMT_Pos)
67 #define CCAP_PAR_PLNFMT_YUV420 (0x1ul<<CCAP_PAR_PLNFMT_Pos)
69 #define CCAP_PAR_VSP_LOW (0x0ul<<CCAP_PAR_VSP_Pos)
70 #define CCAP_PAR_VSP_HIGH (0x1ul<<CCAP_PAR_VSP_Pos)
71 #define CCAP_PAR_HSP_LOW (0x0ul<<CCAP_PAR_HSP_Pos)
72 #define CCAP_PAR_HSP_HIGH (0x1ul<<CCAP_PAR_HSP_Pos)
73 #define CCAP_PAR_PCLKP_LOW (0x0ul<<CCAP_PAR_PCLKP_Pos)
74 #define CCAP_PAR_PCLKP_HIGH (0x1ul<<CCAP_PAR_PCLKP_Pos)
76 /*---------------------------------------------------------------------------------------------------------*/
77 /* INT constant definitions */
78 /*---------------------------------------------------------------------------------------------------------*/
79 #define CCAP_INT_VIEN_ENABLE (0x1ul<<CCAP_INT_VIEN_Pos)
80 #define CCAP_INT_MEIEN_ENABLE (0x1ul<<CCAP_INT_MEIEN_Pos)
81 #define CCAP_INT_ADDRMIEN_ENABLE (0x1ul<<CCAP_INT_ADDRMIEN_Pos)
82 #define CCAP_INT_MDIEN_ENABLE (0x1ul<<CCAP_INT_MDIEN_Pos)
84 /*---------------------------------------------------------------------------------------------------------*/
85 /* Define Error Code */
86 /*---------------------------------------------------------------------------------------------------------*/
87 #define CCAP_INVALID_INT ((int32_t)(0xFFFFFFFF-1))
88 #define CCAP_INVALID_BUF ((int32_t)(0xFFFFFFFF-2))
89 #define CCAP_INVALID_PIPE ((int32_t)(0xFFFFFFFF-3))
90
91 /* end of group NUC472_442_CCAP_EXPORTED_CONSTANTS */
93
94
95
108 #define CCAP_IS_STOPPED() ((CCAP->CTL & CCAP_CTL_CCAPEN_Msk)?0:1)
109
124 #define CCAP_CLR_INT_FLAG(u32IntMask) (CCAP->INT |=u32IntMask)
125
134 #define CCAP_GET_INT_STS() (CCAP->INT)
135
136 void CCAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet);
137 void CCAP_SetCroppingWindow(uint32_t u32VStart,uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width);
138 void CCAP_SetPacketBuf(uint32_t u32Address );
139 void CCAP_Close(void);
140 void CCAP_EnableInt(uint32_t u32IntMask);
141 void CCAP_DisableInt(uint32_t u32IntMask);
142 void CCAP_Start(void);
143 void CCAP_Stop(uint32_t u32FrameComplete);
144 void CCAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator);
145 void CCAP_SetPacketStride(uint32_t u32Stride );
146 void CCAP_EnableMono(uint32_t u32Interface);
147 void CCAP_DisableMono(void);
148 void CCAP_EnableLumaYOne(uint32_t u32th);
149 void CCAP_DisableLumaYOne(void);
150 /* end of group CCAP_EXPORTED_FUNCTIONS */
152
153
154 /* end of group CCAP_Driver */
156 /* end of group Standard_Driver */
158
159 #ifdef __cplusplus
160 }
161 #endif
162
163 #endif //__CCAP_H__
164
165 /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
CCAP_Stop
void CCAP_Stop(uint32_t u32FrameComplete)
Stop Camera Capture Interface.
Definition: ccap.c:226
CCAP_EnableInt
void CCAP_EnableInt(uint32_t u32IntMask)
Set CCAP Interrupt.
Definition: ccap.c:129
CCAP_SetPacketScaling
void CCAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator)
Set Packet Scaling Vertical and Horizontal Factor Register.
Definition: ccap.c:251
CCAP_Close
void CCAP_Close(void)
Close Camera Capture Interface.
Definition: ccap.c:109
CCAP_Start
void CCAP_Start(void)
Start Camera Capture Interface.
Definition: ccap.c:211
CCAP_SetPacketBuf
void CCAP_SetPacketBuf(uint32_t u32Address)
Set System Memory Packet Base Address0 Register.
Definition: ccap.c:98
CCAP_SetPacketStride
void CCAP_SetPacketStride(uint32_t u32Stride)
Set Packet Frame Output Pixel Stride Width.
Definition: ccap.c:284
CCAP_DisableInt
void CCAP_DisableInt(uint32_t u32IntMask)
Disable CCAP Interrupt.
Definition: ccap.c:150
CCAP_DisableLumaYOne
void CCAP_DisableLumaYOne(void)
Disable Luminance 8-bit Y to 1-bit Y Conversion.
Definition: ccap.c:201
CCAP_EnableMono
void CCAP_EnableMono(uint32_t u32Interface)
Enable Monochrome CMOS Sensor.
Definition: ccap.c:165
CCAP_EnableLumaYOne
void CCAP_EnableLumaYOne(uint32_t u32th)
Enable Luminance 8-bit Y to 1-bit Y Conversion.
Definition: ccap.c:189
CCAP_SetCroppingWindow
void CCAP_SetCroppingWindow(uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width)
Set Cropping Window Starting Address and Size.
Definition: ccap.c:79
CCAP_Open
void CCAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet)
Open engine clock and sensor clock.
Definition: ccap.c:58
CCAP_DisableMono
void CCAP_DisableMono(void)
Disable Monochrome CMOS Sensor.
Definition: ccap.c:176