Permalink
Browse files

holy shit it worked!!!!

  • Loading branch information...
1 parent 075e456 commit edfdf4f89e2ec7f141d02b73e399516accea1c82 @burneykb burneykb committed Feb 17, 2017
Showing 1,280 changed files with 493,399 additions and 525 deletions.
View
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Joseph Zambreno
+ * Phillip Jones
+ *
+ * Department of Electrical and Computer Engineering
+ * Iowa State University
+ *****************************************************************************/
+
+/*****************************************************************************
+ * camera_app.c - main camera application code. The camera configures the various
+ * video in and video out peripherals, and (optionally) performs some
+ * image processing on data coming in from the vdma.
+ *
+ *
+ * NOTES:
+ * 02/04/14 by JAZ::Design created.
+ *****************************************************************************/
+
+#include "camera_app.h"
+
+
+camera_config_t camera_config;
+
+// Main function. Initializes the devices and configures VDMA
+int main() {
+
+ printf("made it\n");
+
+ camera_config_init(&camera_config);
+ fmc_imageon_enable(&camera_config);
+ camera_loop(&camera_config);
+
+ return 0;
+}
+
+
+// Initialize the camera configuration data structure
+void camera_config_init(camera_config_t *config) {
+
+ config->uBaseAddr_IIC_FmcIpmi = XPAR_IIC_FMC_BASEADDR;
+ config->uBaseAddr_IIC_FmcImageon = XPAR_FMC_IMAGEON_IIC_0_BASEADDR;
+// config->uBaseAddr_VITA_Receiver = XPAR_FMC_IMAGEON_VITA_RECEIVER_0_BASEADDR;
+// config->uBaseAddr_CFA = XPAR_CFA_0_BASEADDR;
+// config->uBaseAddr_CRES = XPAR_CRESAMPLE_0_BASEADDR;
+// config->uBaseAddr_RGBYCC = XPAR_RGB2YCRCB_0_BASEADDR;
+ config->uBaseAddr_TPG_PatternGenerator = XPAR_AXI_TPG_0_BASEADDR;
+
+ config->uDeviceId_VTC_ipipe = XPAR_V_TC_0_DEVICE_ID;
+ config->uDeviceId_VTC_tpg = XPAR_V_TC_1_DEVICE_ID;
+
+ config->uDeviceId_VDMA_HdmiFrameBuffer = XPAR_AXI_VDMA_0_DEVICE_ID;
+ config->uBaseAddr_MEM_HdmiFrameBuffer = XPAR_DDR_MEM_BASEADDR + 0x10000000;
+ config->uNumFrames_HdmiFrameBuffer = XPAR_AXIVDMA_0_NUM_FSTORES;
+
+ return;
+}
+
+// Main (SW) processing loop. Recommended to have an explicit exit condition
+void camera_loop(camera_config_t *config) {
+
+ Xuint32 parkptr;
+ Xuint32 vdma_S2MM_DMACR, vdma_MM2S_DMACR;
+ int i, j;
+
+
+ xil_printf("Entering main SW processing loop\r\n");
+
+
+ // Grab the DMA parkptr, and update it to ensure that when parked, the S2MM side is on frame 0, and the MM2S side on frame 1
+ parkptr = XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_PARKPTR_OFFSET);
+ parkptr &= ~XAXIVDMA_PARKPTR_READREF_MASK;
+ parkptr &= ~XAXIVDMA_PARKPTR_WRTREF_MASK;
+ parkptr |= 0x1;
+ XAxiVdma_WriteReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_PARKPTR_OFFSET, parkptr);
+
+
+ // Grab the DMA Control Registers, and clear circular park mode.
+ vdma_MM2S_DMACR = XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_TX_OFFSET+XAXIVDMA_CR_OFFSET);
+ XAxiVdma_WriteReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_TX_OFFSET+XAXIVDMA_CR_OFFSET, vdma_MM2S_DMACR & ~XAXIVDMA_CR_TAIL_EN_MASK);
+ vdma_S2MM_DMACR = XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_RX_OFFSET+XAXIVDMA_CR_OFFSET);
+ XAxiVdma_WriteReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_RX_OFFSET+XAXIVDMA_CR_OFFSET, vdma_S2MM_DMACR & ~XAXIVDMA_CR_TAIL_EN_MASK);
+
+
+ // Pointers to the S2MM memory frame and M2SS memory frame
+ volatile Xuint16 *pS2MM_Mem = (Xuint16 *)XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_S2MM_ADDR_OFFSET+XAXIVDMA_START_ADDR_OFFSET);
+ volatile Xuint16 *pMM2S_Mem = (Xuint16 *)XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_MM2S_ADDR_OFFSET+XAXIVDMA_START_ADDR_OFFSET+4);
+
+
+ // Run for 1000 frames before going back to HW mode
+ for (j = 0; j < 1000; j++) {
+ for (i = 0; i < 1920*1080; i++) {
+ //pMM2S_Mem[i] = pS2MM_Mem[1920*1080-i-1] % 255; // made it all very green!
+ //pMM2S_Mem[i] = pS2MM_Mem[1920*1080-i+j-1]; // makes the image slowly shift to the right and wrap around.
+ pMM2S_Mem[i] = pS2MM_Mem[1920*1080-i-1] + 263; // makes it solid black. and also kinda breaks it.
+ }
+ }
+
+
+ // Grab the DMA Control Registers, and re-enable circular park mode.
+ vdma_MM2S_DMACR = XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_TX_OFFSET+XAXIVDMA_CR_OFFSET);
+ XAxiVdma_WriteReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_TX_OFFSET+XAXIVDMA_CR_OFFSET, vdma_MM2S_DMACR | XAXIVDMA_CR_TAIL_EN_MASK);
+ vdma_S2MM_DMACR = XAxiVdma_ReadReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_RX_OFFSET+XAXIVDMA_CR_OFFSET);
+ XAxiVdma_WriteReg(config->vdma_hdmi.BaseAddr, XAXIVDMA_RX_OFFSET+XAXIVDMA_CR_OFFSET, vdma_S2MM_DMACR | XAXIVDMA_CR_TAIL_EN_MASK);
+
+
+ xil_printf("Main SW processing loop complete!\r\n");
+
+
+ return;
+}
+
View
Binary file not shown.
View
No changes.
View
@@ -0,0 +1,27 @@
+!SESSION 2017-02-16 14:54:01.237 -----------------------------------------------
+eclipse.buildId=Release 14.7 Build SDK_P.20131013
+java.version=1.6.0_21
+java.vendor=Sun Microsystems Inc.
+BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
+Command-line arguments: -os win32 -ws win32 -arch x86_64
+
+!ENTRY org.eclipse.cdt.core 1 0 2017-02-16 14:58:12.864
+!MESSAGE Indexed 'system_bsp' (133 sources, 163 headers) in 5.76 sec: 8,029 declarations; 33,216 references; 98 unresolved inclusions; 17 syntax errors; 184 unresolved names (0.44%)
+
+!ENTRY org.eclipse.cdt.core 1 0 2017-02-16 14:58:13.824
+!MESSAGE Indexed 'camera_app' (7 sources, 52 headers) in 0.95 sec: 2,654 declarations; 5,259 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0.00%)
+!SESSION 2017-02-16 15:51:08.266 -----------------------------------------------
+eclipse.buildId=Release 14.7 Build SDK_P.20131013
+java.version=1.6.0_21
+java.vendor=Sun Microsystems Inc.
+BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
+Command-line arguments: -os win32 -ws win32 -arch x86_64
+
+!ENTRY org.eclipse.cdt.core 1 0 2017-02-16 15:54:02.161
+!MESSAGE Indexed 'system_bsp' (133 sources, 163 headers) in 5.38 sec: 8,029 declarations; 33,216 references; 98 unresolved inclusions; 17 syntax errors; 184 unresolved names (0.44%)
+
+!ENTRY org.eclipse.cdt.core 1 0 2017-02-16 16:16:20.471
+!MESSAGE Indexed 'system_bsp' (133 sources, 163 headers) in 4.76 sec: 8,029 declarations; 33,216 references; 98 unresolved inclusions; 17 syntax errors; 184 unresolved names (0.44%)
+
+!ENTRY org.eclipse.cdt.core 1 0 2017-02-16 16:16:31.887
+!MESSAGE Indexed 'camera_app' (7 sources, 53 headers) in 0.97 sec: 2,673 declarations; 5,261 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0.00%)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section name="Workbench">
+ <item value="" key="system_hw_platform-bmmFile"/>
+ <item value="system.bit" key="system_hw_platform-bitFile"/>
+</section>
@@ -0,0 +1,5 @@
+*** SESSION Feb 16, 2017 14:54:20.76 -------------------------------------------
+*** SESSION Feb 16, 2017 15:51:39.48 -------------------------------------------
+*** SESSION Feb 16, 2017 16:46:52.32 -------------------------------------------
+*** SESSION Feb 16, 2017 18:38:02.71 -------------------------------------------
+*** SESSION Feb 16, 2017 18:42:21.43 -------------------------------------------
Oops, something went wrong.

0 comments on commit edfdf4f

Please sign in to comment.