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

Macros | Functions
CAP Exported Functions
NUC472/NUC442 Device Driver » CAP Driver » CAP Exported Constants
Collaboration diagram for CAP Exported Functions:

## Macros
#define | CAP_IS_STOPPED()
| Is CAP module Enable. More...
#define | CAP_CLR_INT_FLAG(u32IntMask)
| Clear CAP flag. More...
#define | CAP_GET_INT_STS()
| Get CAP Interrupt status. More...

## Functions
void | CAP_Open (uint32_t u32InFormat, uint32_t u32OutFormet)
| Open engine clock and sensor clock. More...
void | CAP_SetCroppingWindow (uint32_t u32VStart, uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width)
| Set Cropping Window Starting Address and Size. More...
void | CAP_SetPacketBuf (uint32_t u32Address)
| Set System Memory Packet Base Address0 Register. More...
void | CAP_SetPlanarBuf (uint32_t u32YAddr, uint32_t u32UAddr, uint32_t u32VAddr)
| Set System Memory Planar Y, U and V Base Address Registers. More...
void | CAP_Close (void)
| Close Image Capture Interface. More...
void | CAP_EnableInt (uint32_t u32IntMask)
| Set CAP Interrupt. More...
void | CAP_DisableInt (uint32_t u32IntMask)
| Disable CAP Interrupt. More...
void | CAP_Start (void)
| Start Image Capture Interface. More...
void | CAP_Stop (uint32_t u32FrameComplete)
| Stop Image Capture Interface. More...
void | CAP_SetPacketScaling (uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator)
| Set Packet Scaling Vertical and Horizontal Factor Register. More...
void | CAP_SetPlanarScaling (uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator)
| Set Planar Scaling Vertical and Horizontal Factor Register. More...
void | CAP_SetPacketStride (uint32_t u32Stride)
| Set Packet Frame Output Pixel Stride Width. More...
void | CAP_SetPlanarStride (uint32_t u32Stride)
| Set Planar Frame Output Pixel Stride Width. More...
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. More...
void | CAP_DisableMotionDet (void)
| Enable Motion Detection Function. More...

## Detailed Description

## Macro Definition Documentation

## ◆ CAP_CLR_INT_FLAG

#define CAP_CLR_INT_FLAG | ( |  | u32IntMask | ) |

Clear CAP flag.

Parameters

  [in] | u32IntMask | interrupt flags settings. It could be CAP_INT_VINTF_Msk CAP_INT_MEINTF_Msk CAP_INT_ADDRMINTF_Msk CAP_INT_MDINTF_Msk

Returns
  TRUE(Enable) or FALSE(Disable)

Clear Image Capture Interface interrupt flag

Definition at line 129 of file cap.h.

## ◆ CAP_GET_INT_STS

#define CAP_GET_INT_STS | ( |  | ) |

Get CAP Interrupt status.

Returns
  TRUE(Enable) or FALSE(Disable)

Get Image Capture Interface interrupt status.

Definition at line 139 of file cap.h.

## ◆ CAP_IS_STOPPED

#define CAP_IS_STOPPED | ( |  | ) |

Is CAP module Enable.

Returns
  FALSE(Enable) or TRUE(Disable)

Check Image Capture Interface module Enable or Disable

Definition at line 113 of file cap.h.

## Function Documentation

## ◆ CAP_Close()

void CAP_Close | ( | void |  | ) |

Close Image Capture Interface.

Returns
  None

Definition at line 136 of file cap.c.

## ◆ CAP_DisableInt()

void CAP_DisableInt | ( | uint32_t | u32IntMask | ) |

Disable CAP Interrupt.

Parameters

  [in] | u32IntMask | Interrupt settings. It could be CAP_INT_VINTF_Msk CAP_INT_MEINTF_Msk CAP_INT_ADDRMINTF_Msk CAP_INT_MDINTF_Msk

Returns
  None

Disable Video Frame End Interrupt , System Memory Error Interrupt , Address Match Interrupt and Motion Detection Output Finish Interrupt .

Definition at line 178 of file cap.c.

## ◆ CAP_DisableMotionDet()

void CAP_DisableMotionDet | ( | void |  | ) |

Enable Motion Detection Function.

Returns
  None

Set Planar Frame Output Pixel Stride Width

Definition at line 370 of file cap.c.

## ◆ CAP_EnableInt()

void CAP_EnableInt | ( | uint32_t | u32IntMask | ) |

Set CAP Interrupt.

Parameters

  [in] | u32IntMask | Interrupt settings. It could be CAP_INT_VIEN_Msk CAP_INT_MEIEN_Msk CAP_INT_ADDRMIEN_Msk CAP_INT_MDIEN_Msk

Returns
  None

Set Video Frame End Interrupt Enable, System Memory Error Interrupt Enable, Address Match Interrupt Enable, Motion Detection Output Finish Interrupt Enable.

Definition at line 157 of file cap.c.

## ◆ 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.

Parameters

  [in] | u32Freq | Motion Detection Detect Frequency. It should be 0x0 ~ 0x3.
  [in] | u32BlockSize | Motion Detection Block Size FALSE : 16x16 TRUE : 8x8
  [in] | u32Format | Motion Detection Save Mode FALSE : 1 bit DIFF + 7 Y Differential TRUE : 1 bit DIFF only
  [in] | u32Threshold | Motion Detection Detect Threshold. It should be 0x0 ~ 0x1F.
  [in] | u32YDetAddr | : Motion Detection Detect Temp Y Output Address
  [in] | u32DetAddr | Motion Detection Detect Address

Returns
  None

Set Planar Frame Output Pixel Stride Width

Definition at line 350 of file cap.c.

## ◆ CAP_Open()

void CAP_Open | ( | uint32_t | u32InFormat,
|  | uint32_t | u32OutFormet
| ) |  |

Open engine clock and sensor clock.

Parameters

  [in] | u32InFormat | The bits corresponding VSP, HSP, PCLK, INFMT, SNRTYPE, OUTFMT, PDORD and PNFMT configurations. VSP should be ether CAP_PAR_VSP_LOW or CAP_PAR_VSP_HIGH HSP should be ether CAP_PAR_HSP_LOW or CAP_PAR_HSP_HIGH PCLK should be ether CAP_PAR_PCLKP_LOW or CAP_PAR_PCLKP_HIGH INFMT should be ether CAP_PAR_INFMT_YUV422 or CAP_PAR_INFMT_RGB565 SNRTYPE should be ether CAP_PAR_SENTYPE_CCIR601 or CAP_PAR_SENTYPE_CCIR656 OUTFMT should be one of the following setting CAP_PAR_OUTFMT_YUV422 CAP_PAR_OUTFMT_ONLY_Y CAP_PAR_OUTFMT_RGB555 CAP_PAR_OUTFMT_RGB565 PDORD should be one of the following setting CAP_PAR_INDATORD_YUYV CAP_PAR_INDATORD_YVYU CAP_PAR_INDATORD_UYVY CAP_PAR_INDATORD_VYUY CAP_PAR_INDATORD_RGGB CAP_PAR_INDATORD_BGGR CAP_PAR_INDATORD_GBRG CAP_PAR_INDATORD_GRBG PNFMT should be one of the following setting CAP_PAR_PLNFMT_YUV422 CAP_PAR_PLNFMT_YUV420
  [in] | u32OutFormet | Capture output format, should be one of following setting CAP_CTL_PKTEN CAP_CTL_PLNEN

Returns
  None

Initialize the Image Capture Interface. Register a call back for driver internal using

Definition at line 63 of file cap.c.

## ◆ CAP_SetCroppingWindow()

void CAP_SetCroppingWindow | ( | uint32_t | u32VStart,
|  | uint32_t | u32HStart,
|  | uint32_t | u32Height,
|  | uint32_t | u32Width
| ) |  |

Set Cropping Window Starting Address and Size.

Parameters

  [in] | u32VStart | Cropping Window Vertical Starting Address. It should be 0 ~ 0x7FF.
  [in] | u32HStart | Cropping Window Horizontal Starting Address. It should be 0 ~ 0x7FF.
  [in] | u32Height | Cropping Window Height . It should be 0 ~ 0x7FF.
  [in] | u32Width | Cropping Window Width. It should be 0 ~ 0x7FF.

Returns
  None

Set Cropping Window Starting Address Register

Definition at line 84 of file cap.c.

## ◆ CAP_SetPacketBuf()

void CAP_SetPacketBuf | ( | uint32_t | u32Address | ) |

Set System Memory Packet Base Address0 Register.

Parameters

  [in] | u32Address | : set PKTBA0 register, It should be 0x0 ~ 0xFFFFFFFF

Returns
  None

Set System Memory Packet Base Address Register

Definition at line 103 of file cap.c.

## ◆ 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.

Parameters

  [in] | u32VNumerator | Packet Scaling Vertical Factor N. It should be 0 ~ FFFF.
  [in] | u32VDenominator | Packet Scaling Vertical Factor M. It should be 0 ~ FFFF.
  [in] | u32HNumerator | Packet Scaling Vertical Factor N. It should be 0 ~ FFFF.
  [in] | u32HDenominator | Packet Scaling Vertical Factor M. It should be 0 ~ FFFF.

Returns
  None

Definition at line 236 of file cap.c.

## ◆ CAP_SetPacketStride()

void CAP_SetPacketStride | ( | uint32_t | u32Stride | ) |

Set Packet Frame Output Pixel Stride Width.

Parameters

  [in] | u32Stride | : set PKTSTRIDE register, It should be 0x0 ~ 0x3FFF

Returns
  None

Set Packet Frame Output Pixel Stride Width

Definition at line 307 of file cap.c.

## ◆ 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.

Parameters

  [in] | u32YAddr | : set YBA register, It should be 0x0 ~ 0xFFFFFFFF
  [in] | u32UAddr | : set UBA register, It should be 0x0 ~ 0xFFFFFFFF
  [in] | u32VAddr | : set VBA register, It should be 0x0 ~ 0xFFFFFFFF

Returns
  None

Set System Memory Planar Y,U and V Base Address Registers

Definition at line 122 of file cap.c.

## ◆ 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.

Parameters

  [in] | u32VNumerator | Planar Scaling Vertical Factor N. It should be 0 ~ FFFF.
  [in] | u32VDenominator | Planar Scaling Vertical Factor M. It should be 0 ~ FFFF.
  [in] | u32HNumerator | Planar Scaling Vertical Factor N. It should be 0 ~ FFFF.
  [in] | u32HDenominator | Planar Scaling Vertical Factor M. It should be 0 ~ FFFF.

Returns
  None

Definition at line 274 of file cap.c.

## ◆ CAP_SetPlanarStride()

void CAP_SetPlanarStride | ( | uint32_t | u32Stride | ) |

Set Planar Frame Output Pixel Stride Width.

Parameters

  [in] | u32Stride | : set PLNSTRIDE register, It should be 0x0 ~ 0x3FFF

Returns
  None

Set Planar Frame Output Pixel Stride Width

Definition at line 321 of file cap.c.

## ◆ CAP_Start()

void CAP_Start | ( | void |  | ) |

Start Image Capture Interface.

Returns
  None

Definition at line 188 of file cap.c.

## ◆ CAP_Stop()

void CAP_Stop | ( | uint32_t | u32FrameComplete | ) |

Stop Image Capture Interface.

Parameters

  [in] | u32FrameComplete | : TRUE: Capture module automatically disable the CAP module after a frame had been captured FALSE: Stop Capture module now

Returns
  None

if u32FrameComplete is set to TRUE then get a new frame and disable CAP module

Definition at line 203 of file cap.c.