From 91f474c0e4999304d3a473fb9320ac17bcefc959 Mon Sep 17 00:00:00 2001 From: Jens True Date: Wed, 28 Nov 2018 19:27:03 +0100 Subject: [PATCH] Added software implementation --- userland.c => helloworld.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) rename userland.c => helloworld.c (81%) diff --git a/userland.c b/helloworld.c similarity index 81% rename from userland.c rename to helloworld.c index cb46025..7256466 100644 --- a/userland.c +++ b/helloworld.c @@ -49,26 +49,25 @@ #include "platform.h" #include "xil_printf.h" #include "xil_io.h" - -#include - - +#define SIMPELVGA_REG_BASE (0x43c00000) +#define SIMPELVGA_REG_X (SIMPELVGA_REG_BASE + 0) +#define SIMPELVGA_REG_Y (SIMPELVGA_REG_BASE + 4) +#define SIMPELVGA_REG_COLOR (SIMPELVGA_REG_BASE + 8) int main() { init_platform(); print("Hello World\n\r"); - SIMPLEVGA_mWriteReg(XPAR_SIMPLEVGA_0_S00_AXI_BASEADDR, SIMPLEVGA_S00_AXI_SLV_REG0_OFFSET, 0xFFFFFFFF); - SIMPLEVGA_mWriteReg(XPAR_SIMPLEVGA_0_S00_AXI_BASEADDR, SIMPLEVGA_S00_AXI_SLV_REG1_OFFSET, 0xFFFFFFFF); - SIMPLEVGA_mWriteReg(XPAR_SIMPLEVGA_0_S00_AXI_BASEADDR, SIMPLEVGA_S00_AXI_SLV_REG2_OFFSET, 0xFFFFFFFF); - unsigned long x = 1; + Xil_Out32(SIMPELVGA_REG_X, (460 << 16) + 160); + Xil_Out32(SIMPELVGA_REG_Y, (360 << 16) + 120); while(1) { - for(x = 1; x < 100; x++) { - unsigned long xreg = ((640-x) << 16) + x; - SIMPLEVGA_mWriteReg(XPAR_SIMPLEVGA_0_S00_AXI_BASEADDR, SIMPLEVGA_S00_AXI_SLV_REG0_OFFSET, x); + unsigned long x; + for(x = 0; x <= 0b111111; x++) { + Xil_Out32(SIMPELVGA_REG_COLOR, x); + printf("Set color %x\n",x); sleep(1); } } cleanup_platform(); return 0; -} \ No newline at end of file +}