Texas Instruments TMS320C64x DSP User Manual
Page 280

Example 1: Noncontinuous Frame Capture for 525/60 Format
Video Port Configuration Examples
A-4
SPRU629
/* Error flags
*/
volatile Uint32 capChaAOverrun = 0;
volatile Uint32 capChaASyncError = 0;
volatile Uint32 capChaAShortFieldDetect = 0;
volatile Uint32 capChaALongFieldDetect = 0;
/* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
/* Function : bt656_8bit_ncfc */
/* Input(s) : portNumber, video port number i.e. 0, 1 or 2. */
/* Description : Configures given video port for 8–bit BT.656 non– */
/* continuos frame capture on channel A. */
/* ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
void bt656_8bit_ncfc(int portNumber)
{
/* Open video port for capture
*/
vpCaptureHandle = VP_open(portNumber, VP_OPEN_RESET);
if(vpCaptureHandle == INV)
test_exit(FAIL);
/* Enable video port functionality in VP Peripheral
*/
/* Control Reg(PCR)
*/
VP_FSETH(vpCaptureHandle, PCR, PEREN, VP_PCR_PEREN_ENABLE);
/* ––––––––––––––––––––– */
/* Enable all interrupts */
/* ––––––––––––––––––––– */
/* Enable capture overrun interrupt(COVRA) for VP channel A
*/
VP_FSETH(vpCaptureHandle, VPIE, COVRA, VP_VPIE_COVRA_ENABLE);
/* Enable capture complete interrupt(CCMPA) for VP channel A
*/
VP_FSETH(vpCaptureHandle, VPIE, CCMPA, VP_VPIE_CCMPA_ENABLE);
/* Enable channel synchronization error interrupt(SERRA) for
*/
/* VP channel A
*/
VP_FSETH(vpCaptureHandle, VPIE, SERRA, VP_VPIE_SERRA_ENABLE);
/* Enable short field detect interrupt(SFDA) for VP channel A
*/
VP_FSETH(vpCaptureHandle, VPIE, SFDA, VP_VPIE_SFDA_ENABLE);
/* Enable video port global interrupt enable
*/
VP_FSETH(vpCaptureHandle, VPIE, VIE, VP_VPIE_VIE_ENABLE);
/* –––––––––––––––––––––– */
/* Setup all other fields */
/* –––––––––––––––––––––– */
/* Enable short field detect
*/
VP_FSETH(vpCaptureHandle, VCACTL, SFDE, VP_VCACTL_SFDE_ENABLE);
/* Set last pixel to be captured in Field1 (VCA_STOP1 reg)
*/
VP_RSETH(vpCaptureHandle, VCASTOP1,
VP_VCASTOP1_RMK(VCA_YSTOP1, VCA_XSTOP1));