From 31d5d373fe0d5cb4a86c3880a19594aaf1187cfc Mon Sep 17 00:00:00 2001 From: Shravan Kumar A Date: Tue, 15 Jul 2014 12:18:55 +0530 Subject: [PATCH] cfa: Added files to cfa driver. Added source files, integration files, self test example, mdd and tcl files to cfa driver. Signed-off-by: Shravan Kumar A Signed-off-by: Jagannadha Sutradharudu Teki Acked-by: Srikanth Vemula --- XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl | 11 +- .../drivers/cfa/doc/html/api/annotated.html | 28 + .../drivers/cfa/doc/html/api/files.html | 33 + .../drivers/cfa/doc/html/api/functions.html | 57 + .../cfa/doc/html/api/functions_vars.html | 57 + .../drivers/cfa/doc/html/api/globals.html | 165 ++ .../cfa/doc/html/api/globals_defs.html | 131 ++ .../cfa/doc/html/api/globals_enum.html | 40 + .../cfa/doc/html/api/globals_eval.html | 46 + .../cfa/doc/html/api/globals_func.html | 59 + .../cfa/doc/html/api/globals_type.html | 41 + .../cfa/doc/html/api/globals_vars.html | 40 + .../drivers/cfa/doc/html/api/index.html | 90 ++ .../doc/html/api/struct_x_cfa-members.html | 35 + .../cfa/doc/html/api/struct_x_cfa.html | 206 +++ .../api/struct_x_cfa___config-members.html | 38 + .../doc/html/api/struct_x_cfa___config.html | 257 ++++ .../drivers/cfa/doc/html/api/tab_b.gif | Bin 0 -> 35 bytes .../drivers/cfa/doc/html/api/tab_l.gif | Bin 0 -> 706 bytes .../drivers/cfa/doc/html/api/tab_r.gif | Bin 0 -> 2585 bytes .../drivers/cfa/doc/html/api/tabs.css | 102 ++ .../drivers/cfa/doc/html/api/xcfa_8c.html | 609 ++++++++ .../drivers/cfa/doc/html/api/xcfa_8h.html | 1362 +++++++++++++++++ .../drivers/cfa/doc/html/api/xcfa__g_8c.html | 77 + .../drivers/cfa/doc/html/api/xcfa__hw_8h.html | 1178 ++++++++++++++ .../cfa/doc/html/api/xcfa__intr_8c.html | 73 + .../cfa/doc/html/api/xcfa__selftest_8c.html | 73 + .../cfa/doc/html/api/xcfa__sinit_8c.html | 71 + .../cfa/examples/cfa_selftest_example.c | 195 +++ .../drivers/cfa/examples/example.c | 88 -- XilinxProcessorIPLib/drivers/cfa/src/cfa.h | 317 ---- XilinxProcessorIPLib/drivers/cfa/src/xcfa.c | 645 ++++++++ XilinxProcessorIPLib/drivers/cfa/src/xcfa.h | 601 ++++++++ .../drivers/cfa/src/{cfa.c => xcfa_g.c} | 55 +- .../drivers/cfa/src/xcfa_hw.h | 260 ++++ .../drivers/cfa/src/xcfa_intr.c | 208 +++ .../drivers/cfa/src/xcfa_selftest.c | 110 ++ .../drivers/cfa/src/xcfa_sinit.c | 107 ++ 38 files changed, 7033 insertions(+), 432 deletions(-) create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/annotated.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/files.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions_vars.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_defs.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_enum.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_eval.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_func.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_type.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_vars.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/index.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa-members.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config-members.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_b.gif create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_l.gif create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_r.gif create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/tabs.css create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8c.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8h.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__g_8c.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__hw_8h.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__intr_8c.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__selftest_8c.html create mode 100644 XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__sinit_8c.html create mode 100755 XilinxProcessorIPLib/drivers/cfa/examples/cfa_selftest_example.c delete mode 100755 XilinxProcessorIPLib/drivers/cfa/examples/example.c delete mode 100755 XilinxProcessorIPLib/drivers/cfa/src/cfa.h create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa.c create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa.h rename XilinxProcessorIPLib/drivers/cfa/src/{cfa.c => xcfa_g.c} (55%) create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa_hw.h create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa_intr.c create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa_selftest.c create mode 100755 XilinxProcessorIPLib/drivers/cfa/src/xcfa_sinit.c diff --git a/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl b/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl index 5a435a47..d4997ff2 100755 --- a/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl +++ b/XilinxProcessorIPLib/drivers/cfa/data/cfa.tcl @@ -1,9 +1,9 @@ -############################################################################### +############################################################################## # # Copyright (C) 2001 - 2014 Xilinx, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal +# of this software and associated documentation files (the "Software"),to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is @@ -28,9 +28,10 @@ # in advertising or otherwise to promote the sale, use or other dealings in # this Software without prior written authorization from Xilinx. # -############################################################################### +############################################################################## proc generate {drv_handle} { - xdefine_include_file $drv_handle "xparameters.h" "CFA" "C_BASEADDR" "C_HIGHADDR" - xdefine_canonical_xpars $drv_handle "xparameters.h" "CFA" "C_BASEADDR" "C_HIGHADDR" + xdefine_include_file $drv_handle "xparameters.h" "CFA" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_S_AXIS_VIDEO_FORMAT" "C_M_AXIS_VIDEO_FORMAT" "C_S_AXI_CLK_FREQ_HZ" "C_BAYER_PHASE" "C_ACTIVE_ROWS" "C_ACTIVE_COLS" "C_MAX_COLS" "C_HAS_INTC_IF" "C_HAS_DEBUG" "C_HOR_FILT" "C_FRINGE_TOL" + xdefine_config_file $drv_handle "xcfa_g.c" "XCfa" "DEVICE_ID" "C_BASEADDR" "C_S_AXIS_VIDEO_FORMAT" "C_M_AXIS_VIDEO_FORMAT" "C_S_AXI_CLK_FREQ_HZ" "C_BAYER_PHASE" "C_ACTIVE_ROWS" "C_ACTIVE_COLS" "C_MAX_COLS" "C_HAS_INTC_IF" "C_HAS_DEBUG" "C_HOR_FILT" "C_FRINGE_TOL" + xdefine_canonical_xpars $drv_handle "xparameters.h" "CFA" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_S_AXIS_VIDEO_FORMAT" "C_M_AXIS_VIDEO_FORMAT" "C_S_AXI_CLK_FREQ_HZ" "C_BAYER_PHASE" "C_ACTIVE_ROWS" "C_ACTIVE_COLS" "C_MAX_COLS" "C_HAS_INTC_IF" "C_HAS_DEBUG" "C_HOR_FILT" "C_FRINGE_TOL" } diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/annotated.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/annotated.html new file mode 100644 index 00000000..d34ee5bc --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/annotated.html @@ -0,0 +1,28 @@ + + + + + Class List + + + + +Software Drivers +
+ + + +

Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + +
XCfa
XCfa_Config
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/files.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/files.html new file mode 100644 index 00000000..cb5b3115 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/files.html @@ -0,0 +1,33 @@ + + + + + File Index + + + + +Software Drivers +
+ + + +

File List

Here is a list of all files with brief descriptions: + + + + + + + +
xcfa.c
xcfa.h
xcfa_g.c
xcfa_hw.h
xcfa_intr.c
xcfa_selftest.c
xcfa_sinit.c
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions.html new file mode 100644 index 00000000..0cce54e0 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions.html @@ -0,0 +1,57 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + +
+ +
+Here is a list of all class members with links to the classes they belong to: +

+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions_vars.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions_vars.html new file mode 100644 index 00000000..89293097 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/functions_vars.html @@ -0,0 +1,57 @@ + + + + + Class Members - Variables + + + + +Software Drivers +
+ + + +
+ +
+  +

+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals.html new file mode 100644 index 00000000..8735573b --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals.html @@ -0,0 +1,165 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +
+
    +
  • b
  • +
  • c
  • +
  • x
  • +
+
+ +

+Here is a list of all file members with links to the files they belong to: +

+

- b -

    +
  • BayerPhaseCombination +: xcfa.h
+

- c -

+

- x -

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_defs.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_defs.html new file mode 100644 index 00000000..79a40b0f --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_defs.html @@ -0,0 +1,131 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +
+
    +
  • c
  • +
  • x
  • +
+
+ +

+  +

+

- c -

+

- x -

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_enum.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_enum.html new file mode 100644 index 00000000..6ae0fb36 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_enum.html @@ -0,0 +1,40 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +  +

+

    +
  • BayerPhaseCombination +: xcfa.h
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_eval.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_eval.html new file mode 100644 index 00000000..a0b7ef2d --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_eval.html @@ -0,0 +1,46 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +  +

+

    +
  • XCFA_BGBG_COMBINATION +: xcfa.h
  • XCFA_GBGB_COMBINATION +: xcfa.h
  • XCFA_GRGR_COMBINATION +: xcfa.h
  • XCFA_HANDLER_ERROR +: xcfa.h
  • XCFA_HANDLER_FRAMEDONE +: xcfa.h
  • XCFA_HANDLER_PROCSTART +: xcfa.h
  • XCFA_RGRG_COMBINATION +: xcfa.h
+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_func.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_func.html new file mode 100644 index 00000000..bd0d9552 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_func.html @@ -0,0 +1,59 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +  +

+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_type.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_type.html new file mode 100644 index 00000000..6b6b9468 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_type.html @@ -0,0 +1,41 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +  +

+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_vars.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_vars.html new file mode 100644 index 00000000..d5830502 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/globals_vars.html @@ -0,0 +1,40 @@ + + + + + Class Members + + + + +Software Drivers +
+ + + + +  +

+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/index.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/index.html new file mode 100644 index 00000000..5ccc4256 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/index.html @@ -0,0 +1,90 @@ + + + + + Main Page + + + + +Software Drivers +
+ + +

+

+This header file contains identifiers and register-level core functions (or macros), range macros, structure typedefs that can be used to access the Xilinx Color Filter Array Interpolation (CFA) core.

+The Color Filter Array Interpolation core reconstructs a color image from an RGB or CMY Bayer filtered sensor using a 5x5 interpolation aperture. The core is capable of a maximum resolution of 7680 columns by 7680 rows with 8, 10, or 12 bits per pixel and supports the bandwidth necessary for High-definition (1080p60) resolutions in all Xilinx FPGA device families. Higher resolutions can be supported in Xilinx high-performance device families.

+Initialization & Configuration

+The device driver enables higher layer software (e.g., an application) to communicate to the CFA core.

+XCfa_CfgInitialize() API is used to initialize the CFA core. The user needs to first call the XCfa_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XCfa_CfgInitialize() API.

+ Interrupts

+The driver provides an interrupt handler XCfa_IntrHandler for handling the interrupt from the CFA core. The users of this driver have to register this handler with the interrupt system and provide the callback functions by using XCfa_SetCallBack API.

+ Virtual Memory

+This driver supports Virtual Memory. The RTOS is responsible for calculating the correct device base address in Virtual Memory space.

+ Threads

+This driver is not thread safe. Any needs for threads or thread mutual exclusion must be satisfied by the layer above this driver.

+ Asserts

+Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.

+ Building the driver

+The XCfa driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

+

+ MODIFICATION HISTORY:

+

 Ver   Who    Date     Changes
+ ----- ------ -------- ----------------------------------------------
+ 1.00a xd     08/05/08 First release
+ 3.00a gz     10/22/10 Updated for CFA V3.0
+ 4.00a rc     09/11/11 Updated for CFA v4.0
+ 5.00a se     12/01/11 Updated for CFA v5.0, replaced xio.h with xil_io.h.
+ 6.0   adk    19/12/13 Updated as per the New Tcl API's.
+ 7.0   adk    01/07/14 Changed the file name from cfa.h to xcfa.h
+                       Defined following handler types as enum
+                       XCFA_HANDLER_PROCSTART, XCFA_HANDLER_FRAMEDONE,
+                       XCFA_HANDLER_ERROR.

+

                       Defined the BayerPhaseCombination enum
+                       for bayerphase combinations.

+

                       Defined the following macros:
+                       XCFA_VSIZE_FIRST, XCFA_VSIZE_LAST
+                       XCFA_HSIZE_FIRST, XCFA_HSIZE_LAST
+                       XCfa_Start, XCfa_Stop, XCfa_IntrEnable,
+                       XCfa_IntrDisable, XCfa_StatusGetPending,
+                       XCfa_IntrGetPending, XCfa_IntrClear.

+

                       Added the following function macros:
+                       XCfa_Enable, XCfa_Disable, XCfa_Reset, XCfa_SyncReset,
+                       XCfa_RegUpdateEnable, XCfa_RegUpdateDisable.

+

                       Removed the following functional macros:
+                       CFA_Enable, CFA_Disable, CFA_Reset, CFA_FSyncReset,
+                       XCFA_RegUpdateEnable, XCFA_RegUpdateDisable,
+                       CFA_ClearReset, CFA_ClearStatus.

+

                       Defined the following type definitions:
+                       XCfa_Config and XCfa structures.
+                       XCfa_CallBack and XCfa_ErrorCallBack.

+

                       Changes in xcfa_hw.h:
+                       Added the register offsets and bit masks for the
+                       registers and added backward compatibility for macros.

+

                       Changes in xcfa.c:
+                       Renamed this file as below:
+                       cfa.c -> xcfa.c
+                       Implemented the following functions:
+                       XCfa_CfgInitialize, XCfa_Setup, XCfa_GetVersion,
+                       XCfa_EnableDbgByPass, XCfa_IsDbgByPassEnabled,
+                       XCfa_DisableDbgBypass, XCfa_EnableDbgTestPattern,
+                       XCfa_IsDbgTestPatternEnabled,
+                       XCfa_DisableDbgTestPattern, XCfa_GetDbgFrameCount,
+                       XCfa_GetDbgLineCount, XCfa_GetDbgPixelCount,
+                       XCfa_SetActiveSize, XCfa_GetActiveSize,
+                       XCfa_SetBayerPhase, XCfa_GetBayerPhase,
+                       StubCallBack, StubErrCallBack.

+

                       Changes in  xcfa_intr.c:
+                       Implemented the following functions:
+                       XCfa_IntrHandler, XCfa_SetCallBack.

+

                       Changes in xcfa_selftest.c:
+                       Implemented XCfa_SelfTest function.

+

                       Changes in xcfa_sinit.c :
+                       Implemented XCfa_LookupConfig function.
+ 
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa-members.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa-members.html new file mode 100644 index 00000000..2a2004a4 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa-members.html @@ -0,0 +1,35 @@ + + + + + Member List + + + + +Software Drivers +
+ + + +

XCfa Member List

This is the complete list of members for XCfa, including all inherited members.

+ + + + + + + + + + +
ConfigXCfa
ErrCallBackXCfa
ErrRefXCfa
FrameDoneCallBackXCfa
FrameDoneRefXCfa
HSizeXCfa
IsReadyXCfa
ProcStartCallBackXCfa
ProcStartRefXCfa
VSizeXCfa
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa.html new file mode 100644 index 00000000..a8bb1c93 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa.html @@ -0,0 +1,206 @@ + + + + + XCfa Struct Reference + + + +

+Software Drivers +
+ + + +

XCfa Struct Reference

#include <xcfa.h> +

+List of all members.


Detailed Description

+The XCfa instance data structure. A pointer to an instance data structure is passed around by functions to refer to a specific instance. +

+ + + + + + + + + + + + + + + + + + + + + + + +

Public Attributes

XCfa_Config Config
u32 IsReady
u16 HSize
u16 VSize
XCfa_CallBack ProcStartCallBack
void * ProcStartRef
XCfa_CallBack FrameDoneCallBack
void * FrameDoneRef
XCfa_ErrorCallBack ErrCallBack
void * ErrRef
+


Member Data Documentation

+ +
+ +
+ +

+Hardware configuration +

+

+ +

+ +
+ +

+Callback for error interrupt +

+

+ +

+
+ + + + +
void* XCfa::ErrRef
+
+
+ +

+To be passed to the error interrupt callback +

+

+ +

+ +
+ +

+Callback for frame done interrupt +

+

+ +

+
+ + + + +
void* XCfa::FrameDoneRef
+
+
+ +

+To be passed to the frame done interrupt callback +

+

+ +

+
+ + + + +
u16 XCfa::HSize
+
+
+ +

+Active video horizontal size +

+

+ +

+
+ + + + +
u32 XCfa::IsReady
+
+
+ +

+Core instance is initialized +

+

+ +

+ +
+ +

+Callback for processing start interrupt +

+

+ +

+
+ + + + +
void* XCfa::ProcStartRef
+
+
+ +

+To be passed to the process start interrupt callback +

+

+ +

+
+ + + + +
u16 XCfa::VSize
+
+
+ +

+Active video vertical size +

+

+


The documentation for this struct was generated from the following file: +Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config-members.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config-members.html new file mode 100644 index 00000000..3c82af29 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config-members.html @@ -0,0 +1,38 @@ + + + + + Member List + + + + +Software Drivers +
+ + + +

XCfa_Config Member List

This is the complete list of members for XCfa_Config, including all inherited members.

+ + + + + + + + + + + + + +
ActiveColumnsXCfa_Config
ActiveRowsXCfa_Config
BaseAddressXCfa_Config
BayerPhaseXCfa_Config
DeviceIdXCfa_Config
FringeTolXCfa_Config
HasDebugXCfa_Config
HasIntcIfXCfa_Config
HorFiltXCfa_Config
MasterAxisVideoFormatXCfa_Config
MaxColumnsXCfa_Config
SlaveAxiClkFreqHzXCfa_Config
SlaveAxisVideoFormatXCfa_Config
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config.html new file mode 100644 index 00000000..62a873a2 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/struct_x_cfa___config.html @@ -0,0 +1,257 @@ + + + + + XCfa_Config Struct Reference + + + +

+Software Drivers +
+ + + +

XCfa_Config Struct Reference

#include <xcfa.h> +

+List of all members.


Detailed Description

+This typedef contains configuration information for the CFA core. Each CFA core should have a configuration structure associated. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Attributes

u16 DeviceId
u32 BaseAddress
u32 SlaveAxisVideoFormat
u32 MasterAxisVideoFormat
u8 BayerPhase
u32 SlaveAxiClkFreqHz
u32 ActiveRows
u32 ActiveColumns
u32 MaxColumns
u16 HasIntcIf
u16 HasDebug
u32 HorFilt
u32 FringeTol
+


Member Data Documentation

+ +
+ +
+ +

+Active Columns +

+

+ +

+
+ + + + +
u32 XCfa_Config::ActiveRows
+
+
+ +

+Active rows +

+

+ +

+
+ + + + +
u32 XCfa_Config::BaseAddress
+
+
+ +

+BaseAddress is the physical base address of the core's registers +

+

+ +

+
+ + + + +
u8 XCfa_Config::BayerPhase
+
+
+ +

+Bayer Phase +

+

+ +

+
+ + + + +
u16 XCfa_Config::DeviceId
+
+
+ +

+DeviceId is the unique ID of the core +

+

+ +

+
+ + + + +
u32 XCfa_Config::FringeTol
+
+
+ +

+Fringe Tolerance +

+

+ +

+
+ + + + +
u16 XCfa_Config::HasDebug
+
+
+ +

+Has Debug GUI specified +

+

+ +

+
+ + + + +
u16 XCfa_Config::HasIntcIf
+
+
+ +

+Has Interrupt Control +

+

+ +

+
+ + + + +
u32 XCfa_Config::HorFilt
+
+
+ +

+Optional Horizontal Filter +

+

+ +

+ +
+ +

+Master Axis Video Format +

+

+ +

+
+ + + + +
u32 XCfa_Config::MaxColumns
+
+
+ +

+Maximum Columns +

+

+ +

+ +
+ +

+Slave Clock Frequency +

+

+ +

+ +
+ +

+Slave Axis Video Format +

+

+


The documentation for this struct was generated from the following file: +Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_b.gif b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_l.gif b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_r.gif b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+0i1zeusiYVp-phBl7b5+Px-X&LhByq z0F&<;K0l2+v>qiHlXb#$jXMv$uK-dEGE9L~qtdU(XeRXmvu*K2Q&6!fD**JxYP4b4BR7FdJ$Qx9G9`J%-_X!a#LGpp3g9)VWytGCa;7`S1_e8F~!R+aSJ zOF17p2`H?2kPs8Q`_;U}+D%3p zs2-0BTqFwpUoBk`?P;iPQ(IbEA|JmMx!P&YYG|R@S=5Mnw;-?A6rEEVyV%d7{iU4a zNk`i!%F(Ykpm`}#oH;BjY->@b8vQedv;pza2FL&*6ufjd+*3Ute&>kes~TU?^KkojsTh(o~(3tk1Y6>4(yn( z#U*ID9@eg-beKo1B;HXe+}{Z%n@7m0+yxivuqk9~;!1LGQlah)xYK4>wgL}l6dsaN zIxlRlq`*`j9PG4*0hD6YV_b_2w5b#)o7J?`q#{GjvvKlD`T*dWcZx<-s(ZvLB44E# z=!|sw!?)@%y$oRNL#25WS3lzdii}TuQ3?CLnvQ1_n};2sT_;Y;#d3=+-(O% zMN$>O!3;ke(UuLR%h_&)N zs^!-@A>QR}4yB1bPp`9S19ikTbZ~O{&FF-yHK{En;mmShDUIEw03`j(DBIsM}Rjki2J#SQa3gFZTKBPDeIiLt9Z z%bL3(B@Qw%(B`wSMS~dPh$=R`(}lBoFXKy(s|*{#ru$wjsBc_O#zxNk9w+UUHmx(U zmJ8+M+ndtnZ<7|VU9Mbt61zpo9T&3%Wx&XII=#QJxjR`CZf22ac3d51Z?GD%LEe_&*t46Qf;4`bZ7p2K(Ab5>GfT^}4! zBT&HZD`^PEgWoI&{~o-ID0F?O`75sm(87x%A{(}Ch1)QlzdJ)1B-eqe5a(weg0`4lQIf1evjvbBY50DVbzO7CLf|vP z2#0(U-|jZ`H{y5N^o7%iK6H>_HEGN->U6^!)1{XpJV!!4(Ig7wzZQ*9WYF4X1rG0x z=1uA@i`rIAciubDC{;~b(|&|A@xkjRP5aRcvRU9tvIm}jDB6J eQ0-6-y)mpwdT=ayS0tBxKDA*~;EWmo literal 0 HcmV?d00001 diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tabs.css b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tabs.css new file mode 100644 index 00000000..a61552a6 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8c.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8c.html new file mode 100644 index 00000000..1911f165 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8c.html @@ -0,0 +1,609 @@ + + + + + xcfa.c File Reference + + + + +Software Drivers +
+ + + +

xcfa.c File Reference


Detailed Description

+This file contains the implementation of the interface functions for CFA core. Refer to the header file xcfa.h for more detailed information.

+

+ MODIFICATION HISTORY:

+

 Ver   Who    Date     Changes
+ ----- ------ -------- --------------------------------------------------
+ 1.00  drg/jz 01/13/10 First Release
+ 3.00a gz     10/22/10 Updated for CFA V3.0
+ 4.00a rc     09/11/11 Updated for CFA v4.0
+ 5.00a se     12/01/11 Updated for CFA v5.0
+ 7.0   adk    01/07/14 Changed the file name from
+                       cfa.c to xcfa.c
+                       Implemented the following functions:
+                       XCfa_CfgInitialize, XCfa_Setup,
+                       XCfa_GetVersion,
+                       XCfa_EnableDbgByPass,
+                       XCfa_IsDbgByPassEnabled,
+                       XCfa_DisableDbgBypass,
+                       XCfa_EnableDbgTestPattern,
+                       XCfa_IsDbgTestPatternEnabled,
+                       XCfa_DisableDbgTestPattern,
+                       XCfa_GetDbgFrameCount
+                       XCfa_GetDbgLineCount, XCfa_GetDbgPixelCount
+                       XCfa_SetActiveSize, XCfa_GetActiveSize
+                       XCfa_SetBayerPhase, XCfa_GetBayerPhase,
+                       StubCallBack, StubErrCallBack.
+ 
+

+#include "xcfa.h"
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

int XCfa_CfgInitialize (XCfa *InstancePtr, XCfa_Config *CfgPtr, u32 EffectiveAddr)
void XCfa_Setup (XCfa *InstancePtr)
void XCfa_EnableDbgByPass (XCfa *InstancePtr)
int XCfa_IsDbgByPassEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgBypass (XCfa *InstancePtr)
void XCfa_EnableDbgTestPattern (XCfa *InstancePtr)
int XCfa_IsDbgTestPatternEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgTestPattern (XCfa *InstancePtr)
u32 XCfa_GetVersion (XCfa *InstancePtr)
u32 XCfa_GetDbgFrameCount (XCfa *InstancePtr)
u32 XCfa_GetDbgLineCount (XCfa *InstancePtr)
u32 XCfa_GetDbgPixelCount (XCfa *InstancePtr)
void XCfa_SetActiveSize (XCfa *InstancePtr, u16 HSize, u16 VSize)
void XCfa_GetActiveSize (XCfa *InstancePtr, u16 *HSize, u16 *VSize)
void XCfa_SetBayerPhase (XCfa *InstancePtr, enum BayerPhaseCombination BayerPhase)
u32 XCfa_GetBayerPhase (XCfa *InstancePtr)
+


Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int XCfa_CfgInitialize (XCfa InstancePtr,
XCfa_Config CfgPtr,
u32  EffectiveAddr 
)
+
+
+ +

+This function initializes the CFA core. This function must be called prior to using the CFA core. Initialization of the CFA includes setting up the instance data and ensuring the hardware is in a quiescent state.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
CfgPtr is a reference to a configuration structure containing information about the CFA core.
EffectiveAddr is the base address of the core. If address translation is being used then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
+
+
Returns:
    +
  • XST_SUCCESS if initialization was successful.
+
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_DisableDbgBypass (XCfa InstancePtr  ) 
+
+
+ +

+This function disables bypass mode of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_DisableDbgTestPattern (XCfa InstancePtr  ) 
+
+
+ +

+This function disables the test pattern mode of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_EnableDbgByPass (XCfa InstancePtr  ) 
+
+
+ +

+This sets the bypass bit of the control register to switch the core to bypass mode if debug is enabled in the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_EnableDbgTestPattern (XCfa InstancePtr  ) 
+
+
+ +

+This function sets the test-pattern mode of the CFA core if debug features is enabled.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void XCfa_GetActiveSize (XCfa InstancePtr,
u16 *  HSize,
u16 *  VSize 
)
+
+
+ +

+This function gets the number of Active Pixel per Scan line and number of Active Lines per Frame from the Active Frame Size register.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
HSize is a pointer to 16-bit variable in which the number of Active Pixels per Scan Line is returned. (Range is 32 to 7680).
VSize is a pointer to 16-bit variable in which the number of Active Lines per Frame is returned. (Range is 32 to 7680).
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetBayerPhase (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the Bayer phase value combination from Bayer phase register.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
BayerPhase the Bayer Phase value 0 to 3. The Phase value combinations are
    +
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
+
+
Note:
- It is a double buffered register.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgFrameCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets number of frames processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
FrameCount is the number of frames processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgLineCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the number of lines processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
LineCount is the number of lines processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgPixelCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the number of pixels processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
PixelCount is the number of pixels processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetVersion (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the Version of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Returns the contents of the Version register.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
int XCfa_IsDbgByPassEnabled (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the current status of the bypass setting of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Core debug bypass mode.
    +
  • TRUE = Bypass mode is enabled.
  • FALSE = Bypass mode is not enabled.
+
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
int XCfa_IsDbgTestPatternEnabled (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the test-pattern mode if debug feature is enabled.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Test-pattern generator mode.
    +
  • TRUE = Test-pattern mode is enabled.
  • FALSE = Test-pattern mode is not enabled.
+
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void XCfa_SetActiveSize (XCfa InstancePtr,
u16  HSize,
u16  VSize 
)
+
+
+ +

+This function sets the active H/V sizes in the Active Size register.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
HSize is number of Active Pixels per scan line to be set. Range of HSize is 32 to 7680.
VSize is number of Active Lines per frame to be set. Range of VSize is 32 to 7680.
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void XCfa_SetBayerPhase (XCfa InstancePtr,
enum BayerPhaseCombination  BayerPhase 
)
+
+
+ +

+This function specify whether the starting position pixel(0,0) of the Bayer sampling grid is on a red-green or blue-green line and whether the first pixel is green or not.

+

Parameters:
+ + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
BayerPhase to be set to identify starting position. Range of Phase is 0 to 3. The Phase value combinations are
    +
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
  • It is a double buffered register.
+
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_Setup (XCfa InstancePtr  ) 
+
+
+ +

+This function sets the input/output frame size in Active Size register and enables the register update.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
None.
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8h.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8h.html new file mode 100644 index 00000000..53a20e93 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa_8h.html @@ -0,0 +1,1362 @@ + + + + + xcfa.h File Reference + + + +

+Software Drivers +
+ + + +

xcfa.h File Reference

+

+#include "xcfa_hw.h"
+#include "xil_assert.h"
+#include "xstatus.h"
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Classes

struct  XCfa_Config
struct  XCfa

Active size range macros

#define XCFA_VSIZE_FIRST   32
#define XCFA_VSIZE_LAST   7680
#define XCFA_HSIZE_FIRST   32
#define XCFA_HSIZE_LAST   7680

Handler Types

enum  { XCFA_HANDLER_PROCSTART = 1, +XCFA_HANDLER_FRAMEDONE, +XCFA_HANDLER_ERROR + }

Bayer phase

enum  BayerPhaseCombination { XCFA_RGRG_COMBINATION, +XCFA_GRGR_COMBINATION, +XCFA_GBGB_COMBINATION, +XCFA_BGBG_COMBINATION + }

Defines

#define XCFA_H_
#define XCfa_Enable(InstancePtr)
#define XCfa_Disable(InstancePtr)
#define XCfa_Start   XCfa_Enable
#define XCfa_Stop   XCfa_Disable
#define XCfa_RegUpdateEnable(InstancePtr)
#define XCfa_RegUpdateDisable(InstancePtr)
#define XCfa_SyncReset(InstancePtr)
#define XCfa_Reset(InstancePtr)
#define XCfa_StatusGetPending(InstancePtr)
#define XCfa_IntrClear(InstancePtr, IntrType)
#define XCfa_IntrEnable(InstancePtr, IntrType)
#define XCfa_IntrDisable(InstancePtr, IntrType)
#define XCfa_IntrGetPending(InstancePtr)

Typedefs

typedef void(*) XCfa_CallBack (void *CallBackRef)
typedef void(*) XCfa_ErrorCallBack (void *CallBackRef, u32 ErrorMask)

Functions

XCfa_ConfigXCfa_LookupConfig (u16 DeviceId)
int XCfa_CfgInitialize (XCfa *InstancePtr, XCfa_Config *CfgPtr, u32 EffectiveAddr)
void XCfa_Setup (XCfa *InstancePtr)
void XCfa_EnableDbgByPass (XCfa *InstancePtr)
int XCfa_IsDbgByPassEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgBypass (XCfa *InstancePtr)
void XCfa_EnableDbgTestPattern (XCfa *InstancePtr)
int XCfa_IsDbgTestPatternEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgTestPattern (XCfa *InstancePtr)
u32 XCfa_GetVersion (XCfa *InstancePtr)
u32 XCfa_GetDbgFrameCount (XCfa *InstancePtr)
u32 XCfa_GetDbgLineCount (XCfa *InstancePtr)
u32 XCfa_GetDbgPixelCount (XCfa *InstancePtr)
void XCfa_SetActiveSize (XCfa *InstancePtr, u16 HSize, u16 VSize)
void XCfa_GetActiveSize (XCfa *InstancePtr, u16 *HSize, u16 *VSize)
void XCfa_SetBayerPhase (XCfa *InstancePtr, enum BayerPhaseCombination BayerPhase)
u32 XCfa_GetBayerPhase (XCfa *InstancePtr)
int XCfa_SelfTest (XCfa *InstancePtr)
void XCfa_IntrHandler (void *InstancePtr)
int XCfa_SetCallBack (XCfa *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)
+


Define Documentation

+ +
+
+ + + + + + + + + +
#define XCfa_Disable (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                (XCFA_CONTROL_OFFSET), \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_CONTROL_OFFSET))) & (~(XCFA_CTL_SW_EN_MASK))))
+
This function macro disables the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_Disable(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_Enable (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                (XCFA_CONTROL_OFFSET), \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_SW_EN_MASK)))
+
This function macro enables the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_Enable(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + +
#define XCFA_H_
+
+
+ +

+Prevent circular inclusions by using protection macros +

+

+ +

+
+ + + + +
#define XCFA_HSIZE_FIRST   32
+
+
+ +

+Horizontal Size starting value +

+

+ +

+
+ + + + +
#define XCFA_HSIZE_LAST   7680
+
+
+ +

+Horizontal Size ending value +

+

+ +

+
+ + + + + + + + + + + + +
#define XCfa_IntrClear (InstancePtr,
IntrType   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_STATUS_OFFSET), ((IntrType) & \
+                                ((u32)(XCFA_IXR_ALLINTR_MASK))))
+
This function macro clears/acknowledges pending interrupts of the CFA core. in the Status register. Bit positions of 1 will be cleared.

+

Parameters:
+ + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
IntrType is the pending interrupts to clear/acknowledge. Use OR'ing of XCFA_IXR_*_MASK constants defined in xcfa_hw.h to create this parameter value.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_IntrClear(XCfa *InstancePtr, u32 IntrType)
+ +
+

+ +

+
+ + + + + + + + + + + + +
#define XCfa_IntrDisable (InstancePtr,
IntrType   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                        (XCFA_IRQ_EN_OFFSET), \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_IRQ_EN_OFFSET))) & ((~(IntrType)) & \
+                                (XCFA_IXR_ALLINTR_MASK))))
+
This function macro disables the given individual interrupt(s) on the CFA core by updating Irq_Enable register.

+

Parameters:
+ + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
IntrType is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCFA_IXR_*_MASK bits defined in xcfa_hw.h.
+
+
Returns:
None.
+
Note:
Any other interrupt not covered by parameter IntrType, if enabled before this macro is called, will remain enabled. C-style signature: void XCfa_IntrDisable(XCfa *InstancePtr, u32 IntrType)
+ +
+

+ +

+
+ + + + + + + + + + + + +
#define XCfa_IntrEnable (InstancePtr,
IntrType   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                        (XCFA_IRQ_EN_OFFSET), \
+                (((IntrType) & (XCFA_IXR_ALLINTR_MASK)) | \
+                        (XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                                (XCFA_IRQ_EN_OFFSET)))))
+
This function macro enables the given individual interrupt(s) on the CFA core.

+

Parameters:
+ + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
IntrType is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCFA_IXR_*_MASK bits defined in xcfa_hw.h.
+
+
Returns:
None.
+
Note:
The existing enabled interrupt(s) will remain enabled. C-style signature: void XCfa_IntrEnable(XCfa *InstancePtr, u32 IntrType)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_IntrGetPending (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                                (XCFA_IRQ_EN_OFFSET)) & \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                (XCFA_STATUS_OFFSET))) & ((u32)(XCFA_IXR_ALLINTR_MASK)))
+
This function macro returns the pending interrupts of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
The pending interrupts of the CFA. Use XCFA_IXR_*_MASK constants defined in xcfa_hw.h to interpret this value. The returned value is a logical AND of the contents of the STATUS Register and the IRQ_ENABLE Register.
+
Note:
C-style signature: u32 XCfa_IntrGetPending(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_RegUpdateDisable (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                        (XCFA_CONTROL_OFFSET), \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_CONTROL_OFFSET)))) & (~(XCFA_CTL_RUE_MASK)))
+
This function macro prevents the CFA core from committing recent changes made so far by the software. When disabled, changes to other configuration registers are stored, but do not effect the behavior of the core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_RegUpdateDisable(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_RegUpdateEnable (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                                        (XCFA_CONTROL_OFFSET), \
+                ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                        (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_RUE_MASK)))
+
This function macro commits all the register value changes made so far by the software to the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_RegUpdateEnable(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_Reset (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                (XCFA_CONTROL_OFFSET), (XCFA_CTL_RESET_MASK))
+
This macro resets CFA core instance. This reset effects the core immediately and may cause image tearing.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_Reset(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + +
#define XCfa_Start   XCfa_Enable
+
+
+ +

+This function macro enables/starts the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_Start(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_StatusGetPending (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \
+                (XCFA_STATUS_OFFSET)) & (XCFA_IXR_ALLINTR_MASK)
+
This function macro returns the pending status of a CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
The pending interrupts of the CFA core. Use XCFA_IXR_*_MASK constants defined in xcfa_hw.h to interpret this value.
+
Note:
C-style signature: u32 XCfa_StatusGePending(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + +
#define XCfa_Stop   XCfa_Disable
+
+
+ +

+This function macro disables/stops the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_Stop(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + + + + + + +
#define XCfa_SyncReset (InstancePtr   ) 
+
+
+ +

+Value:

XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \
+                (XCFA_CONTROL_OFFSET), (XCFA_CTL_AUTORESET_MASK))
+
This function macro resets a CFA core at the end of the frame being processed. It enables core automatically synchronizes to the SOF of the core to prevent image tearing. This function macro is differ from XCfa_Reset().

+On the next rising-edge of SOF following a call to XCfa_SyncReset(), all of the core's configuration registers and outputs will be reset, then the reset flag will be immediately released, allowing the core to immediately resume default operation.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_SyncReset(XCfa *InstancePtr)
+ +
+

+ +

+
+ + + + +
#define XCFA_VSIZE_FIRST   32
+
+
+ +

+Vertical Size starting value +

+

+ +

+
+ + + + +
#define XCFA_VSIZE_LAST   7680
+
+
+ +

+Vertical Size ending value +

+

+


Typedef Documentation

+ +
+
+ + + + +
typedef void(*) XCfa_CallBack(void *CallBackRef)
+
+
+ +

+Callback type for all interrupts except error interrupt.

+

Parameters:
+ + +
CallBackRef is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
+
+ +
+

+ +

+
+ + + + +
typedef void(*) XCfa_ErrorCallBack(void *CallBackRef, u32 ErrorMask)
+
+
+ +

+Callback type for error interrupt.

+

Parameters:
+ + + +
CallBackRef is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
ErrorMask is a bit mask indicating the cause of the error. Its value equals 'OR'ing one or more XCFA_IXR_*_MASK values defined in xcfa_hw.h.
+
+ +
+

+


Enumeration Type Documentation

+ +
+
+ + + + +
anonymous enum
+
+
+ +

+These constants specify different types of handlers and used to differentiate interrupt requests from core.

Enumerator:
+ + + + +
XCFA_HANDLER_PROCSTART  +A processing start event interrupt type
XCFA_HANDLER_FRAMEDONE  +A frame done event interrupt type
XCFA_HANDLER_ERROR  +An error condition interrupt type
+
+ +
+

+ +

+
+ + + + +
enum BayerPhaseCombination
+
+
+ +

+These constants specify Bayer phase combinations of the core.

Enumerator:
+ + + + + +
XCFA_RGRG_COMBINATION  +Red green combination
XCFA_GRGR_COMBINATION  +Green red combination
XCFA_GBGB_COMBINATION  +Green blue combination
XCFA_BGBG_COMBINATION  +Blue green combination
+
+ +
+

+


Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int XCfa_CfgInitialize (XCfa InstancePtr,
XCfa_Config CfgPtr,
u32  EffectiveAddr 
)
+
+
+ +

+This function initializes the CFA core. This function must be called prior to using the CFA core. Initialization of the CFA includes setting up the instance data and ensuring the hardware is in a quiescent state.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
CfgPtr is a reference to a configuration structure containing information about the CFA core.
EffectiveAddr is the base address of the core. If address translation is being used then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
+
+
Returns:
    +
  • XST_SUCCESS if initialization was successful.
+
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_DisableDbgBypass (XCfa InstancePtr  ) 
+
+
+ +

+This function disables bypass mode of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_DisableDbgTestPattern (XCfa InstancePtr  ) 
+
+
+ +

+This function disables the test pattern mode of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_EnableDbgByPass (XCfa InstancePtr  ) 
+
+
+ +

+This sets the bypass bit of the control register to switch the core to bypass mode if debug is enabled in the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_EnableDbgTestPattern (XCfa InstancePtr  ) 
+
+
+ +

+This function sets the test-pattern mode of the CFA core if debug features is enabled.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void XCfa_GetActiveSize (XCfa InstancePtr,
u16 *  HSize,
u16 *  VSize 
)
+
+
+ +

+This function gets the number of Active Pixel per Scan line and number of Active Lines per Frame from the Active Frame Size register.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
HSize is a pointer to 16-bit variable in which the number of Active Pixels per Scan Line is returned. (Range is 32 to 7680).
VSize is a pointer to 16-bit variable in which the number of Active Lines per Frame is returned. (Range is 32 to 7680).
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetBayerPhase (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the Bayer phase value combination from Bayer phase register.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
BayerPhase the Bayer Phase value 0 to 3. The Phase value combinations are
    +
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
+
+
Note:
- It is a double buffered register.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgFrameCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets number of frames processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
FrameCount is the number of frames processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgLineCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the number of lines processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
LineCount is the number of lines processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetDbgPixelCount (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the number of pixels processed since power-up or last time the core is reset.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
PixelCount is the number of pixels processed since power up.
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
u32 XCfa_GetVersion (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the Version of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Returns the contents of the Version register.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
void XCfa_IntrHandler (void *  InstancePtr  ) 
+
+
+ +

+This function is the interrupt handler for the CFA core.

+This handler reads the pending interrupt from the STATUS register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in IRQ_ENABLE register, and finally clears the interrupts.

+The application is responsible for connecting this function to the interrupt system. Application beyond this core is also responsible for providing callbacks to handle interrupts and installing the callbacks using XCfa_SetCallBack() during initialization phase.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance that just interrupted.
+
+
Returns:
None.
+
Note:
Interrupt interface should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
int XCfa_IsDbgByPassEnabled (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the current status of the bypass setting of the CFA core.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Core debug bypass mode.
    +
  • TRUE = Bypass mode is enabled.
  • FALSE = Bypass mode is not enabled.
+
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
int XCfa_IsDbgTestPatternEnabled (XCfa InstancePtr  ) 
+
+
+ +

+This function gets the test-pattern mode if debug feature is enabled.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
Test-pattern generator mode.
    +
  • TRUE = Test-pattern mode is enabled.
  • FALSE = Test-pattern mode is not enabled.
+
+
Note:
Debug functionality should be enabled.
+ +
+

+ +

+
+ + + + + + + + + +
XCfa_Config* XCfa_LookupConfig (u16  DeviceId  ) 
+
+
+ +

+This function returns a reference to an XCfa_Config structure based on the unique device id, DeviceId. The return value will refer to an entry in the device configuration table defined in the xcfa_g.c file.

+

Parameters:
+ + +
DeviceId is the unique device ID of the core for the lookup operation.
+
+
Returns:
CfgPtr is a reference to a config record in the configuration table (in xcfa_g.c) corresponding to DeviceId, or NULL if no match is found.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + +
int XCfa_SelfTest (XCfa InstancePtr  ) 
+
+
+ +

+This function reads complete Version register of CFA core and compares with zero values as part of self test.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
    +
  • XST_SUCCESS if the Version register read test was successful.
  • XST_FAILURE if the Version register read test failed.
+
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void XCfa_SetActiveSize (XCfa InstancePtr,
u16  HSize,
u16  VSize 
)
+
+
+ +

+This function sets the active H/V sizes in the Active Size register.

+

Parameters:
+ + + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
HSize is number of Active Pixels per scan line to be set. Range of HSize is 32 to 7680.
VSize is number of Active Lines per frame to be set. Range of VSize is 32 to 7680.
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
void XCfa_SetBayerPhase (XCfa InstancePtr,
enum BayerPhaseCombination  BayerPhase 
)
+
+
+ +

+This function specify whether the starting position pixel(0,0) of the Bayer sampling grid is on a red-green or blue-green line and whether the first pixel is green or not.

+

Parameters:
+ + + +
InstancePtr is a pointer to the XCfa instance to be worked on.
BayerPhase to be set to identify starting position. Range of Phase is 0 to 3. The Phase value combinations are
    +
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
  • It is a double buffered register.
+
+
+
Returns:
None.
+
Note:
None.
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int XCfa_SetCallBack (XCfa InstancePtr,
u32  HandlerType,
void *  CallBackFunc,
void *  CallBackRef 
)
+
+
+ +

+ +

+

+ +

+
+ + + + + + + + + +
void XCfa_Setup (XCfa InstancePtr  ) 
+
+
+ +

+This function sets the input/output frame size in Active Size register and enables the register update.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
None.
+
Note:
None.
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__g_8c.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__g_8c.html new file mode 100644 index 00000000..4df437c1 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__g_8c.html @@ -0,0 +1,77 @@ + + + + + xcfa_g.c File Reference + + + +

+Software Drivers +
+ + + +

xcfa_g.c File Reference

+

+#include "xparameters.h"
+#include "xcfa.h"
+ + + + + +

Variables

XCfa_Config XCfa_ConfigTable []
+


Variable Documentation

+ +
+ +
+ +

+Initial value:

+{
+        {
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_DEVICE_ID,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_BASEADDR,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_DATA_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_DATA_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_TDATA_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_TDATA_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_FORMAT,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_FORMAT,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_TUSER_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_TUSER_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_ADDR_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_DATA_WIDTH,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_CLK_FREQ_HZ,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_BAYER_PHASE,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_ACTIVE_ROWS,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_ACTIVE_COLS,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_MAX_COLS,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_INTC_IF,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_AXI4_LITE,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_DEBUG,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_HOR_FILT,
+                XPAR_FMC_SENSOR_INPUT_V_CFA_1_FRINGE_TOL
+        }
+}
+
+
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__hw_8h.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__hw_8h.html new file mode 100644 index 00000000..4f4e6131 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__hw_8h.html @@ -0,0 +1,1178 @@ + + + + + xcfa_hw.h File Reference + + + +

+Software Drivers +
+ + + +

xcfa_hw.h File Reference


Detailed Description

+This header file contains identifiers and register-level driver functions (or macros) that can be used to access the Xilinx Color Filter Array Interpolation (CFA) core.

+

+ MODIFICATION HISTORY:

+

 Ver   Who    Date     Changes
+ ----- ------ -------- -------------------------------------------------------
+ 7.0   adk    01/07/14 First release.
+                       Added the register offsets and bit masks for the
+                       registers and added backward compatibility for macros.
+ 
+

+#include "xil_io.h"
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

General control registers offsets

#define XCFA_CONTROL_OFFSET   0x000
#define XCFA_STATUS_OFFSET   0x004
#define XCFA_ERROR_OFFSET   0x008
#define XCFA_IRQ_EN_OFFSET   0x00C
#define XCFA_VERSION_OFFSET   0x010
#define XCFA_SYSDEBUG0_OFFSET   0x014
#define XCFA_SYSDEBUG1_OFFSET   0x018
#define XCFA_SYSDEBUG2_OFFSET   0x01C
#define XCFA_ACTIVE_SIZE_OFFSET   0x020
#define XCFA_BAYER_PHASE_OFFSET   0x100

Control register bit mask definition

#define XCFA_CTL_SW_EN_MASK   0x00000001
#define XCFA_CTL_RUE_MASK   0x00000002
#define XCFA_CTL_BPE_MASK   0x00000010
#define XCFA_CTL_TPE_MASK   0x00000020
#define XCFA_CTL_AUTORESET_MASK   0x40000000
#define XCFA_CTL_RESET_MASK   0x80000000

Interrupt Register Bit Masks. It is applicable for

Status and Irq_Enable Registers

#define XCFA_IXR_PROCS_STARTED_MASK   0x00000001
#define XCFA_IXR_EOF_MASK   0x00000002
#define XCFA_IXR_SE_MASK   0x00010000
#define XCFA_IXR_ALLINTR_MASK   0x00010003

Error Register bit mask definitions

#define XCFA_ERR_EOL_EARLY_MASK   0x00000001
#define XCFA_ERR_EOL_LATE_MASK   0x00000002
#define XCFA_ERR_SOF_EARLY_MASK   0x00000004
#define XCFA_ERR_SOF_LATE_MASK   0x00000008

Version register bit definition and shifts

#define XCFA_VER_REV_NUM_MASK   0x000000FF
#define XCFA_VER_PID_MASK   0x00000F00
#define XCFA_VER_MINOR_MASK   0x00FF0000
#define XCFA_VER_MAJOR_MASK   0xFF000000
#define XCFA_VER_REV_MASK   0x0000F000
#define XCFA_VER_MAJOR_SHIFT   24
#define XCFA_VER_MINOR_SHIFT   16
#define XCFA_VER_INTERNAL_SHIFT   8
#define XCFA_VER_REV_SHIFT   12

Active size register bit mask definition and shifts

#define XCFA_ACTSIZE_NUM_PIXEL_MASK   0x00001FFF
#define XCFA_ACTSIZE_NUM_LINE_MASK   0x1FFF0000
#define XCFA_ACTSIZE_NUM_LINE_SHIFT   16

Bayer Phase

#define XCFA_BAYER_PHASE_MASK   0x00000003

General purpose masks

#define XCFA_8_BIT_MASK   0x0FF

Backward compatibility macros

#define CFA_CONTROL   XCFA_CONTROL_OFFSET
#define CFA_STATUS   XCFA_STATUS_OFFSET
#define CFA_ERROR   XCFA_ERROR_OFFSET
#define CFA_IRQ_EN   XCFA_IRQ_EN_OFFSET
#define CFA_VERSION   XCFA_VERSION_OFFSET
#define CFA_SYSDEBUG0   XCFA_SYSDEBUG0_OFFSET
#define CFA_SYSDEBUG1   XCFA_SYSDEBUG1_OFFSET
#define CFA_SYSDEBUG2   XCFA_SYSDEBUG2_OFFSET
#define CFA_ACTIVE_SIZE   XCFA_ACTIVE_SIZE_OFFSET
#define CFA_BAYER_PHASE   XCFA_BAYER_PHASE_OFFSET
#define CFA_CTL_EN_MASK   XCFA_CTL_SW_EN_MASK
#define CFA_CTL_RUE_MASK   XCFA_CTL_RUE_MASK
#define CFA_CTL_CS_MASK   XCFA_CTL_CS_MASK
#define CFA_RST_RESET   XCFA_CTL_RESET_MASK
#define CFA_RST_AUTORESET   XCFA_CTL_AUTORESET_MASK
#define CFA_In32   XCfa_In32
#define CFA_Out32   XCfa_Out32
#define CFA_ReadReg   XCfa_ReadReg
#define CFA_WriteReg   XCfa_WriteReg

Interrupt Enable and Status Registers Offsets

#define XCFA_ISR_OFFSET   XCFA_STATUS_OFFSET
#define XCFA_IER_OFFSET   XCFA_IRQ_EN_OFFSET

Defines

#define XCFA_HW_H_
#define XCfa_In32   Xil_In32
#define XCfa_Out32   Xil_Out32
#define XCfa_ReadReg(BaseAddress, RegOffset)   XCfa_In32((BaseAddress) + (u32)(RegOffset))
#define XCfa_WriteReg(BaseAddress, RegOffset, Data)   XCfa_Out32((BaseAddress) + (u32)(RegOffset), (Data))
+


Define Documentation

+ +
+
+ + + + +
#define CFA_ACTIVE_SIZE   XCFA_ACTIVE_SIZE_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_BAYER_PHASE   XCFA_BAYER_PHASE_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_CONTROL   XCFA_CONTROL_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_CTL_CS_MASK   XCFA_CTL_CS_MASK
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_CTL_EN_MASK   XCFA_CTL_SW_EN_MASK
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_CTL_RUE_MASK   XCFA_CTL_RUE_MASK
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_ERROR   XCFA_ERROR_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_In32   XCfa_In32
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_IRQ_EN   XCFA_IRQ_EN_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_Out32   XCfa_Out32
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_ReadReg   XCfa_ReadReg
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_RST_AUTORESET   XCFA_CTL_AUTORESET_MASK
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_RST_RESET   XCFA_CTL_RESET_MASK
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_STATUS   XCFA_STATUS_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_SYSDEBUG0   XCFA_SYSDEBUG0_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_SYSDEBUG1   XCFA_SYSDEBUG1_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_SYSDEBUG2   XCFA_SYSDEBUG2_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_VERSION   XCFA_VERSION_OFFSET
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define CFA_WriteReg   XCfa_WriteReg
+
+
+ +

+ +

+

+ +

+
+ + + + +
#define XCFA_8_BIT_MASK   0x0FF
+
+
+ +

+Generic 8 bit Mask +

+

+ +

+
+ + + + +
#define XCFA_ACTIVE_SIZE_OFFSET   0x020
+
+
+ +

+Active Size (V x H) +

+

+ +

+
+ + + + +
#define XCFA_ACTSIZE_NUM_LINE_MASK   0x1FFF0000
+
+
+ +

+Number of Active lines per Frame (Vertical) +

+

+ +

+
+ + + + +
#define XCFA_ACTSIZE_NUM_LINE_SHIFT   16
+
+
+ +

+Active size Shift +

+

+ +

+
+ + + + +
#define XCFA_ACTSIZE_NUM_PIXEL_MASK   0x00001FFF
+
+
+ +

+Active size Mask +

+

+ +

+
+ + + + +
#define XCFA_BAYER_PHASE_MASK   0x00000003
+
+
+ +

+Bayer Phase Mask +

+

+ +

+
+ + + + +
#define XCFA_BAYER_PHASE_OFFSET   0x100
+
+
+ +

+Bayer_phase RW user register +

+

+ +

+
+ + + + +
#define XCFA_CONTROL_OFFSET   0x000
+
+
+ +

+Control +

+

+ +

+
+ + + + +
#define XCFA_CTL_AUTORESET_MASK   0x40000000
+
+
+ +

+Software Reset - Auto-synchronize to SOF Mask +

+

+ +

+
+ + + + +
#define XCFA_CTL_BPE_MASK   0x00000010
+
+
+ +

+Bypass Mask +

+

+ +

+
+ + + + +
#define XCFA_CTL_RESET_MASK   0x80000000
+
+
+ +

+Software Reset - Instantaneous Mask +

+

+ +

+
+ + + + +
#define XCFA_CTL_RUE_MASK   0x00000002
+
+
+ +

+Register Update Mask +

+

+ +

+
+ + + + +
#define XCFA_CTL_SW_EN_MASK   0x00000001
+
+
+ +

+Enable Mask +

+

+ +

+
+ + + + +
#define XCFA_CTL_TPE_MASK   0x00000020
+
+
+ +

+Test pattern Mask +

+

+ +

+
+ + + + +
#define XCFA_ERR_EOL_EARLY_MASK   0x00000001
+
+
+ +

+Error: End of line Early Mask +

+

+ +

+
+ + + + +
#define XCFA_ERR_EOL_LATE_MASK   0x00000002
+
+
+ +

+Error: End of line Late Mask +

+

+ +

+
+ + + + +
#define XCFA_ERR_SOF_EARLY_MASK   0x00000004
+
+
+ +

+Error: Start of frame Early Mask +

+

+ +

+
+ + + + +
#define XCFA_ERR_SOF_LATE_MASK   0x00000008
+
+
+ +

+Error: Start of frame Late Mask +

+

+ +

+
+ + + + +
#define XCFA_ERROR_OFFSET   0x008
+
+
+ +

+Error +

+

+ +

+
+ + + + +
#define XCFA_HW_H_
+
+
+ +

+Prevent circular inclusions by using protection macros +

+

+ +

+
+ + + + +
#define XCFA_IER_OFFSET   XCFA_IRQ_EN_OFFSET
+
+
+ +

+Interrupt Enable Offset +

+

+ +

+
+ + + + +
#define XCfa_In32   Xil_In32
+
+
+ +

+Cfa Input Operation. +

+

+ +

+
+ + + + +
#define XCFA_IRQ_EN_OFFSET   0x00C
+
+
+ +

+IRQ Enable +

+

+ +

+
+ + + + +
#define XCFA_ISR_OFFSET   XCFA_STATUS_OFFSET
+
+
+ +

+Interrupt status register generates a interrupt if the corresponding bits of interrupt enable register bits are set. Interrupt Status Offset +

+

+ +

+
+ + + + +
#define XCFA_IXR_ALLINTR_MASK   0x00010003
+
+
+ +

+Interrupt All Error Mask (ORing of all Interrupt Mask) +

+

+ +

+
+ + + + +
#define XCFA_IXR_EOF_MASK   0x00000002
+
+
+ +

+End-Of-Frame Mask +

+

+ +

+
+ + + + +
#define XCFA_IXR_PROCS_STARTED_MASK   0x00000001
+
+
+ +

+Process Started Mask +

+

+ +

+
+ + + + +
#define XCFA_IXR_SE_MASK   0x00010000
+
+
+ +

+Slave Error Mask +

+

+ +

+
+ + + + +
#define XCfa_Out32   Xil_Out32
+
+
+ +

+Cfa Output Operation. +

+

+ +

+
+ + + + + + + + + + + + +
#define XCfa_ReadReg (BaseAddress,
RegOffset   )    XCfa_In32((BaseAddress) + (u32)(RegOffset))
+
+
+ +

+This function macro reads the given register.

+

Parameters:
+ + + +
BaseAddress is the base address of the CFA core.
RegOffset is the register offset of the core (defined at top of this file).
+
+
Returns:
The 32-bit value of the register.
+
Note:
C-style signature: u32 XCfa_ReadReg(u32 BaseAddress, u32 RegOffset)
+ +
+

+ +

+
+ + + + +
#define XCFA_STATUS_OFFSET   0x004
+
+
+ +

+Status +

+

+ +

+
+ + + + +
#define XCFA_SYSDEBUG0_OFFSET   0x014
+
+
+ +

+System Debug 0 +

+

+ +

+
+ + + + +
#define XCFA_SYSDEBUG1_OFFSET   0x018
+
+
+ +

+System Debug 1 +

+

+ +

+
+ + + + +
#define XCFA_SYSDEBUG2_OFFSET   0x01C
+
+
+ +

+System Debug 2 +

+

+ +

+
+ + + + +
#define XCFA_VER_INTERNAL_SHIFT   8
+
+
+ +

+Version Internal Shift +

+

+ +

+
+ + + + +
#define XCFA_VER_MAJOR_MASK   0xFF000000
+
+
+ +

+Version Major Mask +

+

+ +

+
+ + + + +
#define XCFA_VER_MAJOR_SHIFT   24
+
+
+ +

+Version Major Shift +

+

+ +

+
+ + + + +
#define XCFA_VER_MINOR_MASK   0x00FF0000
+
+
+ +

+Version Minor Mask +

+

+ +

+
+ + + + +
#define XCFA_VER_MINOR_SHIFT   16
+
+
+ +

+Version Minor Shift +

+

+ +

+
+ + + + +
#define XCFA_VER_PID_MASK   0x00000F00
+
+
+ +

+Patch ID Mask +

+

+ +

+
+ + + + +
#define XCFA_VER_REV_MASK   0x0000F000
+
+
+ +

+Version revision Mask +

+

+ +

+
+ + + + +
#define XCFA_VER_REV_NUM_MASK   0x000000FF
+
+
+ +

+Revision Number Mask +

+

+ +

+
+ + + + +
#define XCFA_VER_REV_SHIFT   12
+
+
+ +

+Version Revision Shift +

+

+ +

+
+ + + + +
#define XCFA_VERSION_OFFSET   0x010
+
+
+ +

+Version +

+

+ +

+
+ + + + + + + + + + + + + + + +
#define XCfa_WriteReg (BaseAddress,
RegOffset,
Data   )    XCfa_Out32((BaseAddress) + (u32)(RegOffset), (Data))
+
+
+ +

+This function macro writes the given register.

+

Parameters:
+ + + + +
BaseAddress is the base address of the CFA core.
RegOffset is the register offset of the core (defined at top of this file).
Data is the 32-bit value to write into the register.
+
+
Returns:
None.
+
Note:
C-style signature: void XCfa_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__intr_8c.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__intr_8c.html new file mode 100644 index 00000000..e26b4750 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__intr_8c.html @@ -0,0 +1,73 @@ + + + + + xcfa_intr.c File Reference + + + +

+Software Drivers +
+ + + +

xcfa_intr.c File Reference


Detailed Description

+This file contains interrupt related functions of the CFA core. Please see xcfa.h for more details of the core.

+

+ MODIFICATION HISTORY:

+

 Ver   Who    Date     Changes
+ ----- ------ -------- --------------------------------------------------
+ 7.0   adk    01/07/14 First release.
+                       Implemented the following functions:
+                       XCfa_IntrHandler, XCfa_SetCallBack.
+ 
+

+#include "xcfa.h"
+ + + + + +

Functions

void XCfa_IntrHandler (void *InstancePtr)
+


Function Documentation

+ +
+
+ + + + + + + + + +
void XCfa_IntrHandler (void *  InstancePtr  ) 
+
+
+ +

+This function is the interrupt handler for the CFA core.

+This handler reads the pending interrupt from the STATUS register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in IRQ_ENABLE register, and finally clears the interrupts.

+The application is responsible for connecting this function to the interrupt system. Application beyond this core is also responsible for providing callbacks to handle interrupts and installing the callbacks using XCfa_SetCallBack() during initialization phase.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance that just interrupted.
+
+
Returns:
None.
+
Note:
Interrupt interface should be enabled.
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__selftest_8c.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__selftest_8c.html new file mode 100644 index 00000000..1b1d0ef7 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__selftest_8c.html @@ -0,0 +1,73 @@ + + + + + xcfa_selftest.c File Reference + + + +

+Software Drivers +
+ + + +

xcfa_selftest.c File Reference


Detailed Description

+This file contains the self-test functions for the CFA core. The self test function reads the Version register.

+

+ MODIFICATION HISTORY:

+

 Ver   Who     Date     Changes
+ ----- ------- -------- ----------------------------------------------
+ 7.0   adk     01/07/14 First Release
+                        Implemented XCfa_SelfTest function.
+ 
+

+#include "xcfa.h"
+#include "xstatus.h"
+ + + + + +

Functions

int XCfa_SelfTest (XCfa *InstancePtr)
+


Function Documentation

+ +
+
+ + + + + + + + + +
int XCfa_SelfTest (XCfa InstancePtr  ) 
+
+
+ +

+This function reads complete Version register of CFA core and compares with zero values as part of self test.

+

Parameters:
+ + +
InstancePtr is a pointer to the XCfa instance to be worked on.
+
+
Returns:
    +
  • XST_SUCCESS if the Version register read test was successful.
  • XST_FAILURE if the Version register read test failed.
+
+
Note:
None.
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__sinit_8c.html b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__sinit_8c.html new file mode 100644 index 00000000..92a0395d --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/doc/html/api/xcfa__sinit_8c.html @@ -0,0 +1,71 @@ + + + + + xcfa_sinit.c File Reference + + + +

+Software Drivers +
+ + + +

xcfa_sinit.c File Reference


Detailed Description

+This file contains static initialization methods for Xilinx CFA core.

+

+ MODIFICATION HISTORY:

+

 Ver   Who    Date     Changes
+ ----- ------ -------- -----------------------------------------------
+ 7.0   adk    01/07/14 First release.
+                       Implemented XCfa_LookupConfig function.
+ 
+

+#include "xcfa.h"
+#include "xparameters.h"
+ + + + + +

Functions

XCfa_ConfigXCfa_LookupConfig (u16 DeviceId)
+


Function Documentation

+ +
+
+ + + + + + + + + +
XCfa_Config* XCfa_LookupConfig (u16  DeviceId  ) 
+
+
+ +

+This function returns a reference to an XCfa_Config structure based on the unique device id, DeviceId. The return value will refer to an entry in the device configuration table defined in the xcfa_g.c file.

+

Parameters:
+ + +
DeviceId is the unique device ID of the core for the lookup operation.
+
+
Returns:
CfgPtr is a reference to a config record in the configuration table (in xcfa_g.c) corresponding to DeviceId, or NULL if no match is found.
+
Note:
None.
+ +
+

+Copyright @ 1995-2014 Xilinx, Inc. All rights reserved. diff --git a/XilinxProcessorIPLib/drivers/cfa/examples/cfa_selftest_example.c b/XilinxProcessorIPLib/drivers/cfa/examples/cfa_selftest_example.c new file mode 100755 index 00000000..82c10659 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/examples/cfa_selftest_example.c @@ -0,0 +1,195 @@ +/****************************************************************************** +* +* (c) Copyright 2010-14 Xilinx, Inc. All rights reserved. +* +* This file contains confidential and proprietary information of Xilinx, Inc. +* and is protected under U.S. and international copyright and other +* intellectual property laws. +* +* DISCLAIMER +* This disclaimer is not a license and does not grant any rights to the +* materials distributed herewith. Except as otherwise provided in a valid +* license issued to you by Xilinx, and to the maximum extent permitted by +* applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL +* FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS, +* IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF +* MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE +* and (2) Xilinx shall not be liable (whether in contract or tort, including +* negligence, or under any other theory of liability) for any loss or damage +* of any kind or nature related to, arising under or in connection with these +* materials, including for any direct, or any indirect, special, incidental, +* or consequential loss or damage (including loss of data, profits, goodwill, +* or any type of loss or damage suffered as a result of any action brought by +* a third party) even if such damage or loss was reasonably foreseeable or +* Xilinx had been advised of the possibility of the same. +* +* CRITICAL APPLICATIONS +* Xilinx products are not designed or intended to be fail-safe, or for use in +* any application requiring fail-safe performance, such as life-support or +* safety devices or systems, Class III medical devices, nuclear facilities, +* applications related to the deployment of airbags, or any other applications +* that could lead to death, personal injury, or severe property or +* environmental damage (individually and collectively, "Critical +* Applications"). Customer assumes the sole risk and liability of any use of +* Xilinx products in Critical Applications, subject only to applicable laws +* and regulations governing limitations on product liability. +* +* THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE +* AT ALL TIMES. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file cfa_selftest_example.c +* +* This file contains an example using the XCfa driver to do self test +* on the device. +* +* @note +* +* None +* +* MODIFICATION HISTORY: +*

+* Ver	Who	Date	Changes
+* ----- ------ -------- -----------------------------------------------
+* 1.00a drg/jz	01/13/10 First Release
+* 1.03a sg 	08/14/12 Updated the example for CR 666306. Modified
+*			 the device ID to use the first Device Id
+*			 Removed the printf at the start of the main
+* 7.0	adk	01/15/14 Implimented main and XCfaSelfTestExample
+*			 functions.
+*			 Adherence to MISRA C 2012
+*			 standard guidelines.
+* 
+******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xcfa.h" +#include "xparameters.h" +#include "xil_printf.h" + +/************************** Constant Definitions *****************************/ + +/* + * The following constants map to the XPAR parameters created in the + * xparameters.h file. They are defined here such that a user can easily + * change all the needed parameters in one place. + */ +#define CFA_DEVICE_ID XPAR_CFA_0_DEVICE_ID /**< CFA Device ID */ + +/**************************** Type Definitions *******************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/************************** Function Prototypes ******************************/ + + +u32 XCfaSelfTestExample(u16 DeviceId); + +/************************** Variable Definitions *****************************/ + +XCfa Cfa; /**_DEVICE_ID value from +* xparameters.h. +* +* @return XST_SUCCESS if succesful, otherwise XST_FAILURE. +* +* @note None. +* +******************************************************************************/ +u32 XCfaSelfTestExample(u16 DeviceId) +{ + u32 Status; + XCfa_Config *Config; + u32 BeforeData = (u32)0x00; /**< Default value of the Control registers + * Status Register and Error Register */ + u32 AfterData; + + /* + * Initialize the CFA driver so that it's ready to use + * Look up the configuration in the config table, + * then initialize it. + */ + Config = XCfa_LookupConfig(DeviceId); + if (NULL == Config) { + return (u32)XST_FAILURE; + } + + Status = XCfa_CfgInitialize(&Cfa, Config, Config->BaseAddress); + if (Status != (u32)XST_SUCCESS) { + return (u32)XST_FAILURE; + } + + /* + * Perform a self-test to check hardware build. + */ + + Status = XCfa_SelfTest(&Cfa); + if (Status != (u32)XST_SUCCESS) { + return (u32)XST_FAILURE; + } + + /* + * Perform a self-test with Control register default values + */ + AfterData = XCfa_ReadReg(Config->BaseAddress, XCFA_CONTROL_OFFSET); + if(BeforeData != AfterData){ + return (u32)XST_FAILURE; + } + + /* + * Perform a self-test with Status register default values + */ + AfterData = XCfa_ReadReg(Config->BaseAddress, XCFA_STATUS_OFFSET); + if(BeforeData != AfterData){ + return (u32)XST_FAILURE; + } + + /* + * Perform a self-test with Error register default values + */ + + AfterData = XCfa_ReadReg(Config->BaseAddress, XCFA_ERROR_OFFSET); + if(BeforeData != AfterData){ + return (u32)XST_FAILURE; + } + return (u32)XST_SUCCESS; +} diff --git a/XilinxProcessorIPLib/drivers/cfa/examples/example.c b/XilinxProcessorIPLib/drivers/cfa/examples/example.c deleted file mode 100755 index b2c5da91..00000000 --- a/XilinxProcessorIPLib/drivers/cfa/examples/example.c +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** -* -* Copyright (C) 2001 - 2014 Xilinx, Inc. All rights reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* Use of the Software is limited solely to applications: -* (a) running on a Xilinx device, or -* (b) that interact with a Xilinx device through a bus or interconnect. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -* SOFTWARE. -* -* Except as contained in this notice, the name of the Xilinx shall not be used -* in advertising or otherwise to promote the sale, use or other dealings in -* this Software without prior written authorization from Xilinx. -* -******************************************************************************/ - /** - * - * @file example.c - * - * This file demonstrates how to use Xilinx Color Filter Array (CFA) - * Interpolation core pcore driver functions. - * - * - * *************************************************************************** - */ - -#include "cfa.h" -#include "xparameters.h" - -/***************************************************************************/ -// Color Filter Array Interpolation Register Reading Example -// This function provides an example of how to read the current configuration -// settings of the CFA core. -/***************************************************************************/ -void report_cfa_settings(u32 BaseAddress) { - - u32 status, reg_val; - unsigned char inchar=0; - - xil_printf("Color Filter Array Core Configuration:\r\n"); - xil_printf(" Enable Bit: %1d\r\n", CFA_ReadReg(BaseAddress, CFA_CONTROL) & CFA_CTL_EN_MASK); - xil_printf(" Register Update Bit: %1d\r\n", (CFA_ReadReg(BaseAddress, CFA_CONTROL) & CFA_CTL_RUE_MASK) >> 1); - xil_printf(" Reset Bit: %1d\r\n", CFA_ReadReg(BaseAddress, CFA_CONTROL) & CFA_RST_RESET); - status = CFA_ReadReg(BaseAddress, CFA_STATUS); - xil_printf(" CFA Status: %08x \r\n", status); - xil_printf(" Core Version: %1d.%1d\r\n", CFA_ReadReg(BaseAddress, CFA_VERSION)); - reg_val = CFA_ReadReg(BaseAddress, CFA_CONTROL ); - xil_printf("CFA_CONTROL : %8x\r\n", reg_val); - reg_val = CFA_ReadReg(BaseAddress, CFA_IRQ_EN ); - xil_printf("CFA_IRQ_EN : %8x\r\n", reg_val); - reg_val = CFA_ReadReg(BaseAddress, CFA_BAYER_PHASE ); - xil_printf("CFA_BAYER_PHASE : %8d\r\n", reg_val); - reg_val = (CFA_ReadReg(BaseAddress, CFA_ACTIVE_SIZE ) && 0x1FFF); - xil_printf("Active Rows : %8d\r\n", reg_val); - reg_val = (CFA_ReadReg(BaseAddress, CFA_ACTIVE_SIZE) >> 16); - xil_printf("Active Columns : %8d\r\n", reg_val); - xil_printf("Press Space to continue!\r\n", reg_val); - while (inchar != ' ') inchar = inbyte(); -} - -/*****************************************************************************/ -// -// This is the main function for the CFA example. -// -/*****************************************************************************/ -int main(void) -{ - // Print the current settings for the CFA core - report_cfa_settings(XPAR_CFA_0_BASEADDR); - - return 0; -} diff --git a/XilinxProcessorIPLib/drivers/cfa/src/cfa.h b/XilinxProcessorIPLib/drivers/cfa/src/cfa.h deleted file mode 100755 index 8efe1a49..00000000 --- a/XilinxProcessorIPLib/drivers/cfa/src/cfa.h +++ /dev/null @@ -1,317 +0,0 @@ -/****************************************************************************** -* -* Copyright (C) 2001 - 2014 Xilinx, Inc. All rights reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* Use of the Software is limited solely to applications: -* (a) running on a Xilinx device, or -* (b) that interact with a Xilinx device through a bus or interconnect. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -* SOFTWARE. -* -* Except as contained in this notice, the name of the Xilinx shall not be used -* in advertising or otherwise to promote the sale, use or other dealings in -* this Software without prior written authorization from Xilinx. -* -******************************************************************************/ - -/** -* -* @file cfa.h -* -* This header file contains identifiers and register-level driver functions (or -* macros) that can be used to access the Xilinx Color Filter Array Interpolation -* (CFA) core instance. -* -* MODIFICATION HISTORY: -* -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 5.00a se 12/01/11 Updated for CFA v5.0, replaced xio.h with xil_io.h -* 4.00a rc 09/11/11 Updated for CFA v4.0 -* 3.00a gz 10/22/10 Updated for CFA V3.0 -* 6.0 adk 19/12/13 Updated as per the New Tcl API's -* -******************************************************************************/ - -#ifndef CFA_DRIVER_H /* prevent circular inclusions */ -#define CFA_DRIVER_H /* by using protection macros */ - -#ifdef __cplusplus -extern "C" { -#endif - -/***************************** Include Files *********************************/ - -#include "xil_io.h" - -/************************** Constant Definitions *****************************/ - -/** - * Register Offsets - */ -/* General Control Registers */ -#define CFA_CONTROL 0x000 /**< Control (R/W) */ -#define CFA_STATUS 0x004 /**< Status (R/W) */ -#define CFA_ERROR 0x008 /**< Error (R/W) */ -#define CFA_IRQ_EN 0x00C /**< IRQ Enable */ -#define CFA_VERSION 0x010 /**< Version */ -#define CFA_SYSDEBUG0 0x014 /**< System Debug 0 */ -#define CFA_SYSDEBUG1 0x018 /**< System Debug 1 */ -#define CFA_SYSDEBUG2 0x01C /**< System Debug 2 */ -/* Timing Control Registers */ -#define CFA_ACTIVE_SIZE 0x020 /**< Active Size (V x H) */ -/* Core Specific Registers */ -#define CFA_BAYER_PHASE 0x100 /**< bayer_phase R/W user register */ - - -/** - * CFA Control Register bit definition - */ -#define CFA_CTL_EN_MASK 0x00000001 /**< CFA Enable */ -#define CFA_CTL_RUE_MASK 0x00000002 /**< CFA Register Update */ -#define CFA_CTL_CS_MASK 0x00000004 /**< CFA Register Clear Status */ - -/** - * CFA Reset Register bit definition - */ -#define CFA_RST_RESET 0x80000000 /**< Software Reset - Instantaneous */ -#define CFA_RST_AUTORESET 0x40000000 /**< Software Reset - Auto-synchronize to SOF */ - -/***************** Macros (Inline Functions) Definitions *********************/ -#define CFA_In32 Xil_In32 -#define CFA_Out32 Xil_Out32 - - -/** -* -* Read the given register. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* @param RegOffset is the register offset of the register (defined at top of this file) -* -* @return The 32-bit value of the register -* -* @note -* C-style signature: -* u32 CFA_ReadReg(u32 BaseAddress, u32 RegOffset) -* -******************************************************************************/ -#define CFA_ReadReg(BaseAddress, RegOffset) \ - CFA_In32((BaseAddress) + (RegOffset)) - -/*****************************************************************************/ -/** -* -* Write the given register. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* @param RegOffset is the register offset of the register (defined at top of this file) -* @param Data is the 32-bit value to write to the register -* -* @return None. -* -* @note -* C-style signature: -* void CFA_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data) -* -******************************************************************************/ -#define CFA_WriteReg(BaseAddress, RegOffset, Data) \ - CFA_Out32((BaseAddress) + (RegOffset), (Data)) - -/*****************************************************************************/ -/** -* -* This macro enables a CFA core instance. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_Enable(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_Enable(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, \ - CFA_ReadReg(BaseAddress, CFA_CONTROL) | \ - CFA_CTL_EN_MASK) - -/*****************************************************************************/ -/** -* -* This macro disables a CFA core instance. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_Disable(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_Disable(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, \ - CFA_ReadReg(BaseAddress, CFA_CONTROL) & \ - ~CFA_CTL_EN_MASK) - -/*****************************************************************************/ -/** -* -* This macro commits all the register value changes made so far by the software -* to the CFA core instance. The registers will be automatically updated -* on the next rising-edge of the VBlank_in signal on the core. -* It is up to the user to manually disable the register update after a sufficient -* amount if time. -* -* This function only works when the CFA core is enabled. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_RegUpdateEnable(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_RegUpdateEnable(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, \ - CFA_ReadReg(BaseAddress, CFA_CONTROL) | \ - CFA_CTL_RUE_MASK) - -/*****************************************************************************/ -/** -* -* This macro prevents the CFA core instance from committing recent changes made -* so far by the software. When disabled, changes to other configuration registers -* are stored, but do not effect the behavior of the core. -* -* This function only works when the CFA core is enabled. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_RegUpdateDisable(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_RegUpdateDisable(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, \ - CFA_ReadReg(BaseAddress, CFA_CONTROL) & \ - ~CFA_CTL_RUE_MASK) - -/*****************************************************************************/ - -/** -* -* This macro clears the status register of the CFA instance, by first asserting then -* deasserting the CLEAR_STATUS flag of CFA_CONTROL. -* This function only works when the CFA core is enabled. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_ClearStatus(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_ClearStatus(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, CFA_ReadReg(BaseAddress, CFA_CONTROL) | CFA_CTL_CS_MASK); \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, CFA_ReadReg(BaseAddress, CFA_CONTROL) & ~CFA_CTL_CS_MASK) - -/*****************************************************************************/ - - -/** -* -* This macro resets a CFA core instance. This reset effects the core immediately, -* and may cause image tearing. -* -* This reset resets the CFA's configuration registers, and holds the core's outputs -* in their reset state until CFA_ClearReset() is called. -* -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_Reset(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_Reset(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, CFA_RST_RESET) \ - -/*****************************************************************************/ -/** -* -* This macro clears the CFA's reset flag (which is set using CFA_Reset(), and -* returns it to normal operation. This ClearReset effects the core immediately, -* and may cause image tearing. -* -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_ClearReset(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_ClearReset(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, 0) \ - -/*****************************************************************************/ -/** -* -* This macro resets a CFA instance, but differs from CFA_Reset() in that it -* automatically synchronizes to the SOF of the core to prevent tearing. -* -* On the next rising-edge of SOF following a call to CFA_AutoSyncReset(), -* all of the core's configuration registers and outputs will be reset, then the -* reset flag will be immediately released, allowing the core to immediately resume -* default operation. -* -* @param BaseAddress is the Xilinx EDK base address of the CFA core (from xparameters.h) -* -* @return None. -* -* @note -* C-style signature: -* void CFA_FSyncReset(u32 BaseAddress); -* -******************************************************************************/ -#define CFA_FSyncReset(BaseAddress) \ - CFA_WriteReg(BaseAddress, CFA_CONTROL, CFA_RST_AUTORESET) \ - -/************************** Function Prototypes ******************************/ - -#ifdef __cplusplus -} -#endif - -#endif /* end of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa.c b/XilinxProcessorIPLib/drivers/cfa/src/xcfa.c new file mode 100755 index 00000000..bc109d32 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa.c @@ -0,0 +1,645 @@ +/****************************************************************************** +* +* (c) Copyright 2001-14 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa.c +* +* This file contains the implementation of the interface functions for CFA +* core. Refer to the header file xcfa.h for more detailed information. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- --------------------------------------------------
+* 1.00  drg/jz 01/13/10 First Release
+* 3.00a gz     10/22/10 Updated for CFA V3.0
+* 4.00a rc     09/11/11 Updated for CFA v4.0
+* 5.00a se     12/01/11 Updated for CFA v5.0
+* 7.0   adk    01/07/14 Changed the file name from
+*                       cfa.c to xcfa.c
+*                       Implemented the following functions:
+*                       XCfa_CfgInitialize, XCfa_Setup,
+*                       XCfa_GetVersion,
+*                       XCfa_EnableDbgByPass,
+*                       XCfa_IsDbgByPassEnabled,
+*                       XCfa_DisableDbgBypass,
+*                       XCfa_EnableDbgTestPattern,
+*                       XCfa_IsDbgTestPatternEnabled,
+*                       XCfa_DisableDbgTestPattern,
+*                       XCfa_GetDbgFrameCount
+*                       XCfa_GetDbgLineCount, XCfa_GetDbgPixelCount
+*                       XCfa_SetActiveSize, XCfa_GetActiveSize
+*                       XCfa_SetBayerPhase, XCfa_GetBayerPhase,
+*                       StubCallBack, StubErrCallBack.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xcfa.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + +static void StubCallBack (void *CallBackRef); +static void StubErrCallBack (void *CallBackRef, u32 ErrorMask); + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function initializes the CFA core. This function must be called +* prior to using the CFA core. Initialization of the CFA includes setting up +* the instance data and ensuring the hardware is in a quiescent state. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param CfgPtr is a reference to a configuration structure +* containing information about the CFA core. +* @param EffectiveAddr is the base address of the core. If address +* translation is being used then this parameter must +* reflect the virtual base address. Otherwise, the physical +* address should be used. +* +* @return +* - XST_SUCCESS if initialization was successful. +* +* @note None. +* +******************************************************************************/ +int XCfa_CfgInitialize(XCfa *InstancePtr, XCfa_Config *CfgPtr, + u32 EffectiveAddr) +{ + /* Verify arguments. */ + Xil_AssertNonvoid(CfgPtr != NULL); + Xil_AssertNonvoid(EffectiveAddr != ((u32)0x0)); + + /* Setup the instance. */ + (void)memset((void *)InstancePtr, 0, sizeof(XCfa)); + (void)memcpy((void *)&(InstancePtr->Config), (const void *)CfgPtr, + sizeof(XCfa_Config)); + InstancePtr->Config.BaseAddress = EffectiveAddr; + + /* + * Set all handlers to stub values, let user configure + * this data later. + */ + InstancePtr->ProcStartCallBack = + (XCfa_CallBack)((void *)StubCallBack); + InstancePtr->FrameDoneCallBack = + (XCfa_CallBack)((void *)StubCallBack); + InstancePtr->ErrCallBack = + (XCfa_ErrorCallBack)((void *)StubErrCallBack); + + /* + * Reset the hardware and set the flag to indicate the core is + * ready. + */ + XCfa_Reset(InstancePtr); + InstancePtr->IsReady = (u32)(XIL_COMPONENT_IS_READY); + + return (XST_SUCCESS); +} + +/*****************************************************************************/ +/** +* +* This function sets the input/output frame size in Active Size register and +* enables the register update. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XCfa_Setup(XCfa *InstancePtr) +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + + XCfa_RegUpdateDisable(InstancePtr); + + /* Write into active size register */ + Data = (((InstancePtr->VSize) << (XCFA_ACTSIZE_NUM_LINE_SHIFT)) & + (XCFA_ACTSIZE_NUM_LINE_MASK)) | ((InstancePtr->HSize) & + (XCFA_ACTSIZE_NUM_PIXEL_MASK)); + XCfa_WriteReg(InstancePtr->Config.BaseAddress, + (XCFA_ACTIVE_SIZE_OFFSET), Data); + XCfa_RegUpdateEnable(InstancePtr); +} + +/*****************************************************************************/ +/** +* +* This sets the bypass bit of the control register to switch the core to bypass +* mode if debug is enabled in the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XCfa_EnableDbgByPass(XCfa *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Write into control register to set debug bypass. */ + XCfa_WriteReg(InstancePtr->Config.BaseAddress, (XCFA_CONTROL_OFFSET), + ((XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) | + (XCFA_CTL_BPE_MASK))); +} + +/*****************************************************************************/ +/** +* +* This function gets the current status of the bypass setting of the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return Core debug bypass mode. +* - TRUE = Bypass mode is enabled. +* - FALSE = Bypass mode is not enabled. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +int XCfa_IsDbgByPassEnabled(XCfa *InstancePtr) +{ + u32 DbgByPass; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Read from control register to know debug bypass status. */ + DbgByPass = (XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) & (XCFA_CTL_BPE_MASK); + if (DbgByPass == (XCFA_CTL_BPE_MASK)) { + Status = (TRUE); + } + else { + Status = (FALSE); + } + + return Status; +} + +/*****************************************************************************/ +/** +* +* This function disables bypass mode of the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XCfa_DisableDbgBypass(XCfa *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Write into control register to disable debug bypass. */ + XCfa_WriteReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET), + ((XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) & (~(XCFA_CTL_BPE_MASK)))); +} + +/*****************************************************************************/ +/** +* +* This function sets the test-pattern mode of the CFA core if debug +* features is enabled. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XCfa_EnableDbgTestPattern(XCfa *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Write into control register to set test pattern. */ + XCfa_WriteReg(InstancePtr->Config.BaseAddress, (XCFA_CONTROL_OFFSET), + ((XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_TPE_MASK))); +} + +/*****************************************************************************/ +/** +* +* This function gets the test-pattern mode if debug feature is enabled. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return Test-pattern generator mode. +* - TRUE = Test-pattern mode is enabled. +* - FALSE = Test-pattern mode is not enabled. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +int XCfa_IsDbgTestPatternEnabled(XCfa *InstancePtr) +{ + u32 DbgTestPattern; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Read from control register to know debug test pattern status. */ + DbgTestPattern = (XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) & (XCFA_CTL_TPE_MASK); + if (DbgTestPattern == (XCFA_CTL_TPE_MASK)) { + Status = (TRUE); + } + else { + Status = (FALSE); + } + + return Status; +} + +/*****************************************************************************/ +/** +* +* This function disables the test pattern mode of the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +void XCfa_DisableDbgTestPattern(XCfa *InstancePtr) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Write into control register to disable debug bypass. */ + XCfa_WriteReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET), + ((XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_CONTROL_OFFSET))) & (~(XCFA_CTL_TPE_MASK)))); +} + +/*****************************************************************************/ +/** +* +* This function gets the Version of the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return Returns the contents of the Version register. +* +* @note None. +* +******************************************************************************/ +u32 XCfa_GetVersion(XCfa *InstancePtr) + +{ + u32 Data; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read version register of the CFA core */ + Data = XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_VERSION_OFFSET)); + + return Data; +} + +/*****************************************************************************/ +/** +* +* This function gets number of frames processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return FrameCount is the number of frames processed since power up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XCfa_GetDbgFrameCount(XCfa *InstancePtr) +{ + u32 FrameCount; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Reads Frame throughput monitor */ + FrameCount = XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_SYSDEBUG0_OFFSET)); + + return FrameCount; +} + +/*****************************************************************************/ +/** +* +* This function gets the number of lines processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return LineCount is the number of lines processed since power up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XCfa_GetDbgLineCount(XCfa *InstancePtr) +{ + u32 LineCount; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Line throughput monitor */ + LineCount = XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_SYSDEBUG1_OFFSET)); + + return LineCount; +} + +/*****************************************************************************/ +/** +* +* This function gets the number of pixels processed since power-up or last +* time the core is reset. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return PixelCount is the number of pixels processed since power up. +* +* @note Debug functionality should be enabled. +* +******************************************************************************/ +u32 XCfa_GetDbgPixelCount(XCfa *InstancePtr) +{ + u32 PixelCount; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->Config.HasDebug != (u16)0x0); + + /* Pixel throughput monitor */ + PixelCount = XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_SYSDEBUG2_OFFSET)); + + return PixelCount; +} + +/*****************************************************************************/ +/** +* +* This function sets the active H/V sizes in the Active Size register. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param HSize is number of Active Pixels per scan line to be set. +* Range of HSize is 32 to 7680. +* @param VSize is number of Active Lines per frame to be set. +* Range of VSize is 32 to 7680. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XCfa_SetActiveSize(XCfa *InstancePtr, u16 HSize, u16 VSize) +{ + u32 Size; + + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid((VSize >= (u16)(XCFA_VSIZE_FIRST)) && + (VSize <= (u16)(XCFA_VSIZE_LAST))); + Xil_AssertVoid((HSize >= (u16)(XCFA_HSIZE_FIRST)) && + (HSize <= (u16)(XCFA_HSIZE_LAST))); + + Size = (((u32)VSize) << ((u32)(XCFA_ACTSIZE_NUM_LINE_SHIFT))) | + (HSize); + XCfa_WriteReg(InstancePtr->Config.BaseAddress, + (XCFA_ACTIVE_SIZE_OFFSET), Size); +} + +/*****************************************************************************/ +/** +* +* This function gets the number of Active Pixel per Scan line +* and number of Active Lines per Frame from the Active Frame Size register. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param HSize is a pointer to 16-bit variable in which +* the number of Active Pixels per Scan Line is returned. +* (Range is 32 to 7680). +* @param VSize is a pointer to 16-bit variable in which +* the number of Active Lines per Frame is returned. +* (Range is 32 to 7680). +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XCfa_GetActiveSize(XCfa *InstancePtr, u16 *HSize, u16 *VSize) +{ + /* Verify arguments */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(HSize != NULL); + Xil_AssertVoid(VSize != NULL); + + /* Number of active lines per frame */ + *HSize = (u16)(XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_ACTIVE_SIZE_OFFSET)) & (XCFA_ACTSIZE_NUM_PIXEL_MASK)); + + /* Number of active pixels per scan line */ + *VSize = (u16)(XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_ACTIVE_SIZE_OFFSET)) & (XCFA_ACTSIZE_NUM_LINE_MASK)) >> + (XCFA_ACTSIZE_NUM_LINE_SHIFT); +} + +/*****************************************************************************/ +/** +* +* This function specify whether the starting position pixel(0,0) of the +* Bayer sampling grid is on a red-green or blue-green line and whether the +* first pixel is green or not. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param BayerPhase to be set to identify starting position. +* Range of Phase is 0 to 3. +* The Phase value combinations are +* - Bayer Phase 0 is XCFA_RGRG_COMBINATION. +* - Bayer Phase 1 is XCFA_GRGR_COMBINATION. +* - Bayer Phase 2 is XCFA_GBGB_COMBINATION. +* - Bayer Phase 3 is XCFA_BGBG_COMBINATION. +* - It is a double buffered register. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +void XCfa_SetBayerPhase(XCfa *InstancePtr, + enum BayerPhaseCombination BayerPhase) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(BayerPhase <= XCFA_BGBG_COMBINATION); + + XCfa_WriteReg(InstancePtr->Config.BaseAddress, + (XCFA_BAYER_PHASE_OFFSET), + ((u32)BayerPhase & XCFA_BAYER_PHASE_MASK)); +} + +/*****************************************************************************/ +/** +* +* This function gets the Bayer phase value combination from Bayer phase +* register. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return BayerPhase the Bayer Phase value 0 to 3. +* The Phase value combinations are +* - Bayer Phase 0 is XCFA_RGRG_COMBINATION. +* - Bayer Phase 1 is XCFA_GRGR_COMBINATION. +* - Bayer Phase 2 is XCFA_GBGB_COMBINATION. +* - Bayer Phase 3 is XCFA_BGBG_COMBINATION. +* +* @note - It is a double buffered register. +* +******************************************************************************/ +u32 XCfa_GetBayerPhase(XCfa *InstancePtr) +{ + u32 BayerPhase; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + BayerPhase = (XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_BAYER_PHASE_OFFSET))) & (XCFA_8_BIT_MASK); + + return BayerPhase; +} + +/*****************************************************************************/ +/** +* +* This routine is a stub for the asynchronous callbacks. The stub is here in +* case the upper layer forgot to set the handlers. On initialization, All +* handlers except error handler are set to this callback. It is considered as +* an error for this handler to be invoked. +* +* @param CallBackRef is a callback reference passed in by the upper +* layer when setting the callback functions, and passed back +* to the upper layer when the callback is invoked. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +static void StubCallBack(void *CallBackRef) +{ + Xil_AssertVoid(CallBackRef != NULL); + Xil_AssertVoidAlways(); +} + +/*****************************************************************************/ +/** +* +* This routine is a stub for the asynchronous error interrupt callback. The +* stub is here in case the upper layer forgot to set the handler. On +* initialization, Error interrupt handler is set to this callback. It is +* considered as an error for this handler to be invoked. +* +* @param CallBackRef is a callback reference passed in by the upper +* layer when setting the callback functions, and passed back +* to the upper layer when the callback is invoked. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XCFA_IXR_*_MASK values defined +* in xcfa_hw.h. +* +* @return None. +* +* @note None. +* +******************************************************************************/ +static void StubErrCallBack(void *CallBackRef, u32 ErrorMask) +{ + /* Verify arguments. */ + Xil_AssertVoid(CallBackRef != NULL); + Xil_AssertVoid(ErrorMask != ((u32)0x0)); + Xil_AssertVoidAlways(); +} diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa.h b/XilinxProcessorIPLib/drivers/cfa/src/xcfa.h new file mode 100755 index 00000000..679c3644 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa.h @@ -0,0 +1,601 @@ +/****************************************************************************** +* +* (c) Copyright 2001-14 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa.h +* +* This header file contains identifiers and register-level core functions (or +* macros), range macros, structure typedefs that can be used to access the +* Xilinx Color Filter Array Interpolation (CFA) core. +* +* The Color Filter Array Interpolation core reconstructs a color image from an +* RGB or CMY Bayer filtered sensor using a 5x5 interpolation aperture. The core +* is capable of a maximum resolution of 7680 columns by 7680 rows with 8, 10, +* or 12 bits per pixel and supports the bandwidth necessary for High-definition +* (1080p60) resolutions in all Xilinx FPGA device families. +* Higher resolutions can be supported in Xilinx high-performance +* device families. +* +* Initialization & Configuration +* +* The device driver enables higher layer software (e.g., an application) to +* communicate to the CFA core. +* +* XCfa_CfgInitialize() API is used to initialize the CFA core. +* The user needs to first call the XCfa_LookupConfig() API which returns +* the Configuration structure pointer which is passed as a parameter to the +* XCfa_CfgInitialize() API. +* +* Interrupts +* +* The driver provides an interrupt handler XCfa_IntrHandler for handling +* the interrupt from the CFA core. The users of this driver have to +* register this handler with the interrupt system and provide the callback +* functions by using XCfa_SetCallBack API. +* +* Virtual Memory +* +* This driver supports Virtual Memory. The RTOS is responsible for calculating +* the correct device base address in Virtual Memory space. +* +* Threads +* +* This driver is not thread safe. Any needs for threads or thread mutual +* exclusion must be satisfied by the layer above this driver. +* +* Asserts +* +* Asserts are used within all Xilinx drivers to enforce constraints on argument +* values. Asserts can be turned off on a system-wide basis by defining, at +* compile time, the NDEBUG identifier. By default, asserts are turned on and it +* is recommended that users leave asserts on during development. +* +* Building the driver +* +* The XCfa driver is composed of several source files. This allows the user +* to build and link only those parts of the driver that are necessary. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- ----------------------------------------------
+* 1.00a xd     08/05/08 First release
+* 3.00a gz     10/22/10 Updated for CFA V3.0
+* 4.00a rc     09/11/11 Updated for CFA v4.0
+* 5.00a se     12/01/11 Updated for CFA v5.0, replaced xio.h with xil_io.h.
+* 6.0   adk    19/12/13 Updated as per the New Tcl API's.
+* 7.0   adk    01/07/14 Changed the file name from cfa.h to xcfa.h
+*                       Defined following handler types as enum
+*                       XCFA_HANDLER_PROCSTART, XCFA_HANDLER_FRAMEDONE,
+*                       XCFA_HANDLER_ERROR.
+*
+*                       Defined the BayerPhaseCombination enum
+*                       for bayerphase combinations.
+*
+*                       Defined the following macros:
+*                       XCFA_VSIZE_FIRST, XCFA_VSIZE_LAST
+*                       XCFA_HSIZE_FIRST, XCFA_HSIZE_LAST
+*                       XCfa_Start, XCfa_Stop, XCfa_IntrEnable,
+*                       XCfa_IntrDisable, XCfa_StatusGetPending,
+*                       XCfa_IntrGetPending, XCfa_IntrClear.
+*
+*                       Added the following function macros:
+*                       XCfa_Enable, XCfa_Disable, XCfa_Reset, XCfa_SyncReset,
+*                       XCfa_RegUpdateEnable, XCfa_RegUpdateDisable.
+*
+*                       Removed the following functional macros:
+*                       CFA_Enable, CFA_Disable, CFA_Reset, CFA_FSyncReset,
+*                       XCFA_RegUpdateEnable, XCFA_RegUpdateDisable,
+*                       CFA_ClearReset, CFA_ClearStatus.
+*
+*                       Defined the following type definitions:
+*                       XCfa_Config and XCfa structures.
+*                       XCfa_CallBack and XCfa_ErrorCallBack.
+*
+*                       Changes in xcfa_hw.h:
+*                       Added the register offsets and bit masks for the
+*                       registers and added backward compatibility for macros.
+*
+*                       Changes in xcfa.c:
+*                       Renamed this file as below:
+*                       cfa.c -> xcfa.c
+*                       Implemented the following functions:
+*                       XCfa_CfgInitialize, XCfa_Setup, XCfa_GetVersion,
+*                       XCfa_EnableDbgByPass, XCfa_IsDbgByPassEnabled,
+*                       XCfa_DisableDbgBypass, XCfa_EnableDbgTestPattern,
+*                       XCfa_IsDbgTestPatternEnabled,
+*                       XCfa_DisableDbgTestPattern, XCfa_GetDbgFrameCount,
+*                       XCfa_GetDbgLineCount, XCfa_GetDbgPixelCount,
+*                       XCfa_SetActiveSize, XCfa_GetActiveSize,
+*                       XCfa_SetBayerPhase, XCfa_GetBayerPhase,
+*                       StubCallBack, StubErrCallBack.
+*
+*                       Changes in  xcfa_intr.c:
+*                       Implemented the following functions:
+*                       XCfa_IntrHandler, XCfa_SetCallBack.
+*
+*                       Changes in xcfa_selftest.c:
+*                       Implemented XCfa_SelfTest function.
+*
+*                       Changes in xcfa_sinit.c :
+*                       Implemented XCfa_LookupConfig function.
+* 
+* +******************************************************************************/ + +#ifndef XCFA_H_ +#define XCFA_H_ /**< Prevent circular inclusions by using + * protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xcfa_hw.h" +#include "xil_assert.h" +#include "xstatus.h" + +/************************** Constant Definitions *****************************/ + +/** @name Handler Types + * @{ + */ +/** + * + * These constants specify different types of handlers and used to + * differentiate interrupt requests from core. + * + */ +enum { + XCFA_HANDLER_PROCSTART = 1, /**< A processing start event interrupt + * type */ + XCFA_HANDLER_FRAMEDONE, /**< A frame done event interrupt + * type */ + XCFA_HANDLER_ERROR /**< An error condition interrupt + * type */ +} ; +/*@}*/ + +/** @name Bayer phase + * @{ + */ +/** +* These constants specify Bayer phase combinations of the core. +*/ +enum BayerPhaseCombination { + XCFA_RGRG_COMBINATION, /**< Red green combination */ + XCFA_GRGR_COMBINATION, /**< Green red combination */ + XCFA_GBGB_COMBINATION, /**< Green blue combination */ + XCFA_BGBG_COMBINATION, /**< Blue green combination */ +} ; +/*@}*/ + +/** @name Active size range macros + * @{ + */ +#define XCFA_VSIZE_FIRST 32 /**< Vertical Size starting value */ +#define XCFA_VSIZE_LAST 7680 /**< Vertical Size ending value */ +#define XCFA_HSIZE_FIRST 32 /**< Horizontal Size starting value */ +#define XCFA_HSIZE_LAST 7680 /**< Horizontal Size ending value */ +/*@}*/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +/*****************************************************************************/ +/** +* +* This function macro enables the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_Enable(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_Enable(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_SW_EN_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro disables the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_Disable(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_Disable(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET))) & (~(XCFA_CTL_SW_EN_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro enables/starts the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_Start(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_Start XCfa_Enable + +/*****************************************************************************/ +/** +* +* This function macro disables/stops the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_Stop(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_Stop XCfa_Disable + +/*****************************************************************************/ +/** +* +* This function macro commits all the register value changes made so far +* by the software to the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_RegUpdateEnable(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_RegUpdateEnable(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_RUE_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro prevents the CFA core from committing recent changes made +* so far by the software. When disabled, changes to other configuration +* registers are stored, but do not effect the behavior of the core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_RegUpdateDisable(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_RegUpdateDisable(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET)))) & (~(XCFA_CTL_RUE_MASK))) + +/*****************************************************************************/ +/** +* +* This function macro resets a CFA core at the end of the frame being +* processed. It enables core automatically synchronizes to the SOF of the core +* to prevent image tearing. This function macro is differ from XCfa_Reset(). +* +* On the next rising-edge of SOF following a call to XCfa_SyncReset(), +* all of the core's configuration registers and outputs will be reset, then the +* reset flag will be immediately released, allowing the core to immediately +* resume default operation. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_SyncReset(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_SyncReset(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), (XCFA_CTL_AUTORESET_MASK)) + +/*****************************************************************************/ +/** +* +* This macro resets CFA core instance. This reset effects the core +* immediately and may cause image tearing. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return None. +* +* @note C-style signature: +* void XCfa_Reset(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_Reset(InstancePtr) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_CONTROL_OFFSET), (XCFA_CTL_RESET_MASK)) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending status of a CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return The pending interrupts of the CFA core. Use XCFA_IXR_*_MASK constants +* defined in xcfa_hw.h to interpret this value. +* +* @note C-style signature: +* u32 XCfa_StatusGePending(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_StatusGetPending(InstancePtr) \ + XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_STATUS_OFFSET)) & (XCFA_IXR_ALLINTR_MASK) + +/*****************************************************************************/ +/** +* +* This function macro clears/acknowledges pending interrupts of the CFA core. +* in the Status register. Bit positions of 1 will be cleared. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param IntrType is the pending interrupts to clear/acknowledge. +* Use OR'ing of XCFA_IXR_*_MASK constants defined in xcfa_hw.h to +* create this parameter value. +* +* @return None. +* +* @note C-style signature: +* void XCfa_IntrClear(XCfa *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XCfa_IntrClear(InstancePtr, IntrType) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_STATUS_OFFSET), ((IntrType) & \ + ((u32)(XCFA_IXR_ALLINTR_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro enables the given individual interrupt(s) on the +* CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param IntrType is the bit-mask of the interrupts to be enabled. +* Bit positions of 1 will be enabled. Bit positions of 0 will +* keep the previous setting. This mask is formed by OR'ing +* XCFA_IXR_*_MASK bits defined in xcfa_hw.h. +* +* @return None. +* +* @note The existing enabled interrupt(s) will remain enabled. +* C-style signature: +* void XCfa_IntrEnable(XCfa *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XCfa_IntrEnable(InstancePtr, IntrType) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_IRQ_EN_OFFSET), \ + (((IntrType) & (XCFA_IXR_ALLINTR_MASK)) | \ + (XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_IRQ_EN_OFFSET))))) + +/*****************************************************************************/ +/** +* +* This function macro disables the given individual interrupt(s) on the +* CFA core by updating Irq_Enable register. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param IntrType is the bit-mask of the interrupts to be disabled. +* Bit positions of 1 will be disabled. Bit positions of 0 will +* keep the previous setting. This mask is formed by OR'ing +* XCFA_IXR_*_MASK bits defined in xcfa_hw.h. +* +* @return None. +* +* @note Any other interrupt not covered by parameter IntrType, +* if enabled before this macro is called, will remain enabled. +* C-style signature: +* void XCfa_IntrDisable(XCfa *InstancePtr, u32 IntrType) +* +******************************************************************************/ +#define XCfa_IntrDisable(InstancePtr, IntrType) \ + XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_IRQ_EN_OFFSET), \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_IRQ_EN_OFFSET))) & ((~(IntrType)) & \ + (XCFA_IXR_ALLINTR_MASK)))) + +/*****************************************************************************/ +/** +* +* This function macro returns the pending interrupts of the CFA core. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* +* @return The pending interrupts of the CFA. Use XCFA_IXR_*_MASK +* constants defined in xcfa_hw.h to interpret this value. +* The returned value is a logical AND of the contents of the +* STATUS Register and the IRQ_ENABLE Register. +* +* @note C-style signature: +* u32 XCfa_IntrGetPending(XCfa *InstancePtr) +* +******************************************************************************/ +#define XCfa_IntrGetPending(InstancePtr) \ + XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_IRQ_EN_OFFSET)) & \ + ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ + (XCFA_STATUS_OFFSET))) & ((u32)(XCFA_IXR_ALLINTR_MASK))) + +/**************************** Type Definitions *******************************/ + +/** +* +* This typedef contains configuration information for the CFA core. +* Each CFA core should have a configuration structure associated. +* +******************************************************************************/ +typedef struct { + u16 DeviceId; /**< DeviceId is the unique ID of + * the core */ + u32 BaseAddress; /**< BaseAddress is the physical base + * address of the core's + * registers */ + u32 SlaveAxisVideoFormat; /**< Slave Axis Video Format */ + u32 MasterAxisVideoFormat; /**< Master Axis Video Format */ + u8 BayerPhase; /**< Bayer Phase */ + u32 SlaveAxiClkFreqHz; /**< Slave Clock Frequency */ + u32 ActiveRows; /**< Active rows */ + u32 ActiveColumns; /**< Active Columns */ + u32 MaxColumns; /**< Maximum Columns */ + u16 HasIntcIf; /**< Has Interrupt Control */ + u16 HasDebug; /**< Has Debug GUI specified */ + u32 HorFilt; /**< Optional Horizontal Filter */ + u32 FringeTol; /**< Fringe Tolerance */ +} XCfa_Config; + +/*****************************************************************************/ +/** +* +* Callback type for all interrupts except error interrupt. +* +* @param CallBackRef is a callback reference passed in by the upper +* layer when setting the callback functions, and passed back to +* the upper layer when the callback is invoked. +* +******************************************************************************/ +typedef void (*XCfa_CallBack)(void *CallBackRef); + +/*****************************************************************************/ +/** +* +* Callback type for error interrupt. +* +* @param CallBackRef is a callback reference passed in by the upper +* layer when setting the callback functions, and passed back +* to the upper layer when the callback is invoked. +* @param ErrorMask is a bit mask indicating the cause of the error. Its +* value equals 'OR'ing one or more XCFA_IXR_*_MASK values +* defined in xcfa_hw.h. +* +******************************************************************************/ +typedef void (*XCfa_ErrorCallBack)(void *CallBackRef, u32 ErrorMask); + +/** + * + * The XCfa instance data structure. A pointer to an instance data + * structure is passed around by functions to refer to a specific + * instance. + */ +typedef struct { + XCfa_Config Config; /**< Hardware configuration */ + u32 IsReady; /**< Core instance is initialized */ + u16 HSize; /**< Active video horizontal size */ + u16 VSize; /**< Active video vertical size */ + + /* IRQ callbacks here */ + XCfa_CallBack ProcStartCallBack;/**< Callback for processing start + * interrupt */ + void *ProcStartRef; /**< To be passed to the process start + * interrupt callback */ + XCfa_CallBack FrameDoneCallBack;/**< Callback for frame done + * interrupt */ + void *FrameDoneRef; /**< To be passed to the frame done + * interrupt callback */ + XCfa_ErrorCallBack ErrCallBack; /**< Callback for error interrupt */ + void *ErrRef; /**< To be passed to the error + * interrupt callback */ +} XCfa; + +/************************** Function Prototypes ******************************/ + +/* Static lookup function implemented in xcfa_sinit.c */ +XCfa_Config *XCfa_LookupConfig(u16 DeviceId); + +/* Implemented in xcfa.c */ +int XCfa_CfgInitialize(XCfa *InstancePtr, XCfa_Config *CfgPtr, + u32 EffectiveAddr); +void XCfa_Setup(XCfa *InstancePtr); +void XCfa_EnableDbgByPass(XCfa *InstancePtr); +int XCfa_IsDbgByPassEnabled(XCfa *InstancePtr); +void XCfa_DisableDbgBypass(XCfa *InstancePtr); +void XCfa_EnableDbgTestPattern(XCfa *InstancePtr); +int XCfa_IsDbgTestPatternEnabled(XCfa *InstancePtr); +void XCfa_DisableDbgTestPattern(XCfa *InstancePtr); +u32 XCfa_GetVersion(XCfa *InstancePtr); +u32 XCfa_GetDbgFrameCount(XCfa *InstancePtr); +u32 XCfa_GetDbgLineCount(XCfa *InstancePtr); +u32 XCfa_GetDbgPixelCount(XCfa *InstancePtr); +void XCfa_SetActiveSize(XCfa *InstancePtr, u16 HSize, u16 VSize); +void XCfa_GetActiveSize(XCfa *InstancePtr, u16 *HSize, u16 *VSize); +void XCfa_SetBayerPhase(XCfa *InstancePtr, + enum BayerPhaseCombination BayerPhase); +u32 XCfa_GetBayerPhase(XCfa *InstancePtr); + +/* Self - Test function in xcfa_selftest.c */ +int XCfa_SelfTest(XCfa *InstancePtr); + +/* Interrupt related functions in xcfa_intr.c */ +void XCfa_IntrHandler(void *InstancePtr); +int XCfa_SetCallBack(XCfa *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef); + +#ifdef __cplusplus +} + +#endif + +#endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/cfa/src/cfa.c b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_g.c similarity index 55% rename from XilinxProcessorIPLib/drivers/cfa/src/cfa.c rename to XilinxProcessorIPLib/drivers/cfa/src/xcfa_g.c index 694d6873..0fb0791a 100755 --- a/XilinxProcessorIPLib/drivers/cfa/src/cfa.c +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_g.c @@ -1,6 +1,6 @@ /****************************************************************************** * -* Copyright (C) 2001 - 2014 Xilinx, Inc. All rights reserved. +* (c) Copyright 2014 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,28 +30,39 @@ * ******************************************************************************/ -/** -* -* @file cfa.c -* -* This is the body of the Xilinx Color Filter Array Interpolation Core -* (CFA) core driver. Most of the driver functionality is implemented as -* macros in the cfa.h header file. -* -* MODIFICATION HISTORY: -* -* Ver Who Date Changes -* ----- ---- -------- ------------------------------------------------------- -* 5.00a se 12/01/11 Updated for CFA v5.0 -* 4.00a rc 09/11/11 Updated for CFA v4.0 -* 3.00a gz 10/22/10 Updated for CFA V3.0 -* -******************************************************************************/ +#include "xparameters.h" +#include "xcfa.h" -/***************************** Include Files *********************************/ - -#include "cfa.h" -#include "xenv.h" +/* +* The configuration table for devices +*/ +XCfa_Config XCfa_ConfigTable[] = +{ + { + XPAR_FMC_SENSOR_INPUT_V_CFA_1_DEVICE_ID, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_BASEADDR, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_DATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_DATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_TDATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_TDATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_FORMAT, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_FORMAT, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXIS_VIDEO_TUSER_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_M_AXIS_VIDEO_TUSER_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_ADDR_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_DATA_WIDTH, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_S_AXI_CLK_FREQ_HZ, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_BAYER_PHASE, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_ACTIVE_ROWS, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_ACTIVE_COLS, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_MAX_COLS, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_INTC_IF, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_AXI4_LITE, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_HAS_DEBUG, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_HOR_FILT, + XPAR_FMC_SENSOR_INPUT_V_CFA_1_FRINGE_TOL + } +}; diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa_hw.h b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_hw.h new file mode 100755 index 00000000..e27afd12 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_hw.h @@ -0,0 +1,260 @@ +/****************************************************************************** +* +* (c) Copyright 2014 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa_hw.h +* +* This header file contains identifiers and register-level driver functions (or +* macros) that can be used to access the Xilinx Color Filter Array +* Interpolation (CFA) core. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -------------------------------------------------------
+* 7.0   adk    01/07/14 First release.
+*                       Added the register offsets and bit masks for the
+*                       registers and added backward compatibility for macros.
+* 
+* +******************************************************************************/ + +#ifndef XCFA_HW_H_ +#define XCFA_HW_H_ /**< Prevent circular inclusions + * by using protection macros */ + +#ifdef __cplusplus +extern "C" { +#endif + +/***************************** Include Files *********************************/ + +#include "xil_io.h" + +/************************** Constant Definitions *****************************/ + +/** @name General control registers offsets + * @{ + */ +#define XCFA_CONTROL_OFFSET 0x000 /**< Control */ +#define XCFA_STATUS_OFFSET 0x004 /**< Status */ +#define XCFA_ERROR_OFFSET 0x008 /**< Error */ +#define XCFA_IRQ_EN_OFFSET 0x00C /**< IRQ Enable */ +#define XCFA_VERSION_OFFSET 0x010 /**< Version */ +#define XCFA_SYSDEBUG0_OFFSET 0x014 /**< System Debug 0 */ +#define XCFA_SYSDEBUG1_OFFSET 0x018 /**< System Debug 1 */ +#define XCFA_SYSDEBUG2_OFFSET 0x01C /**< System Debug 2 */ + +/* Timing control registers */ +#define XCFA_ACTIVE_SIZE_OFFSET 0x020 /**< Active Size (V x H) */ + +/* Core specific registers offset */ +#define XCFA_BAYER_PHASE_OFFSET 0x100 /**< Bayer_phase RW user register */ +/*@}*/ + +/** @name Control register bit mask definition + * @{ + */ +#define XCFA_CTL_SW_EN_MASK 0x00000001 /**< Enable Mask */ +#define XCFA_CTL_RUE_MASK 0x00000002 /**< Register Update Mask */ +#define XCFA_CTL_BPE_MASK 0x00000010 /**< Bypass Mask */ +#define XCFA_CTL_TPE_MASK 0x00000020 /**< Test pattern Mask */ + +#define XCFA_CTL_AUTORESET_MASK 0x40000000 /**< Software Reset - + * Auto-synchronize to SOF + * Mask */ +#define XCFA_CTL_RESET_MASK 0x80000000 /**< Software Reset - + * Instantaneous Mask */ +/*@}*/ + +/** @name Interrupt Register Bit Masks. It is applicable for + * Status and Irq_Enable Registers + * @{ + */ +#define XCFA_IXR_PROCS_STARTED_MASK 0x00000001 /**< Process Started + * Mask */ +#define XCFA_IXR_EOF_MASK 0x00000002 /**< End-Of-Frame Mask */ +#define XCFA_IXR_SE_MASK 0x00010000 /**< Slave Error Mask */ +#define XCFA_IXR_ALLINTR_MASK 0x00010003 /**< Interrupt All Error Mask + * (ORing of all + * Interrupt Mask) */ +/*@}*/ + +/** @name Error Register bit mask definitions + * @{ + */ +#define XCFA_ERR_EOL_EARLY_MASK 0x00000001 /**< Error: End of line + * Early Mask */ +#define XCFA_ERR_EOL_LATE_MASK 0x00000002 /**< Error: End of line + * Late Mask */ +#define XCFA_ERR_SOF_EARLY_MASK 0x00000004 /**< Error: Start of frame + * Early Mask */ +#define XCFA_ERR_SOF_LATE_MASK 0x00000008 /**< Error: Start of frame + * Late Mask */ +/*@}*/ + +/** @name Version register bit definition and shifts + * @{ + */ +#define XCFA_VER_REV_NUM_MASK 0x000000FF /**< Revision Number Mask */ +#define XCFA_VER_PID_MASK 0x00000F00 /**< Patch ID Mask */ +#define XCFA_VER_MINOR_MASK 0x00FF0000 /**< Version Minor Mask */ +#define XCFA_VER_MAJOR_MASK 0xFF000000 /**< Version Major Mask */ +#define XCFA_VER_REV_MASK 0x0000F000 /**< Version revision Mask */ +#define XCFA_VER_MAJOR_SHIFT 24 /**< Version Major Shift */ +#define XCFA_VER_MINOR_SHIFT 16 /**< Version Minor Shift */ +#define XCFA_VER_INTERNAL_SHIFT 8 /**< Version Internal Shift */ +#define XCFA_VER_REV_SHIFT 12 /**< Version Revision Shift */ +/*@}*/ + +/** @name Active size register bit mask definition and shifts + * @{ + */ +#define XCFA_ACTSIZE_NUM_PIXEL_MASK 0x00001FFF /**< Active size + * Mask */ +#define XCFA_ACTSIZE_NUM_LINE_MASK 0x1FFF0000 /**< Number of Active + * lines per + * Frame + * (Vertical) */ +#define XCFA_ACTSIZE_NUM_LINE_SHIFT 16 /**< Active size + * Shift */ +/*@}*/ + +/** @name Bayer Phase + * @{ + */ +#define XCFA_BAYER_PHASE_MASK 0x00000003 /**< Bayer Phase Mask */ + +/*@}*/ + +/** @name General purpose masks + * @{ + */ +#define XCFA_8_BIT_MASK 0x0FF /**< Generic 8 bit Mask */ +/*@}*/ + +/** @name Backward compatibility macros + * @{ + */ +#define CFA_CONTROL XCFA_CONTROL_OFFSET +#define CFA_STATUS XCFA_STATUS_OFFSET +#define CFA_ERROR XCFA_ERROR_OFFSET +#define CFA_IRQ_EN XCFA_IRQ_EN_OFFSET +#define CFA_VERSION XCFA_VERSION_OFFSET +#define CFA_SYSDEBUG0 XCFA_SYSDEBUG0_OFFSET +#define CFA_SYSDEBUG1 XCFA_SYSDEBUG1_OFFSET +#define CFA_SYSDEBUG2 XCFA_SYSDEBUG2_OFFSET +#define CFA_ACTIVE_SIZE XCFA_ACTIVE_SIZE_OFFSET +#define CFA_BAYER_PHASE XCFA_BAYER_PHASE_OFFSET +#define CFA_CTL_EN_MASK XCFA_CTL_SW_EN_MASK +#define CFA_CTL_RUE_MASK XCFA_CTL_RUE_MASK +#define CFA_CTL_CS_MASK XCFA_CTL_CS_MASK +#define CFA_RST_RESET XCFA_CTL_RESET_MASK +#define CFA_RST_AUTORESET XCFA_CTL_AUTORESET_MASK + +#define CFA_In32 XCfa_In32 +#define CFA_Out32 XCfa_Out32 + +#define CFA_ReadReg XCfa_ReadReg +#define CFA_WriteReg XCfa_WriteReg +/*@}*/ + +/** @name Interrupt Enable and Status Registers Offsets + * @{ + */ +/** +* Interrupt status register generates a interrupt if the corresponding bits of +* interrupt enable register bits are set. +*/ +#define XCFA_ISR_OFFSET XCFA_STATUS_OFFSET /**< Interrupt Status Offset */ +#define XCFA_IER_OFFSET XCFA_IRQ_EN_OFFSET /**< Interrupt Enable Offset */ + /*@}*/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +#define XCfa_In32 Xil_In32 /**< Cfa Input Operation. */ +#define XCfa_Out32 Xil_Out32 /**< Cfa Output Operation. */ + +/*****************************************************************************/ +/** +* +* This function macro reads the given register. +* +* @param BaseAddress is the base address of the CFA core. +* @param RegOffset is the register offset of the core (defined at +* top of this file). +* +* @return The 32-bit value of the register. +* +* @note C-style signature: +* u32 XCfa_ReadReg(u32 BaseAddress, u32 RegOffset) +* +******************************************************************************/ +#define XCfa_ReadReg(BaseAddress, RegOffset) \ + XCfa_In32((BaseAddress) + (u32)(RegOffset)) + +/*****************************************************************************/ +/** +* +* This function macro writes the given register. +* +* @param BaseAddress is the base address of the CFA core. +* @param RegOffset is the register offset of the core (defined at +* top of this file). +* @param Data is the 32-bit value to write into the register. +* +* @return None. +* +* @note C-style signature: +* void XCfa_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data) +* +******************************************************************************/ +#define XCfa_WriteReg(BaseAddress, RegOffset, Data) \ + XCfa_Out32((BaseAddress) + (u32)(RegOffset), (Data)) + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Declarations ****************************/ + + +#ifdef __cplusplus +} + +#endif + +#endif /* End of protection macro */ diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa_intr.c b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_intr.c new file mode 100755 index 00000000..e71f8504 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_intr.c @@ -0,0 +1,208 @@ +/****************************************************************************** +* +* (c) Copyright 2014 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa_intr.c +* +* This file contains interrupt related functions of the CFA core. +* Please see xcfa.h for more details of the core. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- --------------------------------------------------
+* 7.0   adk    01/07/14 First release.
+*                       Implemented the following functions:
+*                       XCfa_IntrHandler, XCfa_SetCallBack.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xcfa.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function is the interrupt handler for the CFA core. +* +* This handler reads the pending interrupt from the STATUS register, +* determines the source of the interrupts and calls the respective +* callbacks for the interrupts that are enabled in IRQ_ENABLE register, +* and finally clears the interrupts. +* +* The application is responsible for connecting this function to the interrupt +* system. Application beyond this core is also responsible for providing +* callbacks to handle interrupts and installing the callbacks using +* XCfa_SetCallBack() during initialization phase. +* +* @param InstancePtr is a pointer to the XCfa instance that just +* interrupted. +* +* @return None. +* +* @note Interrupt interface should be enabled. +* +******************************************************************************/ +void XCfa_IntrHandler(void *InstancePtr) +{ + u32 PendingIntr; + u32 ErrorStatus; + XCfa *XCfaPtr = NULL; + XCfaPtr = (XCfa *)((void *)InstancePtr); + + /* Verify arguments. */ + Xil_AssertVoid(XCfaPtr != NULL); + Xil_AssertVoid(XCfaPtr->IsReady == (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertVoid(XCfaPtr->Config.HasIntcIf != (u16)0x0); + + + /* Get pending interrupts */ + PendingIntr = (u32)XCfa_IntrGetPending(XCfaPtr); + + /* A Slave Error interrupt has happened. */ + if (((PendingIntr) & (XCFA_IXR_SE_MASK)) == + ((XCFA_IXR_SE_MASK))) { + ErrorStatus = (PendingIntr) & ((u32)XCFA_IXR_SE_MASK); + XCfaPtr->ErrCallBack(XCfaPtr->ErrRef, ErrorStatus); + } + + /* A processing start has happened */ + if (((PendingIntr) & (XCFA_IXR_PROCS_STARTED_MASK)) == + (XCFA_IXR_PROCS_STARTED_MASK)) { + XCfaPtr->ProcStartCallBack(XCfaPtr->ProcStartRef); + } + + /* A frame done interrupt has happened */ + if (((PendingIntr) & (XCFA_IXR_EOF_MASK)) == + (XCFA_IXR_EOF_MASK)) { + XCfaPtr->FrameDoneCallBack(XCfaPtr->FrameDoneRef); + } + + /* Clear pending interrupt(s) */ + XCfa_IntrClear(XCfaPtr, PendingIntr); + +} + +/*****************************************************************************/ +/** +* +* This routine installs an asynchronous callback function for the given +* HandlerType: +* +*
+* HandlerType              Callback Function Type
+* -----------------------  -----------------------------------
+* XCFA_HANDLER_FRAMEDONE   FrameDoneCallBack
+* XCFA_HANDLER_PROCSTART   ProcStartCallBack
+* XCFA_HANDLER_ERROR       ErrCallBack
+*
+* 
+* +* @param InstancePtr is a pointer to the XCfa instance to be worked on. +* @param HandlerType specifies which callback is to be attached. +* @param CallBackFunc is the address of the callback function. +* @param CallBackRef is a user data item that will be passed to the +* callback function when it is invoked. +* +* @return +* - XST_SUCCESS when handler is installed. +* - XST_INVALID_PARAM when HandlerType is invalid. +* +* @note Invoking this function for a handler that already has been +* installed replaces it with the new handler. +* +******************************************************************************/ +int XCfa_SetCallBack(XCfa *InstancePtr, u32 HandlerType, + void *CallBackFunc, void *CallBackRef) +{ + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->IsReady == + (u32)(XIL_COMPONENT_IS_READY)); + Xil_AssertNonvoid(CallBackFunc != NULL); + Xil_AssertNonvoid(CallBackRef != NULL); + Xil_AssertNonvoid((HandlerType >= (u32)(XCFA_HANDLER_PROCSTART)) && + (HandlerType <= (u32)(XCFA_HANDLER_ERROR))); + + /* Calls the respective callbacks according to handler type */ + switch (HandlerType) { + case (XCFA_HANDLER_PROCSTART): + InstancePtr->ProcStartCallBack = + (XCfa_CallBack)((void *)CallBackFunc); + InstancePtr->ProcStartRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case (XCFA_HANDLER_FRAMEDONE): + InstancePtr->FrameDoneCallBack = + (XCfa_CallBack)((void *)CallBackFunc); + InstancePtr->FrameDoneRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + case (XCFA_HANDLER_ERROR): + InstancePtr->ErrCallBack = + (XCfa_ErrorCallBack)((void *)CallBackFunc); + InstancePtr->ErrRef = CallBackRef; + Status = (XST_SUCCESS); + break; + + default: + Status = (XST_INVALID_PARAM); + break; + } + + return Status; +} diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa_selftest.c b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_selftest.c new file mode 100755 index 00000000..f9767bdf --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_selftest.c @@ -0,0 +1,110 @@ +/****************************************************************************** +* +* (c) Copyright 2014 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa_selftest.c +* +* This file contains the self-test functions for the CFA core. +* The self test function reads the Version register. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who     Date     Changes
+* ----- ------- -------- ----------------------------------------------
+* 7.0   adk     01/07/14 First Release
+*                        Implemented XCfa_SelfTest function.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xcfa.h" +#include "xstatus.h" + +/************************** Constant Definitions *****************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/**************************** Type Definitions *******************************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Definitions *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function reads complete Version register of CFA core and compares +* with zero values as part of self test. +* +* @param InstancePtr is a pointer to the XCfa instance to be worked +* on. +* +* @return +* - XST_SUCCESS if the Version register read test was successful. +* - XST_FAILURE if the Version register read test failed. +* +* @note None. +* +******************************************************************************/ +int XCfa_SelfTest(XCfa *InstancePtr) +{ + u32 Version; + int Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + + /* Read CFA core version register. */ + Version = XCfa_ReadReg(InstancePtr->Config.BaseAddress, + (XCFA_VERSION_OFFSET)); + + /* Compare version with zero. */ + if (Version != (u32)0x0) { + Status = (XST_SUCCESS); + } + else { + Status = (XST_FAILURE); + } + + return Status; +} diff --git a/XilinxProcessorIPLib/drivers/cfa/src/xcfa_sinit.c b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_sinit.c new file mode 100755 index 00000000..0e072689 --- /dev/null +++ b/XilinxProcessorIPLib/drivers/cfa/src/xcfa_sinit.c @@ -0,0 +1,107 @@ +/****************************************************************************** +* +* (c) Copyright 2014 Xilinx, Inc. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* Use of the Software is limited solely to applications: +* (a) running on a Xilinx device, or +* (b) that interact with a Xilinx device through a bus or interconnect. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +* Except as contained in this notice, the name of the Xilinx shall not be used +* in advertising or otherwise to promote the sale, use or other dealings in +* this Software without prior written authorization from Xilinx. +* +******************************************************************************/ +/*****************************************************************************/ +/** +* +* @file xcfa_sinit.c +* +* This file contains static initialization methods for Xilinx CFA core. +* +*
+* MODIFICATION HISTORY:
+*
+* Ver   Who    Date     Changes
+* ----- ------ -------- -----------------------------------------------
+* 7.0   adk    01/07/14 First release.
+*                       Implemented XCfa_LookupConfig function.
+* 
+* +******************************************************************************/ + +/***************************** Include Files *********************************/ + +#include "xcfa.h" +#include "xparameters.h" + +/************************** Constant Definitions *****************************/ + + +/**************************** Type Definitions *******************************/ + + +/***************** Macros (Inline Functions) Definitions *********************/ + + +/************************** Function Prototypes ******************************/ + + +/************************** Variable Declaration *****************************/ + + +/************************** Function Definitions *****************************/ + +/*****************************************************************************/ +/** +* +* This function returns a reference to an XCfa_Config structure +* based on the unique device id, DeviceId. The return value will refer +* to an entry in the device configuration table defined in the xcfa_g.c file. +* +* @param DeviceId is the unique device ID of the core for the lookup +* operation. +* +* @return CfgPtr is a reference to a config record in the +* configuration table (in xcfa_g.c) corresponding to +* DeviceId, or NULL if no match is found. +* +* @note None. +* +******************************************************************************/ +XCfa_Config *XCfa_LookupConfig(u16 DeviceId) +{ + extern XCfa_Config XCfa_ConfigTable[XPAR_CFA_NUM_INSTANCES]; + u32 Index; + XCfa_Config *CfgPtr = NULL; + + /* To get the reference pointer to XCfa_Config structure */ + for (Index = (u32)0x0; Index < (u32)(XPAR_CFA_NUM_INSTANCES); + Index++) { + + /* Compare device Id with configTable's device Id */ + if (XCfa_ConfigTable[Index].DeviceId == DeviceId) { + CfgPtr = &XCfa_ConfigTable[Index]; + break; + } + } + + return (XCfa_Config *)CfgPtr; +}