Project Name: SRGP_bf533.dpj Project Type: ADSP-BF533 [X] ADSP-BF537 [ ] ADSP-BF561 [ ] Hardware Used: ************************************** ************************************** *** PLEASE READ THE RELEASE NOTE *** *** FOR SPECIFIC HARDWARE AND *** *** SOFTWARE CONFIGURATIONS *** *** SUPPORTED BY THIS APPLICATION *** ************************************** ************************************** ADSP-BF533 EZ-Kit Analog Devices VisualDSP++ VisualDSP++ Emulator TV with NTSC AV input System Services Components Used: DMA Manager [X] Deferred Callback Manager [ ] Interrupt Manager [X] Timer Module [ ] Power Management Module [X] Flag Module [ ] External Bus Interface Unit Module [X] Port Module [ ] OVERVIEW ========= This application demonstrates a port of the Simple Raster Graphic Package (SRGP) to the ADSP-BF533 Blackfin DSP. SRGP was developed at Brown University and is available at http://www.cs.brown.edu/software/. An accompanying text book: "Computer Graphics: Principles and Practice" is also helpful in understanding SRGP. RUNNING THE APPLICATION ======================= 1. Hardware settings -------------------- -- BF533 Ez Kit -- SW1: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-OFF SW2: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-OFF SW3: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-OFF SW9: 1-ON 2-ON 3-OFF 4-OFF 5-OFF 6-OFF SW10 1-ON 2-ON SW11 1-OFF 2-ON SW12 1-ON 2-ON 3-ON 4-ON 2. ADSP-BF533 EZ-KIT Lite - Push Button functions ------------------------------------------------- Push Button 1 (SW4): Moves to previous screen Push Button 2 (SW5): Moves to next screen Push Button 3 (SW6): not used Push Button 4 (SW7): not used 3. If using an emulator, make sure that external SDRAM is initialized before downloading the program. Using "Settings"->"Target Options->Use XML reset values" is the most straight-forward way of doing this. This step is not required is using the EZ-KIT's USB debug agent connection. 4. External Connections ----------------------- Connect the middle white video plug on the VIDEO IN/OUT bank to an NSTC capable display/television with composite video input. Set the display to the corresponding video input. RCA-style jacks labeled J8 J8 +---------------------------------------------------+ | O O < Video Out O | (White) | O O O | (Red) +---------------------------------------------------+ NOTE: VisualDSP++ Image Viewer may also be used. Set the parameters for raw pixel data, beginning at address 0, memory stride 1, UYVY format. The dimensions are 858x525. 5. Operational Description --------------------------- - In VisualDSP, open the project "srgp_bf533.dpj". - Select 'Project->Rebuild Project' to build all the sources and load the program to the target. - Select 'Debug->Run' to run the program. You will see the welcome screen. - Follow the on-screen instructions, using the EZ-KIT's first two push-buttons to move forward and backward through the screens. NOTE: The screen buffer uses the first portion of bank 0 of external memory of the EZ-KIT Lite. The memory after address 0x0 is reserved for this purpose, inside of the LDF. That address may be changed by reserving a different area in the LDF, and changing the variable inside "main()" in the file "srgp.c" where the address of the canvas area is specified. --------------------------------------------- SOFTWARE OWNERSHIP AND INTELLECTUAL PROPERTY --------------------------------------------- ADI_GRAPH was developed by Analog Devices. The algorithms are generally well known, but acknowledgement must be made to "Computer Graphics: Principles and Practice", particularly for its fixed-point ellipse algorithm. Permission is grant to use ADI_GRAPH for any purpose and is provided without warranty. The .BDF fonts are those distributed with X-Windows in its ...\xc\fonts\bdf directory. Copyright information can be found on a per-font basis within the .BDF file's comments. SRGP was developed by Brown University and it owns the copyright. Details concerning its use can be found in the file COPYING_POLICY.TXT. The application itself was developed by Analog Devices. Permission is granted to use ADI_GRAPH for any purpose and is provided without warranty. ------------------------------------ LIMATIONS, AND NOTEWORTHY BEHAVIORS ------------------------------------ In general, the application demonstrates the functionality available within SRGP and ADI_GRAPH. The application can also run on Redhat Linux. To the extent practical, this Blackfin port emulates the look of Linux (X-Windows). Developing your SRGP code on an X-Windows platforms and then porting it to Blackfin will "mostly work". There is only a single video buffer in this application. As a result, you may see a momentary burst of static when switching pages and/or your display may loose synch briefly. GENERAL Writing a single "pixel" will in fact write to both the even and odd frames of the interlaced display, to prevent screen flicker. This behavior can be changed by modifying the file 'adi_graph_driver.c' and rebuilding the adi_graph library. LINES, PATTERNS AND FILLS Pixmaps interfaces are not supported. SRGP_setWriteMode() is not supported and all writes will behave as WRITE_REPLACE. SRPG_setLineWidth() is not suppored. SRGP_setLineStyle() *is* available, as is SRGP_setFillStyle() (except the PIXMAP_PATTERN style as noted above). SRGP_setFillBitmapPattern() is supported for rectangles only. POLYGONS SRGP_fillPolygon() is not supported. FONTS SRPG's SRGP_loadFont() API is unavailable. Instead, SRGP_ADI_loadFont() is provided. This is because SRGP_loadFont() looks up by name (char*), requiring every font to linked into the program because the fonts actually required cannot be determined at build-time. SRGP_ADI_loadFont() "looks up" by symbol name, allowing the linker to eliminate fonts not specifically referenced by callers. The symbol names for support fonts can be found in the include file 'adi_graph_font_decls.h' located in "BlackfinSDK/Include/adi_graph/fonts". COLORS SRGP_loadCommonColor() is supported, but be aware that its use will link in a rather large data section into your program (~4KB). Loading a new color into an existing entry into color table with SRGP_loadColor() will not cause existing "instances" of the old color to be swapped with the new. Thus, color table "flicker/flash" effects and the link cannot be done using this technique. Conversely, only a very small color table is needed to support an arbitrary number of colors, and new colors can overwrite existing colors without effecting already-rendered pixels. ELLIPSES AND ARC All 360 degree of ellipses are always drawn. All "startangle" and "endangle" parameters are ignored. SRGP_setLineStyle() will have not effect on ellipses. Ellipse will always be drawn as if the line style were CONTINUOUS. KEYBOARD, POINTER, AND BEEP None of these interfaces are supported. SOFTWARE HIERARCHY ================== This program consists of the following files: "../srgp.c" - main source file "../../../BFinUtils/SDK-ezkitutilities.c" - EZ-Kit utilities source file for Blackfin processors "../../../BFinUtils/ADI_itu656.c" - EZ-Kit Video utilities source file for Blackfin processors "../../../Include/SDK-ezkitutilities.h" - EZ-Kit utilities include file for Blackfin processors "../../../Include/ADI_itu656.h" - EZ-Kit Video utilities include file for Blackfin processors "./srgp_bf533.dpj - project file that builds this application - defaults to debug "./srgp-BF533.ldf" - linker description file for an ADSP-BF561 single core application using "../../../Lib/adi_graph533d.dlb" - adi graph library (described below) debug version "../../../Lib/adi_graph_fonts.dlb" - fonts library (needed when using text) "../../../Lib/libsrgp533d.dlb" - SRGP library (described below) debug version Within this SRGP application, there are two more layers of software which comprise the SRGP and 'adi_graph'libraries. SRGP Library ============ Analog Devices ported the Simple Raster Graphic Package (SRGP) to the ADSP-BF5 dual core Blackfin DSP, and demonstrates it's use in this application. This application, and other applications that use the SRGP library, will link to the saved SRGP library, located in the "BlackfinSDK/Lib" folder. The source directory structure for the ADSP-BF533 SRGP library is found in the folder: "BlackfinSDK/Algorithms/SRGP/ADSP-BF533". The code has been modified, in some cases extensively, to use the 'adi_graph' library. These are key subdirectories for the 'SRGP' library: "../../../Algorithms/SRGP/include" - include files, specific to the SRGP library build. "../../../Include/SRGP" - global include fles. Any project using SRGP should add this path to the compiler search path (-I directories). "../../../Lib" - libsrgp.dlb or libsrgpd.dlb. The SRGP library. The "d" suffix indicates that this version was built using the VisualDSP++ 4.5 "Debug" configuration (no optimizations, include debugging information). One of these libraries (debug or release version) must be linked with the program, to produce the final exeutable(s) for the application. "../../../Algorithms/SRGP/src" - The include files specific to the SRGP library, only. ADI_GRAPH library ================= This application also uses the 'adi_graph' library. The saved 'adi_graph' library, that is linked into this application, is located in the "BlackfinSDK/Lib" folder. The project file that rebuilds the 'adi_graph' library is found in the folder: "BlackfinSDK/Algorithms/adi_graph/ADSP-BF533". The 'adi_graph' library is used for drawing graphic primitives such as lines and ellipses. The library is useful either SRGP, or independent of SRGP. While SRGP requires 'adi_graph', the reverse is not true, 'adi_graph' may be used without SRGP. SRGP can be considered a "shell" or "wrapper" around 'adi_graph'. SRGP itself has no primitive operations. The primitives are all defined in 'adi_graph.dlb'. These are key subdirectories for the 'adi_graph' library: "../../../Include/adi_graph" - global adi_graph include files. Any project that uses ADI_GRAPH or or uses SRGP should add this path to the compiler (-I directories). "../../../Algorithms/adi_graph/fonts" - Bitmap fonts in .BDF format. The font library 'adi_graph_fonts.dlb' can only be built by running the 'port_all.tcl' script in this directory. This script generates C source code for every .BDF file, compiles each C file, and then uses ELFAR to create the .dlb file. "../../../Lib" - 'adi_graph.dlb', 'di_graphd.dlb', and 'adi_graph_fonts.dlb'. The versions with the "d" suffix were built with VisualDSP in "Debug" configuration (no optimizations, includes debugging information). One of these libraries must be linked to the SRGP application. NOTE: The fonts library, 'adi_graph_fonts.dlb', is only required if your project displays text. "../../../Algorithms/adi_graph/src" - Source code for the 'adi_graph' library.