-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_detector.c
108 lines (97 loc) · 2.86 KB
/
video_detector.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//----------------------------------------------------------------
// _____
// / \
// /____ \____
// / \===\ \==/
// /___\===\___\/ AVNET
// \======/
// \====/
//---------------------------------------------------------------
//
// This design is the property of Avnet. Publication of this
// design is not authorized without written consent from Avnet.
//
// Please direct any questions to: technical.support@avnet.com
//
// Disclaimer:
// Avnet, Inc. makes no warranty for the use of this code or design.
// This code is provided "As Is". Avnet, Inc assumes no responsibility for
// any errors, which may appear in this code, nor does it make a commitment
// to update the information contained herein. Avnet, Inc specifically
// disclaims any implied warranties of fitness for a particular purpose.
// Copyright(c) 2011 Avnet, Inc.
// All rights reserved.
//
//----------------------------------------------------------------
//
// Create Date: Dec 09, 2011
// Design Name: Video Detector
// Module Name: video_detector.h
// Project Name: FMC-IMAGEON
// Target Devices: Zynq-7000
// Avnet Boards: FMC-IMAGEON
//
// Tool versions: ISE 14.3
//
// Description: Video Timing Detector using:
// - Xilinx Video Timing Controller (VTC)
//
// Dependencies:
//
// Revision: Dec 09, 2011: 1.00 Initial version
// Dec 05, 2012: 1.01 vdet_init resets VTC core
//
//----------------------------------------------------------------
#include "video_detector.h"
#include "video_resolution.h"
/*****************************************************************************/
/**
*
* vdet_init
* - initializes the VTC detector
*
* @param VtcDeviceID is the device ID of the Video Timing Controller core.
* pVtc is a pointer to a VTC instance
*
* @return 0 if all tests pass, 1 otherwise.
*
* @note None.
*
******************************************************************************/
int vdet_init(XVtc *pVtc, u16 VtcDeviceID)
{
XVtc_Config *VtcCfgPtr;
int Status;
/* Look for the device configuration info for the Video Timing
* Controller.
*/
VtcCfgPtr = XVtc_LookupConfig( VtcDeviceID );
if (VtcCfgPtr == NULL) {
return 1;
}
/* Initialize the Video Timing Controller instance */
Status = XVtc_CfgInitialize(pVtc, VtcCfgPtr,
VtcCfgPtr->BaseAddress);
if (Status != XST_SUCCESS) {
return 1;
}
return 0;
}
/*****************************************************************************/
/**
*
* vdet_reset
* - resets the VTC detector
*
* @param pVtc is a pointer to a VTC instance
*
* @return 0 if all tests pass, 1 otherwise.
*
* @note None.
*
******************************************************************************/
int vdet_reset(XVtc *pVtc)
{
XVtc_Reset(pVtc);
return 0;
}