C/PEG™
Portable Embedded GUIC/PEG is a less capable version of PEG that is written in strict ANSI C. Its footprint is only about 60% that of PEG.
SummaryThe C/PEG software library is a completely portable, ROMable software library for generating graphical output on embedded systems. C/PEG is completely written using ANSI C, and does not require C++ compiler support. C/PEG is limited in scope when compared with
PEG, and is targeted for those applications and products which utilize a smaller LCD screen with limited color depth.
C/PEG TargetC/PEG is designed primarily for displays in the QVGA (320x240) pixel resolution range or smaller. There is no support with C/PEG for overlapped windows with the visible portion of the background continuously updating. C/PEG applications typically use a simple scheme: Each screen takes up the entire display. These are called panels rather than windows. They are neither moveable nor sizeable by the user, as windows are. Also, panels don't support non-client objects such as scroll bars and titles. These can be done in C/PEG, but they are client area objects and require some user code to implement properly. Multiple panels can be on the screen at one time, and, as long as they do not overlap, they both may draw. C/PEG does not have the complicated view port algorithms PEG has, which allow an object to draw only part of itself, depending on what is visible on the screen.
Because of the very small footprint (60K code space typical) for C/PEG, this library can be used on targets with very small ROM/FLASH resources, or even in DOS real-mode applications. The C/PEG library is also a good fit for 8-bit controllers and all 16-bit microcontrollers.
Feature Comparison to PEGBoth PEG and C/PEG implement the basic event-driven architecture and support mouse, keyboard, touchscreen, and soft-key input types. The PEG Development Toolkit (PDK) is fully compatible with both software libraries.
Both PEG and C/PEG include these and other gadget types:
- Windows (Panels)
- Text Controls (multi-line, transparent, etc)
- Various button types (radio, text, checkbook, bitmapped, decorated)
- Sliders and spin controls
- Scroll bars
- Complete set of application callable drawing primitives
- Icons
Many of the example programs provided with the library packages are very similar in appearance, and both libraries support all of the basic GUI control types needed to form the basis of a graphical interface.
Both include the WindowBuilder, FontCapture, and ImageConvert utilities. (See the PEG brochure for more about these.)
Many of the more advanced features of PEG can be implemented using C/PEG, but they are not built-into C/PEG as they are into PEG. The following is a brief list:
- Viewports and overlapped top-level windows.
- 65K colors and higher
- Automatic horizontal and vertical scrolling of client areas.
- ZIP and UNZIP run-time compression/decompression
- GIF, PNG, BMP, and JPG run-time image decoders.
- Charting widgets
- HMI widget set
- Docking MenuBar, ToolBar, Status bar.
- Spreadsheet control
- HTML table style control
- Run-time string resource installation (i.e. Loadable language modules).
The PRESS and PEGasis add-on software libraries are based on PEG, and require the PEG library.
SizeC/PEG is written with the embedded market firmly in mind, meaning that the value of every feature is weighed against the code size and performance requirements of that feature. A minimum C/PEG footprint requires roughly 40K of code space, 4K of stack space and 8K of dynamic memory. A typical full-featured GUI requires a C/PEG footprint of roughly 100K code, 4K stack and 16K dynamic memory.
RTOS SupportC/PEG is fully integrated with SMX® and other RTOSes. It can also be used standalone.
When used with an RTOS, it directly uses the underlying RTOS messaging, memory management and synchronization services. This yields the lowest possible overhead and the only true real-time multitasking GUI environment available. C/PEG input devices are interrupt driven, and again use RTOS services to communicate user input information to the graphical user interface.
C/PEG can also be configured to support multiple GUI tasks. These tasks can be of differing priorities and can each directly create, display and control any number of GUI windows or child controls. This advanced capability is unique to the design of C/PEG.
Compiler SupportThe C/PEG library has been fully verified with all of the most popular embedded compilers including Green Hills Multi, Metrowerks CodeWarrior, MetaWare, IAR, CAD-UI, ARM RealView, Borland, Microsoft, Hitachi, ST Microelectronics, Paradigm, Watcom, GCC, Tasking, TI Code Composer and Analog Devices Visual DSP.
Highly Portable
We made the C/PEG library highly portable by abstracting all hardware-dependent functionality. The vast majority of the library is completely hardware independent, relying on well-defined hardware interface functions to provide a consistent, simple, and reliable set of I/O functions. For new I/O devices and video controllers, we provide screen driver templates to help you create your own drivers. Video controller templates support both external and CPU-embedded controllers including those with hardware acceleration capabilities.
Input DevicesC/PEG can be configured to support any combination of mouse, keyboard, touch screen or membrane keypad input.
Video OutputC/PEG can be configured for monochrome, 4 greys, 16 greys, 16 colors, 256 colors, 256 greys, 65K colors and 24-bit RGB color depths. Any x, y display resolution may be used, including custom resolutions and profile orientation or rotation of the display device. Many CPUs include built-in video/LCD control, while external video/LCD controllers may also be used. Commonly used external controllers include:
- Advanced Micro Devices - Geode Processor
- ATI - Rage Mobility, Mobility Radeon
- Trimedia
- Permedia II
- Topro - TP6508 controller
- 3Dlabs
- Linux: Standalone - VGA, Linux Framebuffer Device
- Linux, Solaris, NetBSD, Lynx OS - X11 Windows
- Chips & Technology - CT545 Alpine, CT65550, CT 69000
- MediaQ - MQ200
- Epson - S1D13300, S1D13503, S1D13505, S1D13506, S1D13704, S1D13705, S1D13706, S1D13806, S1D13A04/S1D13A05
- Silicon Motion - Lynx 3DM, LynxEM+, SM501
Processor SupportC/PEG can be used with nearly any embedded CPU. A partial list of supported CPU types includes:
- All x86 designs including 8086, 80186, 80286, 80386, 80486, Pentium, Itanium, Athelon, Elan and other x86 derivatives.
- All 68K core designs including 68000, 68020, 68030, 68332
- FreeScale ColdFire, DragonBall, and i.MX1, i.MXL, i.MX21, PowerPC 823 and 860, and derivatives.
- Hitachi H8, SH
- MIPS R3000, R4000
- ARC cores
- All ARM cores including Sharp LH Series, Cirrus Logic Maverick series and Samsung. Includes ARM7, ARM9,Thumb Mode support and MMU enabled designs. Internal or external LCD controllers.
- Infineon C166, C167
- Intel PXA250, PXA255
- Analog Devices Blackfin
- Texas Instruments OMAP family
- Texas Instruments DM270 and DM320
C/PEG or PEG?Advanced and very professional graphical interface applications can be developed using either the C/PEG or PEG libraries. If your main concern is the smallest possible footprint, C/PEG may be the best choice. If you want a larger built-in feature set and the advantages of a C++ API, PEG may be the best choice.
For More Information