| NUC472_NUC442_BSP V3.04.000 The Board Support Package for NUC472/NUC442

cap.h
Go to the documentation of this file.
1/**************************************************************************/
13#ifndef __CAP_H__
14#define __CAP_H__
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif
20
33/*---------------------------------------------------------------------------------------------------------*/
34/* VINCTRL constant definitions */
35/*---------------------------------------------------------------------------------------------------------*/
36#define CAP_CTL_CAPEN (1ul<<CAP_CTL_CAPEN_Pos)
37#define CAP_CTL_ADDRSW (1ul<<CAP_CTL_ADDRSW_Pos)
38#define CAP_CTL_PKTEN (1ul<<CAP_CTL_PKTEN_Pos)
39#define CAP_CTL_PLNEN (1ul<<CAP_CTL_PLNEN_Pos)
40#define CAP_CTL_SHUTTER (1ul<<CAP_CTL_SHUTTER_Pos)
41#define CAP_CTL_UPDATE (1ul<<CAP_CTL_UPDATE_Pos)
42#define CAP_CTL_RESET (1ul<<CAP_CTL_VPRST_Pos)
44/*---------------------------------------------------------------------------------------------------------*/
45/* CAPPAR constant definitions */
46/*---------------------------------------------------------------------------------------------------------*/
47#define CAP_PAR_INFMT_YUV422 (0ul<<CAP_PAR_INFMT_Pos)
48#define CAP_PAR_INFMT_RGB565 (1ul<<CAP_PAR_INFMT_Pos)
50#define CAP_PAR_SENTYPE_CCIR601 (0ul<<CAP_PAR_SENTYPE_Pos)
51#define CAP_PAR_SENTYPE_CCIR656 (1ul<<CAP_PAR_SENTYPE_Pos)
53#define CAP_PAR_INDATORD_YUYV (0x0ul<<CAP_PAR_INDATORD_Pos)
54#define CAP_PAR_INDATORD_YVYU (0x1ul<<CAP_PAR_INDATORD_Pos)
55#define CAP_PAR_INDATORD_UYVY (0x2ul<<CAP_PAR_INDATORD_Pos)
56#define CAP_PAR_INDATORD_VYUY (0x3ul<<CAP_PAR_INDATORD_Pos)
58#define CAP_PAR_INDATORD_RGGB (0x0ul<<CAP_PAR_INDATORD_Pos)
59#define CAP_PAR_INDATORD_BGGR (0x1ul<<CAP_PAR_INDATORD_Pos)
60#define CAP_PAR_INDATORD_GBRG (0x2ul<<CAP_PAR_INDATORD_Pos)
61#define CAP_PAR_INDATORD_GRBG (0x3ul<<CAP_PAR_INDATORD_Pos)
63#define CAP_PAR_OUTFMT_YUV422 (0x0ul<<CAP_PAR_OUTFMT_Pos)
64#define CAP_PAR_OUTFMT_ONLY_Y (0x1ul<<CAP_PAR_OUTFMT_Pos)
65#define CAP_PAR_OUTFMT_RGB555 (0x2ul<<CAP_PAR_OUTFMT_Pos)
66#define CAP_PAR_OUTFMT_RGB565 (0x3ul<<CAP_PAR_OUTFMT_Pos)
68#define CAP_PAR_PLNFMT_YUV422 (0x0ul<<CAP_PAR_PLNFMT_Pos)
69#define CAP_PAR_PLNFMT_YUV420 (0x1ul<<CAP_PAR_PLNFMT_Pos)
71#define CAP_PAR_VSP_LOW (0x0ul<<CAP_PAR_VSP_Pos)
72#define CAP_PAR_VSP_HIGH (0x1ul<<CAP_PAR_VSP_Pos)
73#define CAP_PAR_HSP_LOW (0x0ul<<CAP_PAR_HSP_Pos)
74#define CAP_PAR_HSP_HIGH (0x1ul<<CAP_PAR_HSP_Pos)
75#define CAP_PAR_PCLKP_LOW (0x0ul<<CAP_PAR_PCLKP_Pos)
76#define CAP_PAR_PCLKP_HIGH (0x1ul<<CAP_PAR_PCLKP_Pos)
78/*---------------------------------------------------------------------------------------------------------*/
79/* VININT constant definitions */
80/*---------------------------------------------------------------------------------------------------------*/
81#define CAP_INT_VIEN_ENABLE (0x1ul<<CAP_INT_VIEN_Pos)
82#define CAP_INT_MEIEN_ENABLE (0x1ul<<CAP_INT_MEIEN_Pos)
83#define CAP_INT_ADDRMIEN_ENABLE (0x1ul<<CAP_INT_ADDRMIEN_Pos)
84#define CAP_INT_MDIEN_ENABLE (0x1ul<<CAP_INT_MDIEN_Pos)
87 static uint32_t u32EscapeFrame = 0;
88/*---------------------------------------------------------------------------------------------------------*/
89/* Define Error Code */
90/*---------------------------------------------------------------------------------------------------------*/
91#define CAP_INVALID_INT ((int32_t)(0xFFFFFFFF-1))
92#define CAP_INVALID_BUF ((int32_t)(0xFFFFFFFF-2))
93#define CAP_INVALID_PIPE ((int32_t)(0xFFFFFFFF-3))
94
95#define CAP_TIMEOUT_ERR (-1) /* end of group NUC472_442_CAP_EXPORTED_CONSTANTS */
98
99
100
113#define CAP_IS_STOPPED() ((ICAP->CTL & CAP_CTL_CAPEN_Msk)?0:1)
114
129#define CAP_CLR_INT_FLAG(u32IntMask) (ICAP->INT |=u32IntMask)
130
139#define CAP_GET_INT_STS() (ICAP->INT)
140
141void CAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet);
142void CAP_SetCroppingWindow(uint32_t u32VStart,uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width);
143void CAP_SetPacketBuf(uint32_t u32Address );
144void CAP_SetPlanarBuf(uint32_t u32YAddr, uint32_t u32UAddr, uint32_t u32VAddr);
145void CAP_Close(void);
146void CAP_EnableInt(uint32_t u32IntMask);
147void CAP_DisableInt(uint32_t u32IntMask);
148void CAP_Start(void);
149void CAP_Stop(uint32_t u32FrameComplete);
150void CAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator);
151void CAP_SetPlanarScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator);
152void CAP_SetPacketStride(uint32_t u32Stride );
153void CAP_SetPlanarStride(uint32_t u32Stride );
154void CAP_EnableMotionDet(uint32_t u32Freq, uint32_t u32BlockSize, uint32_t u32Format, uint32_t u32Threshold, uint32_t u32YDetAddr, uint32_t u32DetAddr);
155void CAP_DisableMotionDet(void);
156 /* end of group NUC472_442_CAP_EXPORTED_FUNCTIONS */
158
159
160 /* end of group NUC472_442_CAP_Driver */
162 /* end of group NUC472_442_Device_Driver */
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif //__CAP_H__
170
171/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
u32EscapeFrame
static uint32_t u32EscapeFrame
Definition: cap.h:87
CAP_Stop
void CAP_Stop(uint32_t u32FrameComplete)
Stop Image Capture Interface.
Definition: cap.c:203
CAP_DisableMotionDet
void CAP_DisableMotionDet(void)
Enable Motion Detection Function.
Definition: cap.c:370
CAP_SetPlanarScaling
void CAP_SetPlanarScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator)
Set Planar Scaling Vertical and Horizontal Factor Register.
Definition: cap.c:274
CAP_EnableMotionDet
void CAP_EnableMotionDet(uint32_t u32Freq, uint32_t u32BlockSize, uint32_t u32Format, uint32_t u32Threshold, uint32_t u32YDetAddr, uint32_t u32DetAddr)
Enable Motion Detection Function.
Definition: cap.c:350
CAP_EnableInt
void CAP_EnableInt(uint32_t u32IntMask)
Set CAP Interrupt.
Definition: cap.c:157
CAP_SetPlanarBuf
void CAP_SetPlanarBuf(uint32_t u32YAddr, uint32_t u32UAddr, uint32_t u32VAddr)
Set System Memory Planar Y, U and V Base Address Registers.
Definition: cap.c:122
CAP_DisableInt
void CAP_DisableInt(uint32_t u32IntMask)
Disable CAP Interrupt.
Definition: cap.c:178
CAP_SetCroppingWindow
void CAP_SetCroppingWindow(uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width)
Set Cropping Window Starting Address and Size.
Definition: cap.c:84
CAP_SetPacketStride
void CAP_SetPacketStride(uint32_t u32Stride)
Set Packet Frame Output Pixel Stride Width.
Definition: cap.c:307
CAP_Start
void CAP_Start(void)
Start Image Capture Interface.
Definition: cap.c:188
CAP_Open
void CAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet)
Open engine clock and sensor clock.
Definition: cap.c:63
CAP_Close
void CAP_Close(void)
Close Image Capture Interface.
Definition: cap.c:136
CAP_SetPlanarStride
void CAP_SetPlanarStride(uint32_t u32Stride)
Set Planar Frame Output Pixel Stride Width.
Definition: cap.c:321
CAP_SetPacketBuf
void CAP_SetPacketBuf(uint32_t u32Address)
Set System Memory Packet Base Address0 Register.
Definition: cap.c:103
CAP_SetPacketScaling
void CAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator)
Set Packet Scaling Vertical and Horizontal Factor Register.
Definition: cap.c:236