zxcmehran / FPGADisplay-driver

FPGA VGA Display Handler - IP Driver Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FPGA Display (IP Driver)

Quick Access: This is the IP Driver repository. Check FPGADisplay-ipcore repository for main IP Core files. You might also want to see Persian Introduction | معرفی به زبان پارسی.

It's the C Driver library used in pair with FPGADisplay-ipcore to control VGA Display. Its required to install the driver along main IP Core to be able to programmatically control display output.

It lets the designer to control each single pixel on the screen. The designer will be able to plot basic geometric shapes including lines, triangles, rectangles and circles. It won't use any floating point operations and the whole system is implemented using integers. It also lets the designer to print ASCII character strings over the screen using a monospace typeface. In addition, it provides a terminal-like area on the screen which reflows the text and can be useful for debugging and output monitoring.

This is a demo example of output possibilities. Please note that it's the actual monitor output extracted by dumping VGA display memory to a image file.

FPGA Display Handler Output

Installing

Note: This driver needs the main IP Core to operate. Check FPGADisplay-ipcore repository for installation details.

This repository contains IP Driver files. Clone it in a directory named display_handler_v1_00_a under drivers directory in your project root or in global user peripheral repository of your EDK installation.

$ cd [project dir or global repo]
$ cd drivers
$ git clone https://github.com/zxcmehran/FPGADisplay-driver.git display_handler_v1_00_a

After cloning, just add display_handler.h header file to the compiler and include it in your application code.

Usage

First of all, it's needed to initialize some parameters. The library needs memory base address to operate. It's usually stored on a constant named like XPAR_DISPLAY_HANDLER_0_MEM0_BASEADDR in xparameters.h header file which gets generated by EDK software after LibGen operation. You can set memory base address by calling setBaseAddr() function. Remember to call this function before any usages, just right in the beginning of your code.

setBaseAddr(XPAR_DISPLAY_HANDLER_0_MEM0_BASEADDR);

If you are not using default 640x480 resolution on IP Hardware, then set the actual display mode using setResolution():

setResolution(1024, 768);

You're all set. You can access functions documentation in display_handler.h file.

Terminal-like area

Terminal-like area is placed on the bottom of the screen. It behaves just like a Linux Terminal / Windows Command Prompt output area and scrolls up the placed text upon line overflow or new line insertion. You can see an example of repetitive insertion of "This is a test! " string on the preview image above. It also supports control characters like \t, \r, and \n.

You can set the size of the area by calling setLineCount(). By default, 3 lines are used.

setLineCount(4);

You can insert text on the terminal by simply calling printString():

printString("Just another string. ");

License

This is a B.Sc Project of Electrical Engineering by Mehran Ahadi. Its published under MIT license. Please include the copyright and the license notice in all copies or substantial uses of the work.

About

FPGA VGA Display Handler - IP Driver Repository

License:MIT License


Languages

Language:C 95.8%Language:Makefile 2.4%Language:Tcl 1.8%