Freescale Semiconductor, Inc. PDA Personal Portable System Manager Programmer's Manual 3.1 PPSM Initialization and Applications Integration . . . . . . . . . . . . . . . . 3-1 PPSM Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Task Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 3.2 PPSM Application Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Freescale Semiconductor, Inc... Active Area Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Messages from PPSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.3 Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.4 Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Constants and Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Local Pointer Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Global Pointer Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Part II Writing PPSM Applications Chapter 4 4.1 Pen Input Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Active Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Icon Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 Input Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.2 Creating an Active Area. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.3 Removing an Active Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.4 Suspending an Active Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.5 Active Area Enquiry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.6 Put Active Area to Front of List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.7 Pen Echoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.8 Pen Color and Pen Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.9 Creating a Control Active Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.10 Removing a Control Active Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 4.11 Push Active Area List into Background . . . . . . . . . . . . . . . . . . . . . . . 4-6 4.12 Pop Active Area List to Foreground . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 Motorola Semicondu ii Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Document Number PPSM Version Release Date PDAPSM01U18-10 2.0 November 15, 1995 PDAPSM01U18-11 2.1 May 13, 1996 PDAPSM03SPM1-10 3.0 March 5, 1997 PDAPSM03SPM1-11 3.1 November 15, 1998 PDAPSM03SPM1-12 3.11 Apirl 20, 1999 Copyright 1995-1999 by Motorola, Inc. Freescale Semiconductor, Inc... Produced by DragonBall Operation, WSSG, Motorola PDA Personal Po Program TableComment of Contents Addendum to PPSM V2.0 Table of Contents . Preface . . . . . . . . . Part I PPSM Architecture Fax: (852) 2666-6551 Email: portable@email.sps.mot.com Website: http://www.apspg.com/products/ppsm/ppsm.html Chapter 1 Introduction . . . . . 1.1 What is PPSM? . . . . 1.2 Strengths and Feature 1.3 Software Developmen 1.4 Hardware Developmen Chapter 2 PPSM System Over 2.1 Interrupt Handling . . . 2.2 Error Handling . . . . . 2.3 I/O Devices . . . . . . . . Pen Input . . . . . . Screen Format . . Hardware Cursor 2.4 Data Storage . . . . . . 2.5 Font Management . . Motorola reserves the right to make any modifications or updates to this product2.6 or any component Memory Management thereof for any reason whatsoever without further notice to anyone. Motorola does not assume any 2.7 neither does Power liability arising out of the application or use of this product nor any component thereof; it Management . convey nor license under its patent rights or copyrights nor the patent rights or copyrights of othersDirect Control . . . all or any portion of this product. Motorola products are not designed, intended, or authorized for use Automatic Control as components in systems intended for surgical implant into the body, other applications intended to 2.8 product could Task Management . . support or sustain life, or for any other application in which the failure of the Motorola create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola PPSM Tasks . . . . products for such unintended or unauthorized application, Buyer shall indemnify and hold Motorola Application State T and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, anyTask Swapping . . claim of personal injury or death associated with such unintended or unauthorized such Management . 2.9use, even if Timer claims alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and are registered trademarks of Motorola, Inc. All Rights Reserved. Chapter 3 Table of Contents For More Information On This Product, Go to: www.freescale.com PPSM Programmin Freescale Semiconductor, Inc. PDA Personal Portable System Manager PDA Personal Po Program Programmer's Manual 11.2 Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .5. . . . . . . 11-2 Character Input Me 11.3 System Internal Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 . . . . . . . . 11-2 Soft Keyboard . . . . . . Initialization Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 Starting Soft Keybo System Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 Auto-Key-Repeat Wake-up Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 Terminating Soft K Application Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 Suspend Soft Keyb Handwriting Recognitio Normal Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 . . . . . . . . 11-4 Doze Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4 The Input Pad Mec Sleep Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5 Starting Handwritin Power Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 Terminating Handw 11.4 Freescale Semiconductor, Inc... 11.5 11.6 Setting Duty Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6 Using Graphics Too Setting Doze Period . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .6. . . . . . . 11-6 Setting Sleep Period . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 . . . . . . . . 11-6 Display Screen Forma Going Into Doze Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 LCD Display Scree Going Into Sleep Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 Panning Display S I/O Ports Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7 6.2 Screen Initialization . Disabling I/O Port Before Doze Mode . . . . . . . . . . . . . . . . . . . . 11-7 LCD Display Scree Enabling I/O Port After Doze Mode . . . . . . . . . . . . . . . . . . . . . . 11-7 Screen Resolution Disabling I/O Port Before Sleep Mode . . . . . . . . . . . . . . . . . . . . 11-7 Sample LCD Display S Enabling I/O Port After Sleep Mode . . . . . . . . . . . . . . 6.3 . . . . . . . . 11-8 6.4 1 bit-per-pixel Graphic Chapter 12 12-1 Drawing Operators Chapter 13 UART Communication Support . . . . . . . . . . . . . . . . . . . . . . 12-3 Drawing Operators 6.5 2 bits-per-pixel Graphi 13.1 UART Communication Architecture . . . . . . . . . . . . . . . . . 6.6 . . . . . . . . 12-3 Graphics Tools . . . . . 13.2 UART hardware flow control . . . . . . . . . . . . . . . . . . . . 6.7 . . . . . . . . 12-3 Get LCD Display Scree UART Interface Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4 Get LCD Display Scree UART Interface Interrupt Message . . . . . . . . . . . . . . . 6.8 . . . . . . . . 12-9 Get Panning Screen W UART Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.9 . . . . . . . . 12-9 Configuring the UART . . . . . . . . . . . . . . . . . . . . . . . . 6.10 . . . . . . . 12-10 Get Panning Screen H Inquiring the UART Configurations . . . . . . . . . . . . . . . . . . . . . . 12-11 6.11 Set Pattern Fill . . . . . Setting Data Transmission Time Out . . . . . . . . . . . . . . . . . . . . 12-11 Set Dot Width . . . . . . Setting Data Transmission Delay . . . . . . . . . . . . . . . . 6.12 . . . . . . . 12-11 13.3 13.4 Sending Data to the UART . . . . . . . . . . . . . . . . . . . . . . . . 6.13 . . . . . . . 12-12 DisplayMove . . . . . . . Initiating a Send Request . . . . . . . . . . . . . . . . . . . . . . 6.14 . . . . . . . 12-12 Direct All Graphics Ou Terminating a Send Request . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 6.15 Change Panning Scree Receiving Data from the UART . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 Fill the whole Panning Initiating a Receive Request . . . . . . . . . . . . . . . . . . . . 6.16 . . . . . . . 12-14 Reading Received Data . . . . . . . . . . . . . . . . . . . . . . . 6.17 . . . . . . . 12-14 Draw a Dot . . . . . . . . Terminating a Receive Request . . . . . . . . . . . . . . . . . . . . . . . . 12-14 Draw a Horizontal Line Setting Data Reception Time Out . . . . . . . . . . . . . . . . 6.18 . . . . . . . 12-15 6.19 Draw a Vertical Line . vi Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager PDA Personal Po Program Programmer's Manual 6.20 6.21 6.22 6.23 6.24 6.25 6.26 Freescale Semiconductor, Inc... 6.27 Draw a Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 Creating text templ Deleting text templ Draw a Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 8.4 Text Properties . . . . . Draw a Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25 Setting Text Displa Draw an Ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 Setting Text Outloo Draw an Arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 Setting Font Attribu 8.5 Text Mapping . . . . . . Draw a Vector from a List of Points . . . . . . . . . . . . . . . . . . . . . . . . . 6-30 Displaying text . . Put a Rectangular Area on Panning Screen . . . . . . . . . . . . . . . . . . 6-30 Removing text . . . Special cases of PutRec() . . . . . . . . . . . . . . . . . . . . . 8.6 . . . . . . . . 6-31 Text character cursor p 6.28 Save a Rectangular Area from Panning Screen . . . . . . . . . . . . . . . 6-33 Setting the charact Exchange a Rectangular area with memory . . . . . . . . . . . . . . . . . . 6-33 Reading the chara 6.29 Fill a Rectangular Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34 6.30 6.32 Inverse a Rectangular Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34 9.1 Reading System Date Hardware Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 9.2 Setting System Date a Set Hardware Cursor Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 Reading Clock Alarm Set Hardware Cursor Position . . . . . . . . . . . . . . . . . . 9.3 . . . . . . . . 6-36 Set Hardware Cursor Status . . . . . . . . . . . . . . . . . . . . 9.4 . . . . . . . . 6-36 Setting Clock Alarm . Get Hardware Cursor Status . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36 Clearing Clock Alarm Set Hardware Cursor Blinking Frequency . . . . . . . . . 9.5 . . . . . . . . 6-37 Turn Hardware Cursor Off . . . . . . . . . . . . . . . . . . . . . 9.6 . . . . . . . . 6-37 Setting Periodic Alarm Display Other Region of Panning Screen . . . . . . . . . . . . . 9.7 . . . . . . . . 6-37 Setting Timeout . . . . 6.33 Get LCD Display Origin on Panning Screen . . . . . . . . . . 9.8 . . . . . . . . 6-37 Setting Input Timeout 6.34 Allocate memory for Panning Screen . . . . . . . . . . . . . . . . 9.9 . . . . . . . . 6-38 Continuous Reference 6.31 Chapter 7 7.1 7.2 7.3 7.4 7.5 Chapter 9 9.10 9.11 Set Reference Timer A Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 9.12 Compute Reference T Formatted Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 Unformatted Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Memory Manageme The Database Manipulation Tools . . . . . . . . . . .Chapter . . . . . . . .10 . . . . . . . . 7-2 Allocating Memory . . Creating and Editing a Database . . . . . . . . . . . . . . . . . . . 10.1 . . . . . . . . . 7-3 Freeing Memory . . . . Searching and Retrieving Data . . . . . . . . . . . . . . . . . . . . 10.2 . . . . . . . . . 7-4 Reallocating Memory Navigating along a Record List . . . . . . . . . . . . . . . . . . . . 10.3 . . . . . . . . . 7-4 Copying Memory . . . Text Display Management . . . . . . . . . . . . . . . . . . . 10.5 . . . . . . . . 8-1 Inquiring Memory . . . 8.1 Text Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 8.2 Power Managemen Text Display Area . . . . . . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .11 . . . . . . . . 8-1 Power Control Module Text Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 . . . . . . . . . 8-2 8.3 iv Read The Reference T Database Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 10.4 Chapter 8 Timer Management Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager Programmer's Manual 21.3 ClearRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13.5 . . . . . . . . 20-4 UART hardware flow c 21.4 ClearScreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-5 Enabling RTS/CTS Disabling RTS/CTS CursorGetOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-5 13.6 Data reception with ha CursorGetPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-6 Pause data recepti 21.5 21.6 21.8 CursorGetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-7 Continue data rece Data transmission with CursorInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.7 . . . . . . . . 20-7 21.9 CursorOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-8 21.10 CursorSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-8 21.11 Task Management CursorSetBlink . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .14 . . . . . . . 20-9 21.12 21.15 Main Task . . . . . . . . . CursorSetOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.1 . . . . . . . 20-10 System Task . . . . CursorSetPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-10 14.2 Sub-task . . . . . . . . . . CursorSetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-11 Sub-task Managem DisplayMove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.3 . . . . . . . 20-12 Task Switching . . . . . 21.16 DrawArc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.4 . . . . . . . 20-13 Message Broadcasting 21.17 DrawCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.5 . . . . . . . 20-13 Task Control . . . . . . . DrawDot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.6 . . . . . . . 20-14 Task Swapping Examp Freescale Semiconductor, Inc... 21.7 21.13 21.14 21.18 21.19 21.20 21.21 Pause data transm Continue data tran DrawEllipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.7 . . . . . . . 20-15 Creating a Task . . . . DrawHorz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.8 . . . . . . . 20-16 Creating a Task with S 21.22 DrawLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.9 . . . . . . . 20-17 Creating a Sub Task . DrawRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.10 . . . . . . . 20-18 Starting a Task . . . . . 21.23 DrawVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.11 . . . . . . . 20-19 Termination of a Task 21.24 DrawVert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.12 . . . . . . . 20-20 Task Reinitialization . ExchangeRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.13 . . . . . . . 20-21 Task Hook . . . . . . . . 21.25 21.26 21.27 GetDisplayX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.14 . . . . . . . 20-22 Stop task swapping . GetDisplayY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-23 21.28 Inter-Task Messagi GetLogicalX . . . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .15 . . . . . . 20-23 21.29 Message Passing . . . GetLogicalY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.1 . . . . . . . 20-24 GetScreenMem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-24 With Delayed Task With Immediate Ta InvRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-25 With Immediate Ta LCDContrast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-26 Message Passing w 21.30 21.31 21.32 21.33 21.34 x PDA Personal Po Program 15.2 Message Structure . . LCDRefreshRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-27 15.3 Sending Message . . . LCDScreenMove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-27 15.4 Advanced Sending Me Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager PDA Personal Po Program Programmer's Manual 15.5 Deleting Message for Current Task . . . . . . . . . . . . . . . . . 19.2 . . . . . . . . 14-4 ActiveAreaEnable . . . 15.6 Deleting Message for any Task . . . . . . . . . . . . . . . . . . . . 19.3 . . . . . . . . 14-4 ActiveAreaRead . . . . 15.7 Receiving Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.4 . . . . . . . . 14-4 ActiveAreaSuspend . 19.5 Chapter 16 Freescale Semiconductor, Inc... 16.1 16.2 16.3 ActiveAreaToFront . . Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1 19.6 ActiveListPop . . . . . . System Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1 19.7 ActiveListPush . . . . . IRPT_AUDIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2 AreaEchoDisable . . . IRPT_PEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.8 . . . . . . . . 15-2 IRPT_INPUT_STATUS . . . . . . . . . . . . . . . . . . . . . . . 19.9 . . . . . . . . 15-2 AreaEchoEnable . . . . IRPT_ICON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-3 19.10 ActiveAreaPosition . . IRPT_KEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4 IRPT_RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.11 . . . . . . . . 15-5 CtrlIconDisable . . . . . IRPT_TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5 19.12 CtrlIconEnable . . . . . IRPT_HWR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-5 IconScanOff . . . . . . . IRPT_UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.13 . . . . . . . . 15-5 Device Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.14 . . . . . . . . 15-5 IconScanOn . . . . . . . User Defined Interrupt Handlers . . . . . . . . . . . . . . . . . 19.15 . . . . . . . . 15-6 PenCalibration . . . . . Device Interrupt Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7 PenEchoParam . . . . Application Access to Handlers . . . . . . . . . . . . . . . . . 19.16 . . . . . . . . 15-7 Request and Release Interrupt Handler Service . . . . 19.17 . . . . . . . . 15-7 PenGetInput . . . . . . . Message Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.18 . . . . . . . . 15-8 PenSetInputMax . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-9 19.19 PenSetInputOrg . . . . Chapter 17 17.1 PenSetRate . . . . . . . Using System Tools . . . . . . . . . . . . . . . . . . . . . . . . 19.20 . . . . . . . 16-1 ScanningOff . . . . . . . PPSM Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.21 . . . . . . . . 16-1 Motorola Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.22 . . . . . . . . 16-2 ScanningOn . . . . . . . Chapter 18 18.1 18.2 18.3 18.4 Part III API Toolset Chapter 19 19.1 viii Audio Tools . . . . . . . . . . . . . . . . . . . . . . . . Chapter . . . . . . . .20 . . . . 17-151 Character Input Too Audio Playing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.1 . . . . . . 17-151 AdvOpenInputPad . . Tone playing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.2 . . . . . . 17-151 AdvOpenSoftKey . . . Wave playing (DragonBall-EZ only) . . . . . . . . . . . . . . . . . 20.3 . . . . . . 17-152 CloseInputPad . . . . . Stop the audio playing . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.4 . . . . . . 17-153 CloseSoftKey . . . . . . 20.5 OpenInputPad . . . . . 20.6 OpenSoftKey . . . . . . Chapter 21 21.1 Graphics Tools . . . ChangePanning . . . . Pen Input Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1 21.2 ChangeWindow . . . . ActiveAreaDisable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-1 Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager PDA Personal Po Program Programmer's Manual 28.4 TaskCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21.35 . . . . . . . . 27-4 PutChar . . . . . . . . . . 28.5 TaskHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21.36 . . . . . . . . 27-5 PutRec . . . . . . . . . . . 28.6 TaskReInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21.37 . . . . . . . . 27-5 SaveRec . . . . . . . . . . 28.7 TaskStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21.38 . . . . . . . . 27-6 SetDotWidth . . . . . . . 28.8 TaskTerminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21.39 . . . . . . . . 27-7 SetPatternFill . . . . . . Freescale Semiconductor, Inc... Chapter 29 Inter-Task Messaging Tools . . . . . . . . . . . Chapter . . . . . . . .22 . . . . . . 28-1 Database Managem 29.1 AdvMessageDelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.1 . . . . . . . . 28-1 DBAdd . . . . . . . . . . . 29.2 AdvSendMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2 . . . . . . . . 28-1 DBAddRecord . . . . . . 29.3 MessageDelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.3 . . . . . . . . 28-3 DBAddRecToTop . . . 29.4 SendMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.4 . . . . . . . . 28-3 DBAppendRecord . . . 22.5 Chapter 30 30.1 30.2 30.3 30.4 Chapter 31 31.1 31.2 Chapter 32 22.6 DBChangeUnfData . . IrptGetData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29-1 22.7 DBDelete . . . . . . . . . IrptRelease . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29-3 22.8 DBDeleteRecord . . . . IrptRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29-4 22.9 DBGetFirstRecID . . . IrptSendData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29-6 22.10 DBGetNextRecID . . . DBGetPrevRecID . . . System Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.11 . . . . . . . 30-1 22.12 DBReadData . . . . . . PPSMInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30-1 22.13 DBReadTotalNumber ReadSMVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30-3 22.14 DBReadTotalNumberR Audio Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.15 . . . . . . . 31-1 DBReadUnfData . . . . 32.1 AdvAudioPlayWave (DragonBall-EZ only) . . . . . . . . . . . . 22.16 . . . . . . . . 31-1 DBRecordSecret . . . . 32.2 AudioInUse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.17 . . . . . . . . 31-2 DBSearchData . . . . . 32.3 AudioPlayTone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.18 . . . . . . . . 31-2 DBSecretFlag . . . . . . 32.4 AudioPlayWave (DragonBall-EZ only) . . . . . . . . . . . . . . . 22.19 . . . . . . . . 31-3 DBSetRecordSecretFl 32.5 AudioStopTone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.20 . . . . . . . . 31-4 DBSetSecretFlag . . . 32.6 AudioStopWave (DragonBall-EZ only) . . . . . . . . . . . . . . . . . . . . . . . 31-4 Chapter 23 Part IV System Integrator's xiv DBChangeStdData . . Interrupt Handling Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 29-1 Text Tools . . . . . . . 23.1 TextCreate . . . . . . . . 23.2 TextDelete . . . . . . . . 23.3 TextMap . . . . . . . . . . 23.4 TextReadCursor . . . . Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager PDA Personal Po Program Programmer's Manual 23.5 TextSetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.2 . . . . . . . . 22-3 Lfree . . . . . . . . . . . . . 23.6 TextSetDisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.3 . . . . . . . . 22-4 Lmalloc . . . . . . . . . . . 23.7 TextSetFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.4 . . . . . . . . 22-5 Lrealloc . . . . . . . . . . . 23.8 TextSetOutlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.5 . . . . . . . . 22-6 MoveBlock . . . . . . . . 23.9 TextSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.6 . . . . . . . . 22-7 TaskMemUsed . . . . . 23.10 TextUnmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.7 . . . . . . . . 22-9 TaskStackAvail . . . . . 25.8 Freescale Semiconductor, Inc... Chapter 24 Timer Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-1 24.1 25.9 TotalMemUsed . . . . . AlarmClear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-1 24.2 Power Managemen AlarmClearId . . . . . . . . . . . . . . . . . . . . . . . . . . .Chapter . . . . . . . .26 . . . . . . . 23-1 24.3 SetDozeMode . . . . . . AlarmRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.1 . . . . . . . . 23-2 24.4 SetDozePeriod . . . . . AlarmReadId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.2 . . . . . . . . 23-2 24.5 SetDutyCycle . . . . . . AlarmSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.3 . . . . . . . . 23-3 24.6 SetSleepMode . . . . . AlarmSetId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.4 . . . . . . . . 23-4 24.7 SetSleepPeriod . . . . . DateTimeRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.5 . . . . . . . . 23-5 24.8 DateTimeSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-6 24.9 24.20 DeleteTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-7 27.1 UARTConfigure . . . . InputTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-7 27.2 UARTFlowCtrl . . . . . . RefFineTimeAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-8 27.3 UARTInquire . . . . . . . RefFineTimeAlarmId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-8 27.4 UARTRcvCtrl . . . . . . RefFineTimeDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-9 27.5 UARTReadData . . . . RefFineTimeRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-10 27.6 UARTReceive . . . . . . RefTimeAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-10 27.7 UARTSend . . . . . . . . RefTimeAlarmId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-11 27.8 UARTSendAbort . . . . RefTimeDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-11 27.9 UARTSendCtrl . . . . . RefTimeRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-12 27.10 UARTSetDelay . . . . . SetPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-12 27.11 UARTTimeout . . . . . . SetPeriodId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-13 24.21 Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-14 24.22 TimeoutId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-15 28.1 AdvTaskCreate . . . . . 24.10 24.11 24.12 24.13 24.14 24.15 24.16 24.17 24.18 24.19 Chapter 25 25.1 xii TotalMemSize . . . . . . Chapter 27 Chapter 28 28.2 UART Communicat Task Handling Tool AppSwap . . . . . . . . . Memory Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . 24-1 28.3 SubTaskCreate . . . . . Lcalloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24-1 Table of Contents Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager PDA Personal Po Program Programmer's Manual Guide Chapter 33 33.1 How to make ROM? Boot Strap Code (boot 68K Start-up . . . . Chip Selects . . . . Peripheral Devices 33.2 Linker Supplications F 33.3 Generating S-Record F Freescale Semiconductor, Inc... Loader Options . . Loader Commands Chapter 34 34.1 Device Drivers . . . System Configuration Boot Strap Driver ( User Interrupt Han 34.2 Pen Input Device Drive Pen Initialization . Pen Interrupt Enab Pen Interrupt Disab Pen Read Device 34.3 Pen Calibration(PenIni 34.4 LCD Device Drivers (lc 1 bit/pixel Initializat 2 bits/pixel Initializa 34.5 Handwriting Recognitio Handwriting Recog Handwriting Recog Process One Strok Initiate Character R 34.6 Font Driver (font.c) . . Font Library Inform Font Library or Fon Font Accessing . . 34.7 UART Device Driver (u Sending the BREA 34.8 Power Management D Enabling I/O ports Disabling I/O ports Enabling I/O ports xviii Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. PDA Personal Portable System Manager Personal Porta Program Programmer's Manual Preface Disabling I/O ports when going to sleep mode . . . . . . . . . . . . . 33-16 Chapter 35 35.1 .SPC File for a RAM-only System . . . . . . . . . . . . . . . . . . . . . . . . . . 34-1 35.2 .SPC File for a ROM-RAM System . . . . . . . . . . . . . . . . . . . . . . . . . 34-2 designed specifically for 35.3 operating system enable For SingleStep Debugging System (SDS) user . . . . . . . . . . . . . . . . 34-2 Chapter 36 Freescale Semiconductor, Inc... Linker Specification File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34-1 What is PPSM? Personal Portable System such as advanced pager instruments, organizers, Trap Usage in PPSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Audience & Purpose The first three parts of th 36.1 PPSM Tools Calling Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ing 5 to learn the important 36.2 on a specific aspec TRAP Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . trates 5 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The 6 forth part of this man Stub Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . for 6 building and configuri TRAP Service Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Appendices Part I "PPSM Architecture" des Part II "Writing PPSM Applicatio application development. This part is targeted part tools. Therefore, the tool tools for writing PPSM ap A-1 A Error Code Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B List of References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1 larly to those experience C Part III "API Toolset" details the ming methodology. There alphabetical order for qui Index of PPSM Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1 xvi Part IV "System Integrator's Gui and configure PPSM sys Appendices At the end of the manual, information. Table of Contents For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Application PPSM Tools PPSM kernel Pen Input Driver LCD Driver PC Card Driver LCD PC Card Software Freescale Semiconductor, Inc... Hardware Pen Input Part I PPSM Architec IrDA Driver FLEXstackTM Driver IrDA FLEXTM DragonBallTM based Portable System Figure 1-1 Architecture of PPSM on the MC68328 Platform 1.2 Strengths and Features PPSM is modularly designed to speed the application development cycle time by shielding the developer from the intricacies of the DragonBallTM hardware and providing a good toolset for the application software developer to concentrate on their specific product design. Perfect for handheld devices, PPSM is a resource effective system which requires very small memory space and is pen-centric. Strengths: * * * * * * * SPEEDS up application development cycle time COMPACT ROM size perfect for handheld devices MODULAR Software Architecture PEN-CENTRIC Third party applications successfully ported on PPSM such as MULTILINGUAL HANDWRITING RECOGNITION, SCALABLE and BITMAP FONTS, Infrared and Email COMMUNICATION. Application code is completely DEVICE INDEPENDENT Microsoft Windows based ANSI C development tools for RAPID application development Features: * * * * * Pen / touch panel input support 32-bit Real Time Operating System Real Time Interrupt Handling Power Management 16-bit text data representation for multilingual support 1-2 Introduction For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 1 1.1 Introduction What is PPSM? Freescale Semiconductor, Inc... Personal Portable System designed specifically for operating system enable such as advanced pager instruments, organizers, PPSM is a real time 32-b interrupt-driven, e.g. app icons. Because PPSM is configurable, and easy to development process. The PPSM Tools consist System and Communica a sophisticated User-Inte API for LCD based produ provides the basic contro and the UART. The PPSM kernel does n devices are controlled by supplying the appropriate integrators greater flexibi changing the core of the the DragonBallTM family Introduction For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 2.2 Error Handling Unless otherwise specified, all PPSM tools return PPSM_OK upon successful completion. A value other than PPSM_OK is the error code, indicating an error has occurred. 1.3 Freescale Semiconductor, Inc... High Level API T Multiple grey lev LCD hardware c Software Develo Each error code uniquely defines the cause and nature of the error. 2.3 * * * ANSI C is the main progr Refer to Appendix A - Error Code Definition for a complete error code listing. implementation of low lev and hardware device driv PC running under Windo I/O Devices Debugger, from Software level and instruction deb This section describes the LCD display screen and the touch sensitive panel. simulator running on the Figure 2-2 shows the screen format for the PPSM system. There are three major areas: 1.4 Hardware * * * Pen Input Area Display Screen Panning Screen The M68328 and M68EZ the reference developme used is a 10-bit compone direction. (xInputOrigin, yInputOrigin) (-59,-29) (379,-29) For details on the hardwa Manual V2.0 and M68EZ - ve LCD Origin - ve + ve (319,0) (0,0) LCD Panel (319,239) (0,239) + ve Touch Panel (xLCDMax, yLCDMax) (-59,259) (379,259) (xInputMax, yInputMax) Figure 2-2 An example of PPSM coordinate system 2-2 Develo PPSM System Overview Introduction For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 2 2.1 PPSM System Interrupt Handlin An application will always either be the active task, interrupt. An application i conditions: Freescale Semiconductor, Inc... * * * * * Interrupt from pe Interrupt from a c Interrupt from po Interrupt from tim Interrupt from me Swap Message Handler Message Passing Applic Execu Device Interrupt Communication Handler Swap Fi 1-4 PPSM System Overview Introduction For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual choose to control the system's power management features directly, or use the 2.3.1 Pen PPSM's automatic power management features. Input 2.3.1.1 Pen Input Are 2.7.1 2.7.2 Direct Control This is the touch sensitiv touch panel is the same A set of tools provide the applications the ability to directly control the following (0,0) or the origin, is at th during Normal mode: see from Figure 2-3, the * switch into any of the power saving modes have a negative value. P allows applications to imp * the duty cycle of the processor for each application writing area. Automatic Control Freescale Semiconductor, Inc... A set of tools are available for the caller to set the parameters for automatic power management features provided by PPSM: * * 2.8 Negative Co to switch automatically to a lower power saving mode when system is idle to control user defined I/O ports during transitions of the power saving modes O Task Management Each application running on PPSM is considered as a task. Only one of these tasks can be actively running at anytime. 2.8.1 PPSM Tasks There are two types of PPSM tasks: application task that are stand alone (main task) and tasks that are spawned off by another task (sub-task). 2.8.1.1 Main Task Figu Most applications fall into the main task category. Main tasks run independently of each other. There cannot be more than 1 main task running at anytime. They are created by the system tool TaskCreate() or AdvTaskCreate(). Once a main task is LCD display screen If the created, it can be started in one of the following ways: coordinates from the pen * * * By using the system tool TaskStart() By pressing the application icon By messages sent by another task 2.8.1.2 Sub-task 2.3.1.2 Active area An active area is defined application or an action w an icon, or an action butt Sub-task, on the other hand, can be active at the same time as the parent taskActive areas are classifie that generated the sub-task. Message passing is possible between the sub-task to Section 4.1 - Active Ar and its parent. Sub-task uses the display resource of its parent and can only be started with the system tool SubTaskCreate(). Sub-tasks are tied to the parent task. If the parent task is swapped out or 2-6 PPSM System Overview PPSM System Overview For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 2.3.2 Screen Format 2.5 Font Managemen PPSM supports 8x10 Eng Chinese bitmap fonts, an The display screen is the LCD display area where applications can display are included in PPSM. Th images. The LCD module can handle both 1 bit per pixel and 2 bits per pixel System integrators need graphics, giving black and white display or 4 grey levels display respectively. these fonts. Display data, such as graphics and text, can only be seen within the display The font bitmap lookup o screen area. 33.6 - Font Driver (font.c) access to these fonts for 2.3.2.2 Panning Screen 2.3.2.1 LCD Display Screen Freescale Semiconductor, Inc... The Panning Screen is an extension to the LCD Display Screen. Its main purpose is to allow applications to write data to an area outside of the actual display area. 2.6 Memory Manage Although applications can write to this area, data will not be displayed on the screen unless this area is being mapped to the LCD Display Screen. Pen Input PPSM provides a set of m areas on the panning screen will receive pen input data only when they overlap memory space. A heap is with the LCD display screen. allocate memory from the provided by the compiler 2.3.3 Hardware Cursor Four memory manageme The maximum hardware cursor size is 31 pixels wide by 31 pixels high. During * task swapping, the hardware cursor status, size, position and the offset of display * origin on panning screen in current task will be saved and the new task's cursor * status, position, size and the offset of display origin on panning screen will be * used. 2.4 Data Storage Lcalloc() Lmalloc () Lrealloc() Lfree() m m PPSM also provides a se time memory size. Three memory inquiry to Databases are the main means of data storage in PPSM. A set of database tools * TaskMemUsed() is available in PPSM to support data storage and manipulation. * TotalMemUsed() PPSM database are in global database which can be shared among different tasks. * * TotalMemSize() TaskStackAvail() When a database is created, PPSM will pass back a unique database identifier to The size of the largest ch the application. Application will need to use this identifier as the key for be known by calling Lma subsequent access to that particular database. A PPSM database does not have any limit in number of database nor record in database except the memory The size of the heap mem limitation in creating these database and record. available in the hardware The PPSM database tools provides basic operations such as add, delete, modify ROM? on how memory s and search for particular data. Additional tools are provided to help manipulate the record list. In particular, the tool DBGetFirstRecID(), DBGetNextRecID(), and For SingleStep Debuggin DBGetPrevRecID() are meant to facilitate the implementation of more further description in how sophisticated searching algorithm. The description, calling convention, and example usage of each database tool will appear in Chapter 7 - Database Management and Chapter 21 - Database Management Tools 2.7 Power Managem PPSM utilizes the power power management tools 2-4 PPSM System Overview PPSM System Overview For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual terminated, the sub-task handler assignment. It must be called before any other PPSM tool. As an option, it can also perform the pen to screen calibration. This should only be done oncethe at input pad and pannin system start-up. 2.8.2 3.1.2 Application State Tr Task Registration An application is treated as a task in PPSM. After PPSM is initialized, each application task on the system must be registered with PPSM before the application can make use of the PPSM tools. Application tasks have th application. Freescale Semiconductor, Inc... When integrating the individual applications onto the system, the system integrator must first call one of the task creation tools for each application. There are two types of tasks, main task or sub task (refer to Section 13.1 - Main Task and Section 13.2 - Sub-task). This registration of tasks ensures that the run time memory and stack required for each application are allocated within PPSM's memory system. * * * Associated with each main application task is an optional application launch icon. This launch icon's position on the touch panel can be specified in the task creation tool. The application is put to the foreground whenever this application icon is selected by the pen input device. When writing an application task, the developer can treat each task as a stand alone procedure as PPSM resources are individually allocated. This implementation of tasks allow a number of applications to be written independently and linked together at the end to form a single system. For details of the task creation tools, please refer to Section 13.7 - Creating a Task, Section 13.8 - Creating a Task with Specific Task Parameters and Section 13.9 - Creating a Sub Task. Active Suspended Stopped Interrupt Active Figur After all applications have been registered, the first application task can be started 2.8.2.1 Active State by calling the tool TaskStart(). This tool never returns and other applications within the system will be started when the corresponding application launch icon is This is the state when an hardware resources are pressed. 2.8.2.2 Suspended St 3.2 PPSM Application Programming An application task is put active state execu This section describes the general flow for most applications operating under during the mode, will become the ac PPSM environment. The typical flow for most PPSM applications is shown in the registers that are use Figure 3-2. After the application initializes itself and registers icons and draw areas with PPSM, it would continuously call IrptGetData() to check for incoming The suspended task will events. When an event occurs, the application would process the event and then otherwise it will be put in loop back to IrptGetData() to wait for more events. 2.8.2.3 Stopped State An application changes f application is selected. In bitmap image are stored A task will exit from the s 3-2 PPSM System Overview PPSM Programming For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 3 PPSM Progra selected. It will continue execution from the point when it was put into stopped state. 2.8.3 Task Swapping Freescale Semiconductor, Inc... PPSM programming mai Task swapping is performed by PPSM transparent to the application programmer. A task swapping is executed when an application, other than the actively running * PPSM initializatio application, needs to become active. This normally occurs when PPSM kernel * Individual PPSM receives an interrupt, such as timer or user pen-down. 2.9 For example, when an application icon for a new application is pressed, 3.1 the task PPSM Initializatio that is actively running will be put into stopped state and the new task will become active. A PPSM system must firs be assigned and used. S individual PPSM applicat Timer Management PPSM organizer may con scheduler and calculator. PPSM maintains a reprogrammable clock that is defaulted to 9:00am 1st of January, 1997 upon start up. This clock is incremented in 1 second interval and Figure 3-1 shows a typic never stops. initialized, then applicatio with PPSM individually. T A set of timer tools are available for time management. This allows the application which is chos programmer to set system clock, clock alarm, time-out, and input time-out in their application. Figure 3 3.1.1 PPSM Initialization The PPSMInit() tool perfo 2-8 PPSM System Overview PPSM Programming For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual * * OK UNKNOWN Re 3.4.3 Local Variables All local variables start with lower case, with capitalised words in the variable names. There are no underscores between words. ap Example 3-3 Local variable names Freescale Semiconductor, Inc... * * * * * xPos yPos dataLen temp rate C NO 3.4.4 Global Variables Same as local variables, except that all global variable names starts with a lower case "g". Example 3-4 Global variable names * * * 3.4.5 gCurrentTask gIrptMask gSystemClock Local Pointer Variables All local pointer variables start with a lower case "p", with capitalised words in the variable names. There are no underscores between words. Example 3-5 Local pointer variable names * * * * 3.4.6 pSourceAddr pDestAddr pTaskTable pReturnSize Global Pointer Variables Same as local pointer variables, except that all global variable names starts with a lower case "gp" Fig Example 3-6 Global pointer variable names * * * gpSysList gpPhoneBook gpSrcMem 3.2.1 Active Area Registr PPSM is designed as a p 3-6 PPSM Programming PPSM Programming For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Table 3 regions defined in PPSM as active areas. Active area provides an easy method for applications to receive pen input samples from the input panel without the need to monitor the hardware constantly. PPSM uses interrupt to perform pen sampling, maximizing processor power utilization. Data Type S8 An active area is defined as a rectangular region of the input panel where interrupt messages are generated to the application when the region is pressed. Active areas only generate messages to the application that created the area. An example of an active area is an icon, an action button, scratch pad or drawing area. P_S8 U16 P_U16 S16 Freescale Semiconductor, Inc... When application needs to perform pen input, it must define the area location and register each active area with PPSM before the area can respond to a pen input. All remaining areas on the input panel not registered with PPSM will not generate any information to the application. For details on active areas and input methods, please refer to Chapter 4 - Pen Input Handling and Chapter 5 - Character Input Methods. 3.2.2 P_S16 U32 P_U32 S32 P_S32 Messages from PPSM STATUS 3.3 PPSM application should take a pro-active role, i.e., an event driven approach. TEXT When external events occur, such as pressing of the input panel, PPSM system P_TEXT automatically intercepts and interprets the event. If the events require attention from the application, such as an active area being pressed, or incoming data from P_VOID UART, PPSM will package the data in the pre-defined message format and send to the waiting application's interrupt buffer (please refer to Chapter 15 - Interrupt Handling). However, if the event is not intended for the application, such as 3.4 Naming Convent pressing of input panel that is not defined as active area, or timeout for going into power saving mode, the event is handled by PPSM internally without any For consistency, a set of message sent to the application. software development. T Upon receiving soft interrupt messages sent from PPSM, application tasks should act upon the nature of the message. There are a set of pre-defined messages 3.4.1 Procedure Interrupts and types for different types of interrupts (refer to Section 15.1 - System Section 15.2 - Device Interrupts ). All procedure names are the name will be in upper Application tasks can receive the soft interrupt messages by using the system tool IrptGetData(). The application task should call this tool periodically in the Example 3-1 Procedu program's flow to check for any incoming events (refer to Section 29.1 IrptGetData). * PenInit() * PagerCheck() * DrawDot() Data Representation PPSM is a 32-bit system. Table 3-1 shows the data types used in3.4.2 PPSM Table 3-1 Data type definition used in PPSM 3-4 Constants and Lab All constants and labels a Data Type Description Size (in bytes) U8 unsigned byte 1 P_U8 unsigned byte pointer 4 Example 3-2 Constan * * PPSM Programming PPSM Programming For More Information On This Product, Go to: www.freescale.com DISPLAY_MODE DEFAULT_MOD Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Part II Writing PPSM Applica Upon release, either by pen-up or drag out of the area into another part of the touch panel, another soft interrupt is sent to the application to notify the user of the event. This type of area is designed for buttons and selection icons. 4.1.2 Input Area Input area is an area where writing or drawing is performed. Once defined, PPSM will monitor the area with the given pen input characteristics such as sampling rate, pen echoing and pen position sampling. Pen echoing is programmable. Three modes of operation are available for this type of area, STROKE, CONFINED or CONTINUOUS. Freescale Semiconductor, Inc... 4.1.2.1 Stroke Mode Drawing on STROKE type of input area will produce a list of the x and y coordinate integers to the application at the end of the drawing input sequence, usually with a pen-up. This list consists of all points of that single stroke from the pen-input device. When the pen leaves the active area, or pen-up is detected, then the stroke data ends. 4.1.2.2 Confined Mode CONFINED mode is very much like STROKE mode excepts that when the pen input moves out of the defined active area, the coordinates for those points outside the region are truncated to the value defined by the boundary of the active area. This means a stroke will not be broken until pen-up is detected. 4.1.2.3 Continuous Mode Drawing on CONTINUOUS type of input area will continuously produce individual x and y coordinates to the application as the pen moves across the pen input panel. With this type of input, soft interrupt is generated for each individual point. The last input point will be a set of (-1, -1) for pen-up. Developers using this type of area must ensure the soft interrupts are acknowledged as their number can be very significant. 4.2 Creating an Active Area. STATUS ActiveAreaEnable(P _U32 areaId, U32 type, U32 mode, S16 xSrc, S16 ySrc, S16 xDest, S16 yDest) This tool creates a new active area for reading pen input. It returns an identifier of the new area to the caller. Once created, the new active area identifier will be returned to the application. The argument type is used to specify whether an icon area or an input area is required. Mode specifies the input mode for input area. Example 4-1 Create an active area 49 U32 nextWinId;/* NextWin's id */ . 4-2 Pen Input Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 4 Pen Input Ha The Pen Input Tools ena * * define active are control ink echoi Refer to Section 6.2.2 - S Freescale Semiconductor, Inc... 4.1 Active Area Active area provides an e samples from the touch p constantly. PPSM uses in utilization. An active area is defined interrupt messages are g An example of this is an Active areas are only "ac the corresponding pen up "B", and one of its sub-ta "C" and "D". When a use active areas "A" and "B", moves across them. By t "D" will receive message If active areas are overla receive pen messages. There are two types of ac have three different mod Type ICON_AREA N/A INPUT_AREA STRO CONT CONF 4.1.1 Icon Area Icon area is for the purpo either from a pen-down o generates a soft interrup Pen Input Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 114 115 116 4.10 if ( CtrlIconEnable(&abortRcv, BUTTON_X+20, BUTTON_Y+30, PPSM_ICON_16_DONE) . != PPSM_OK ) . return (PPSM_ERROR); 104 /* Create an active 105 * as specified belo 106 */ 107 108 if (ActiveAreaEnable 109 NE 110 != PPSM_OK) STATUS CtrlIconDisable(U32 iconId) 111 return PPSM_ERROR; 112 Removing a Control Active Area Remove the control icon from PPSM. This will remove the icon and the icon will no longer generate icon interrupt to the application. 4.3 Freescale Semiconductor, Inc... 4.11 Removing an Ac STATUS ActiveArea Push Active Area List into Background Removes a valid active a tool must be a valid activ ActiveAreaEnable tool. T PPSM maintains a stack for storing active area lists. When this tool is called, all the active areas that have been created so far will be pushed into background,area. STATUS ActiveListPush(void) and a new list begins. A new list has no element by default. Subsequent active Once removed, the regio area created will belong to the new active list. identifier will no longer re This tool allow applications to create a temporary active area list, and return to the Example 4-2 Remove original active areas when the temporary list is no longer required. 74 Example 4-7 Push active area list into background /* Push all existing active areas to background */ If (rv = ActiveListPush()) { /* error */ return (rv); } /* create new set of active areas */ GenerateNew(); 262 263 4.4 4.12 Pop Active Area List to Foreground STATUS ActiveListPop(void) backId; if ( Acti return (P Suspending an A STATUS ActiveArea /* Call subroutine */ ScratchPad(); /* restore original active areas */ if (rv = ActiveListPop()) { /* error */ return (rv); } U32 . . . Activate or deactivate a v it can be suspended from To suspend, call this tool active area no longer sen writing in the region. To re-enable the active a Example 4-3 Suspen PPSM maintains a stack for storing active area lists. When this tool is called, the least recently pushed in active area list becomes the current active area list. This tool must be called after an ActiveListPush() call has been made previously. Otherwise, an error will be returned. if ((rv = ActiveAreaSu { /* error */ return (rv); } Example 4-4 Re-enab if ((rv = ActiveAreaSu { /* error */ return (rv); } 4-6 Input Handling Pen InputPen Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 4.5 Active Area Enquiry purpose of scrolling. The to the icon area. Two set STATUS ActiveAreaRead(U32 areaId, P_S16 xSrc, P_S16 ySrc, P_S16 xDest, P_S16 yDest) Given a valid active area identifier, this tool will return to the caller the coordinates of the active area. Example 4-5 Enquire coordinates of the active area 85 86 87 U32 P_U16 S16 id, size; inData; xSrc, ySrc, xDest, yDest; . . . Freescale Semiconductor, Inc... 180 ActiveAreaRead(id, &xSrc, &ySrc, &xDest, &yDest); F 4.6 Put Active Area to Front of List STATUS ActiveAreaToFront(U32 areaId) An identifier is returned t Given the active area identifier, this tool will extract the element from the active area linked list and insert the element at the front of the list. Icon Type PPSM_ICON_8_UP Once the element is at the front of the list, it will be the active area to receive pen input if there are other active areas that overlaps the same physical area. PPSM_ICON_8_DOWN PPSM_ICON_8_LEFT 4.7 Pen Echoing PPSM_ICON_8_RIGHT PPSM_ICON_8_DONE STATUS AreaEchoEnable(U32 areaId) PPSM_ICON_16_UP STATUS AreaEchoDisable(U32 areaId) PPSM_ICON_16_DOWN For input active areas, echoing can be disabled. By default, ink echoing is PPSM_ICON_16_LEFT enabled when input active areas are created. The argument to both tools must be valid active area identifier generated from ActvieAreaEnable tool. PPSM_ICON_16_RIGHT PPSM_ICON_16_DONE 4.8 Pen Color and Pen Size Example 4-6 Create a STATUS PenEchoParam(U16 echoCol, U16 echoWidth) 80 PPSM allows the application developer to set the echoing pen width and echo pen color. This tool only sets the echoing property of the calling task, and will not affect 102 103 other applications within the system. 4.9 Creating a Control Active Area STATUS CtrlIconEnable(P_U32 iconId, S16 A pre-defined group of direction control icons are 4-4 U32 sendButto . . . 104 105 106 107 108 109 110) xSrc, S16 ySrc, U16 iconType 111 112 available in PPSM for the 113 Input Handling Pen InputPen Handling For More Information On This Product, Go to: www.freescale.com /* create control bu if ( CtrlIconEnable( != PPSM_OK ) return (PPSM_ERROR if ( CtrlIconEnable( != PPSM_OK ) return (PPSM_ERROR if ( CtrlIconEnable( != PPSM_OK ) return (PPSM_ERROR Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual break; /* Close keyboard icon selected */ case IRPT_ICON: if (id == CloseIconId) CloseSoftKey(); break; /* no more interrupt */ default: break; } /* switch */ } /* while */ 5.2 Chapter 5 Character Inp PPSM supports two type input from the user. Ther numeric input, and an inp support any coded langu This chapter describes th Input Tools provided by P Handwriting Recognition Input Pad The handwriting recognition input pad consists of a number of square boxes in a row by column format layout (refer to Figure 5-3). Freescale Semiconductor, Inc... 5.1 Soft Keyboard A default QWERTY soft k any position within the pa for upper case letters and letters and symbols (refe layouts by pressing one o Figure 5-3 An Example Input Pad with 1 row by 4 columns layout It serves as an interface between the user and the underlying handwriting recognition engine. It captures the stroke data generated from the user's handwriting input, and passes these data to the handwriting recognition engine for processing. (Refer to Figure 5-4 for the flow of input and output data passing through the input pad). 1 2 3 QWE A S D Z X SHIFT Figure 5 ! @ # q w e a s d z x SHIFT Figure 5 As an alternative, an use column and row in numb defined return keycode a 5-4 Character Input Methods Character Input Methods For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual For both of the above keyboards, together with the keycode, the coordinate (S16, /* open S16) of the pen on the key is also returned to users. /* with /* /* /* /* if Only one soft keyboard can be opened within each task. 5.1.1 Starting Soft Keyboard Character Input STATUS OpenSoftKey(U16 xPos, U16 yPos) 5.1.2 user specified sof 10x10 key size and 7 8 9 */ 4 5 6 */ 1 2 3 */ * 0 # */ ( AdvOpenSoftKey(KEYBD_ return (PPSM_ERROR); Auto-Key-Repeat Freescale Semiconductor, Inc... OpenSoftKey() opens the soft, or pseudo, keyboard input module. A soft pressing a ke its keyboard (as shown in Figure 5-1 above) is drawn on the panning screen, withContinually upper-left corner position specified by the caller. When this function is called, first and second returned to be 20. The time durati PPSM saves the display area covered by the soft keyboard and monitors the input AUTO_REPEAT_RATE. keys automatically. The soft keyboard is now ready for user's input. tick. For example, a 32Hz When the user presses a key on the soft keyboard, the ASCII code for that key sec, will then, for every 5/32 be returned to the calling application by way of IRPT_KEY messages when the application calls IrptGetData(). (Refer to Section 29.1 - IrptGetData). One 5.1.3 Terminating Soft Ke IRPT_KEY interrupt message is generated for each key pressed by the user. The ASCII code returned is of type TEXT, i.e. 2-byte format with zero extended in high STATUS CloseSoftK byte. CloseSoftKey() closes th or AdvOpenSoftKey(). PP soft keyboard automatica Example 5-1 Open soft keyboard for input 118 119 120 /* open soft keyboard for input */ if ( OpenSoftKey(KEYBD_X, KEYBD_Y) != PPSM_OK ) return (PPSM_ERROR); 5.1.4 Suspend Soft Keyb STATUS AdvOpenSoftKey( U16 xPos, U16 yPos, U16 keyWidth, U16 keyHeight, U16 numCol, U16 numRow, P_U16 keyMap, P_U8 bitmap) AdvOpenSoftKey() opens the soft keyboard input module with advanced configurable details. * * * * * Location of the soft keyboard Width and height of the keys in number of pixels Number of rows and columns of keys The return code of each key (keycode) The bitmap user interface for the soft keyboard STATUS ActiveListP ActiveListPush() pushes current task into backgro and soft keyboard of the that is currently being us list. For more details, ple Example 5-3 Display The return codes are defined in an array(keymap). The order of the keys in the array is from top left key across to the right, then next row and so on, until the bottom right key. The contents of this array should not be changed after AdvOpenSoftKey() has been called. The bitmap has to be either a NULL pointer or it must fit to cover the entire soft keyboard area. Hence, the width and height of this soft keyboard must be (keyWidth*numCol) and (keyHeight*numRow) in number of pixels. For the NULL pointer case, it will not draw anything on the screen. Example 5-2 Open soft keyboard for input /* 7, 8, 9, 4, 5, 6, 1, 2, 3, *, 0, # */ static const U16 keyMap[] = {55, 56, 57 ,52, 53, 54, 49, 50, 51, 42, 48, 35}; 5-2 STATUS ActiveListP Character Input Methods Character Input Methods For More Information On This Product, Go to: www.freescale.com if (rv = OpenSoftKey(5 { /* error */ return (rv); } while (running) { switch(IrptGetDa { /* Any ke case IRPT /* Dis /* x=* y=* Dis Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Use Open/Close Freescale Semiconductor, Inc... Application Character candidate and error code Figure 5-4 Data f 5.2.1 The Input Pad Mech The user writes a charac system proceeds to reco different box, or when a p whichever occurs first. Th entered, independent of mechanism to determine (e.g. the user clicks on a The input pad is a subtas messages, IRPT_HWR, recognized. Each individ IRPT_HWR interrupt me returns the recognized ch input pad. (Refer to Sect Only ONE instance of the parent and sub-tasks). If attempt to open the input fail. If the user switches to in the current task. The h area is cleaned if the are 5.2.2 Starting Handwritin STATUS OpenInput U16 area An application can open 5-8 Character Input Methods Character Input Methods For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual application needs to specify the xy-coordinate of the upper left corner of the input pad, the number of rows and columns of input boxes, and the size of each input box (in units of pixel). If the input pad is not already opened by another application and that the specified layout fits within the panning screen, it will be displayed at the specified location ready for user's input. The area of the panning screen covered by the input pad is saved at the time this function is called. Any changes to this covered area by the application after this function is called will not be recorded by the system. The default length of timeout for OpenInputPad() after the last stroke is 1sec. Freescale Semiconductor, Inc... STATUS AdvOpenInputPad(U16 xPos, U16 yPos, U16 numRow, U16 numCol, U16 areaWidth, U16 areaHeight, U16 echoCol, U16 echoWidth, U32 timeOut, U16 samplingRate, U8 areaClean, U16 stackSize) AdvOpenInputPad is similar to the tool OpenInputPad but with advanced configurable details. It allows the caller to specify: * * * * * * * * 5.2.3 position of the input pad number of rows and columns of input boxes the width and the height of the input boxes the echo ink colour and dot width the length of time out after a stroke(no more than 1sec) the sampling rate of the pen if the system should clean the input box for the user after each character is written the stack size for the input pad subtask Terminating Handwriting Character Input STATUS CloseInputPad(void) CloseInputPad() closes the input pad that has been opened either by OpenInputPad() or AdvOpenInputPad(). After it is closed, no more handwriting recognition messages will be generated from the system to the application. The original image covered by the input pad is restored by the system if the areaClean flag has been set to be 1(TRUE) before. Example 5-4 Display characters receive from Input Pad /* open an input pad at location (50, 50) that has 1 row of 4 boxes with the boxes being 64x64 pixels each */ if (rv = OpenInputPad(50, 50, 1, 4, 64)) { /* error */ return (rv); } while (running) { switch(IrptGetData((P_U32)&id, (P_U32*)&inData, (P_U32)&size)) { /* Any icon pressed or handwritten character input */ 5-6 Character Input Methods Character Input Methods For More Information On This Product, Go to: www.freescale.com Personal Porta Program case IRPT /* Code h recognized chara DisplayKe break; /* Close keyboar case IRPT_ICON: if (id == Clo break; /* no more inter break; } /* switch */ } /* while */ Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.2.2 Chapter 6 Screen Resolution Using Graph LCD display screen resolution is the number of pixels that are available on the hardware. This is normally a fixed figure for each LCD hardware panel. The touch panel resolution must be equal to or greater than the LCD resolution or the pen cannot point at every pixel of the LCD display. PPSM supports LCD mo hardware cursor, hardwa 6.3 Sample LCD Display Screen The Graphics Tools enab * * * The LCD Display Screen area has two sizes, 320 pixels wide by 240 pixels high * and 320 pixels wide by 200 pixels high. The touch panel resolution is 1024x1024. * * * * Pen Input Area * Panning Screen Origin (0,0) Freescale Semiconductor, Inc... The following two figures show example systems used by the M68328ADS hardware platform. Panning Screen 320 pixels Input Origin (0,0) * * * Display Origin (0,0) * * LCD Display Screen 240 pixels For This chapter will describe Yhardware cursor control p pixels Graphics & Text Display coordinate (319, 239) 340 pixels Input coordinate (1023,1023) X pixels Figure 6-2 320x240 LCD Panel with a larger touch panel 6-4 draw lines and s display and man swap bitmap ima control and resto control hardware set grey levels get information a change the pann direct all drawing area hardware cursor allocate memory set dot width in p arc and vector set pattern fill mo draw vector by c Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual pixel. Touch Panel Negative Coordinates 6.1.2 Panning Display Sc The Panning Screen is a is to allow applications to Although applications ca screen unless this area is areas on the panning scr with the LCD display scre Origin (0,0) Freescale Semiconductor, Inc... The reference coordinate corner, the Display Origin associated with the LCD Panning Screen has a si different origin. It is confi LCD Display Panel * Positive Coordinates The maximum m byte. In 1 bit per pixel divisible by 16 an per pixel mode, t maximum of 204 The height of the that is available f 6.2 Screen Initializat * * Figure 6-1 Generic Screen Format 6.1 Display Screen Format Because every hardware procedure is required wh calibration of the alignme screen. Screen initialization is im Figure 6-1 shows the general screen architecture for the PPSM system. There are three major areas: Example 6-1 Initialize * * * 6.1.1 Pen Input Area LCD Display Screen Panning Display Screen LCD Display Screen 57 58 62 63 main() { . . . /* Initialize PPSM w PPSMInit(TRUE); The Display Screen is the region of the LCD display where applications can display output data. Its size will depend on manufacturer, e.g. 3206.2.1 pixels wide LCD by 200 pixels high or 320 pixels wide by 240 pixels high, etc. Display Screen The touch panel can be l The LCD module is capable of 1 bit per pixel or 2 bits per pixel output, giving 2tools will only return LCD grey levels or 4 grey levels respectively. Hence, there are WHITE and BLACKoutside for the LCD display 1 bit per pixel and WHITE, LIGHT_GREY, DARK_GREY and BLACK for 2 bits or pereven greater than the 6-2 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual PutRec(), and ClearRec(). Pen Inp The following tables show the grey level result of a pixel after a drawing operator is applied. Panning Screen Origin (0,0) X is the existing grey level on the screen. Y is the grey level to be put on screen and R is the final grey level on screen after implementation. AND_STYLE Input Origin (0,0) 320 Display Origin (0,0) Table 6-6 R = X AND Y Freescale Semiconductor, Inc... X Y LCD Dis R 00 00 00 01 00 00 10 00 00 11 00 00 00 01 00 01 01 01 10 01 00 11 01 01 00 10 00 01 10 00 10 10 10 11 10 10 00 11 00 01 11 01 10 11 10 11 11 11 200 F pixels Graph Panning Sc Figure 6-3 320x20 6.4 1 bit-per-pixel Gr The graphics routines wi panning screen. The byte and bit within b 1 0 0 OR_STYLE Table 6-7 R = X OR Y 6-8 X Y R 00 00 00 01 00 01 10 00 10 11 00 11 00 01 01 BLACK ( The above image will be 0x8A88 in hexadecimal. Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.4.1 Drawing Operators REPLACE_STYLE PPSM supports drawing operators in DrawDot(), DrawHorz(), DrawVert(), DrawLine(), DrawCircle(), DrawEllipse(), DrawArc(), DrawVector(), DrawRec(), PutRec(), and ClearRec(). The following tables show the grey level result of a pixel after a drawing operator is applied. X is the existing grey level on the screen. Y is the grey level to be put on screen and R is the final grey level on screen after implementation. Table X 0 1 0 1 AND_STYLE Freescale Semiconductor, Inc... Table 6-1 R = X AND Y INVERT_STYLE X Y R Table 6 0 0 0 X 1 0 0 0 0 1 0 1 1 1 1 6.5 2 bits-per-pixel G OR_STYLE The graphics routine will DARK GREY and BLACK Table 6-2 R = X OR Y X Y R 0 0 0 1 0 1 0 1 1 1 1 1 The byte and bit within b 11 01 00 0 BLACK (11 EXOR_STYLE Table 6-3 R = X EXOR Y LIGHT GR X Y R 0 0 0 1 0 1 0 1 1 1 1 0 The above image will be in binary and 0xD08CC4 6.5.1 Drawing Operators PPSM supports drawing DrawLine(), DrawCircle() 6-6 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.9 Get Panning Screen Width Table 6X U16 GetLogicalX(void) GetLogicalX() returns to the caller the panning screen width, in terms of pixels, of the current application. 01 The panning screen width is dynamically configurable at run time and it is recommended to use this tool to obtain the panning screen width for panning purposes. 11 10 00 01 6.10 10 Get Panning Screen Height 11 Freescale Semiconductor, Inc... U16 GetLogicalY(void) 00 GetLogicalY() returns to the caller the panning screen height, in terms of pixels, of the current application. 01 The panning screen height is dynamically configurable at run time and it is recommended to use this tool to obtain the panning screen height for panning purposes. 11 10 EXOR_STYLE 6.11 Set Pattern Fill Table 6-8 STATUS SetPatternFill(U16 mode, U16 backGrey, U16 borderMode, U16 fillSpace) X 00 This routine allows application programmers to decide on the fill pattern settings. These settings include the pattern mode, the spacing between the pattern lines, the background grey level, and the existence of a border. Once SetPatternFill() is called, the settings will be applied to all subsequent DrawRec(), DrawCircle(), DrawEllipse(), and DrawArc(). The pattern will be drawn with the specified grey level in the parameter of DrawRec(), DrawCircle(), DrawEllipse(), and DrawArc(). The argument fillSpace lets application developers define the size of the gap between the pattern lines. The size of the gap equals to 2fillSpace number of pixels. There are 8 fill patterns available (mode 0 will turn off the pattern fill feature): 01 10 11 00 01 10 11 00 01 10 1 2 3 4 11 00 01 5 6 7 8 10 11 6-12 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual origin. All co-ordinates gi screen origin. There is no REPLACE_STYLE Freescale Semiconductor, Inc... Table 6-9 R = Y X Y R 00 00 00 01 00 00 10 00 00 11 00 00 00 01 01 01 01 01 10 01 01 11 01 01 00 10 10 01 10 10 10 10 10 11 10 10 00 11 11 01 11 11 10 11 11 11 11 11 Some of the graphics rou argument in calling the ro drawing 5 dots with spec Those graphics routines DrawVert(), DrawLine() a DrawDot(), DrawHorz(), D DrawEllipse(), DrawArc() which is described above For all the following exam LCD display screen size (50, 50) from panning sc 6.7 Get LCD Display U16 GetDisplayX(vo GetDisplayX() returns to LCD display panel being When writing an applicat numbers for the width of flexible to run on differen 6.8 Get LCD Display U16 GetDisplayY(vo INVERT_STYLE GetDisplayY() returns to LCD display panel being Table 6-10 R = NOT X 6.6 X R 00 11 01 10 10 01 Example 6-2 Get LCD 11 00 362 STATUS DrawTextIcon(P_ 363 U16 font, 364 { 365 366 U16 xDest, yDe . . . 375 /* Check to see if 376 if ( (xSrc < 0) || 377 (yDest >= GetDis 378 return PPSM_ERRO origin. Graphics Tools The following sections explain each graphics tool with examples. When writing an applicat numbers for the height of run on different LCD pan Top left corner of the panning screen is (0, 0) which is the panning screen Top left corner of the LCD display screen is an offset from the panning screen 6-10 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual equals to FALSE to copy all properties of the common panning screen to the task's own context The pattern fill mode 0 w Example 6-5 Use ChangePanning() to let all tasks share the same panning screen 6.12 Set #include #include #include STATUS SetDotWid After this routine is called DrawDot(), DrawHorz(), D DrawEllipse(), DrawArc() PAN_SCREEN newScreen; STATUS TestApp() { /* use the common panning screen in this task */ ChangePanning(&newScreen, FALSE, 0); /* draw a circle with center at (100, 100) and radius 80 pixels */ DrawCircle(BLACK, 100, 100, 80, REPLACE_STYLE); Freescale Semiconductor, Inc... Dot Width If the dot width is larger t thick arc and thick vector Example 6-3 Set dot } 160 161 162 main() { U32 taskId; P_U8 newPanning; * Drawing1 - Draw a L * Both hav * drawn as . . . PPSMInit(FALSE); 170 171 SetDotWidth(6, 0); SetPatternFill(2, WH /* create a common panning screen with size 640x400 */ newPanning = (P_U8)GetScreenMem(640, 400); 6.13 newScreen.panAddress = (U32)newPanning; newScreen.displayScreenAddr = (U32)newPanning; newScreen.horzSize = 640; newScreen.vertSize = 400; newScreen.displayXOrigin = 0; newScreen.displayYOrigin = 0; newScreen.regPOSR = 0; newScreen.regPSW = 80;/* as the LCD panel used is 2 bits per pixel, PSW = 640/8 = 80. */ DisplayMove STATUS DisplayMo This function is to set the screen. It sets the display function is called, the new /* destroy the system panning screen and use the new panning screen created above */ ChangePanning(&newScreen, FALSE, 0); 6.14 Direct All Graphi /* clear whole panning screen */ ClearScreen(WHITE); /* draw a circle with center at (100, 100) and radius 20 pixels to the new panning screen */ DrawCircle(BLACK, 100, 100, 20, REPLACE_STYLE); STATUS ChangeWin P_U16 o Run-time computation in Users may see the graph /* create a new task with no panning screen */ AdvTaskCreate(&taskId, (P_VOID)TestApp, 0, 0, 0, 0, 3048, PPSM_NOSCREEN, 0, 0,ChangeWindow() 0); allows routines to an off-screen on the LCD display scree generated, it can be disp that the image is displaye In the example above, both the system task in main() and task TestApp() share the same panning screen. So whatever done on the panning screen by the ChangeWindow() assum system task or task TestApp() will have effect on the panning screen. values are supposed to b TaskStart(taskId); } If a panning screen is shared among tasks. Calls ChangePanning() to free theExample 6-4 Use Ch screen in one of the task can also free/corrupt the others' screen memory area. U32 oldScreen1, oldScr U16 oldWidth1, oldHeig 6-16 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Table U16 oldWidth2, oldHeight2; U32 tempScreen = (U32)GetScreenMem(64, 64); Name /* Direct all graphic routine to memory area pointed by tempScreen with width 64 pixels and height 64 pixels */ ChangeWindow(tempScreen, 64, 64, &oldScreen1, &oldWidth1, &oldHeight1); displayScreenAddr /* This may be any routine for calculating the co-ordinates to be drawn or drawing anything by calling graphics routines */ DoCalculation(); /* Direct all graphic routine back to original panning screen */ ChangeWindow(oldScreen1, oldWidth1, oldHeight1, &oldScreen2, &oldWidth2, &oldHeight2); Freescale Semiconductor, Inc... 6.15 Change Panning Screen Parameters STATUS ChangePanning(P_PAN_SCREEN newPanning, U16 flag, P_PAN_SCREEN oldPanning) regPOSR ChangePanning() allows applications to change the active panning screen to another memory area during run-time. The flag is to indicate whether the old panning screen is still needed or it will be destroyed. P_PAN_SCREEN is a pointer to structure PAN_SCREEN which has the following regPSW elements: Table 12-11 Panning Screen Parameters Name Description panAddress The memory address where panning Upon start-up, panAddre screen origin is located. All graphics displayXOrigin and displa routines will draw in the area relative to bits per pixel display or h this address. horzSize The panning screen width in number of When DisplayMove() is c modified so that the syste pixels. vertSize The panning screen height in number of pixels. position within the word t displayXOrigin When ChangeWindow() The x-coordinate of the LCD display changed so that all graph screen relative to the panning screen. and image processing. In normal case, when ChangeWindow() is If all or several tasks in a not called, displayXOrigin and displayYOrigin are used to calculate thememory, the following ste value of displayScreenAddr and 1) In main() regPOSR. * displayYOrigin 6-14 The y-coordinate of the LCD display screen relative to the panning screen. In normal case, when ChangeWindow() is not called, displayXOrigin and displayYOrigin are used to calculate the value of displayScreenAddr and regPOSR. 2) Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com call GetScre panning scre * call ChangeP * for each task AdvTaskCre the task with for each corresp screen * during initiali Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.16 Fill the whole Pa (0, 0) STATUS ClearScree (50, 50) (50, 60) (369, 60) (580, 60) Panning Screen This routine will fill the wh LCD Example 6-6 Fill the STATUS ret; /* fill the whole pann ret = ClearScreen(WHIT Freescale Semiconductor, Inc... Figure 6-9 Screen output for Example 6-11 Example 6-12 Draw a thick horizontal line STATUS ret; /* set dot width to 4 */ ret = SetDotWidth(4, 0); if (ret !=PPSM_OK) return ret; Figure /* draw a black horizontal line from (60, 60) with width 2 */ ret = DrawHorz(BLACK, 60, 60, 2, 0, REPLACE_STYLE); if (ret != PPSM_OK) return ret; 6.17 Draw a Dot STATUS DrawDot(U In the above example, a thick horizontal line will be drawn as follow: This routine will draw a d If dot width is 1, a pixel w be drawn with top left pix the dot width is greater th value of (dot width - 1)/2 ordinate, (xPos, yPos). Example 6-7 Draw a (60, 60) (61, 60) Figure 6-10 Screen output for Example 6-12 6.19 STATUS ret; /* draw a dot at (52, ret = DrawDot(BLACK, 5 The calling of DrawDot(B panning screen. As the L on screen is at (2, 2) in d STATUS DrawVert(U16 greyLevel, U16 xSrc, U16 ySrc, U16 height, U16 have a dot which is very dotLine, U16 style) Draw a Vertical Line Example 6-8 Draw a This routine will draw a vertical line from (xSrc, ySrc) to (xSrc, ySrc + height - 1). 6-20 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com STATUS ret; Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual /* set dot width to 4 SetDotWidth(4, 0); (0, 0) (50, 50) (52, 52) Panning Screen /* draw a dot at (52, ret = DrawDot(BLACK, 5 When the dot width is 4, drawn. LCD (52, 52 Freescale Semiconductor, Inc... Figure 6-5 Screen output for Example 6-7 Figure /* set dot width to 2 */ SetDotWidth(2, 0); /* draw a dot at (52, 52) */ ret = DrawDot(BLACK, 52, 52, REPLACE_STYLE); 6.18 Draw a Horizonta When the dot width equals 2, a square dot with length of 2 will be drawn. STATUS DrawHorz( dotLine, (52, 52) This routine will draw a h Figure 6-6 Screen output for Example 6-8 Example 6-9 Draw a dot with dot width 3 If the dot width is greater truncated of (dot width - 1 lines below it. The length 2 pixels to the left of the point. If the width of the horizon STATUS ret; Example 6-11 Draw a /* set dot width to 3 */ SetDotWidth(3, 0); STATUS ret; /* draw a dot at (52, 52 */ ret = DrawDot(BLACK, 52, 52, REPLACE_STYLE); /* draw a black horizo ret = DrawHorz(BLACK, In this example, the dot w When the dot width is 3, a circular disc with radius of (3-1)/2 (which is 1) will be 0, REPLACE_STYLE) w drawn. on panning screen. Only (52, 52) display. Figure 6-7 Screen output for Example 6-9 Example 6-10 Draw a dot with dot width 4 STATUS ret; 6-18 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Example 6-17 Draw a rectangle with black outline STATUS ret; /* draw a black rectangle with top left corner at (310, 250) and bottom right at (500, 400) */ ret = DrawRec(BLACK, 310, 250, 500, 400, 0, REPLACE_STYLE); (0, 0) If the dot width is greater truncated of (dot width - 1 at right. The height of ea corner pixels above the source If the height of the vertica Example 6-13 Draw a STATUS ret; Panning Screen (50, 50) (369, 250) /* draw a black vertic ret = DrawVert(BLACK, LCD Freescale Semiconductor, Inc... (310, 250) (0, 0) (50, 50) (310, 288) (60 (500, 400) Figure 6-15 Screen output for Example 6-17 (6 In this example, the dot width is 1. The calling of DrawRec(BLACK, 310, 250, 500, 400, 0, REPLACE_STYLE) will draw a rectangle with top left corner at (310, 250) and bottom right corner at (500, 400) on panning screen. However, only a horizontal line from (310, 250) to (369, 250) and a vertical line from (310, 250) to (310, 289) will be seen on the LCD display screen. (60, Figure Example 6-18 Draw a rectangle with black outline in dot width 3 and In this example, the dot w fill pattern mode 1 STATUS ret; /* set dot width to 3 */ ret = SetDotWidth(3, 0); if (ret !=PPSM_OK) return ret; /* set pattern fill mode to 1 which is solid fill */ ret = SetPatternFill(1, WHITE, TRUE, 1); REPLACE_STYLE) will d screen. However, only th which is (60, 60) to (60, 2 drawn in the form of 2 BL pixels, and so on. Example 6-14 Draw a STATUS ret; if (ret !=PPSM_OK) return ret; /* fill a rectangle from top left corner at (310, 250) to (500, 400) */ ret = DrawRec(BLACK, 310, 250, 500, 400, 0, REPLACE_STYLE); /* set dot width to 4 ret = SetDotWidth(4, 0 if (ret !=PPSM_OK) return ret; /* draw a black thick ret = DrawVert(BLACK, if (ret != PPSM_OK) return ret; 6-24 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual In this example, the dot w 470, 0, REPLACE_STYL panning screen. Howeve be seen. In the above example, a thick vertical line will be drawn as follow: Example 6-16 Draw a STATUS ret; /* set dot width to 4 ret = SetDotWidth(4, 0 if (ret !=PPSM_OK) return ret; (10, 10) /* draw a black thick ret = DrawLine(BLACK, Freescale Semiconductor, Inc... (10, 11) if (ret != PPSM_OK) return ret; Figure 6-12 Screen output for Example 6-14 In the above example, a 6.20 Draw a Line STATUS DrawLine(U16 greyLevel, U16 xSrc, U16 ySrc, U16 xDest, U16 yDest, U16 dotLine, U16 style) This routine will draw a line from (xSrc, ySrc) to (xDest, yDest). If dot width is greater than 1, each dot on the specified line will be represented by a thick square dot. Each of the thick square dot is generated by extending integer truncated (dot width - 1)/2 pixels above, (dot width)/2 below, (dot width - 1)/2 pixels to the left and (dot width)/2 pixels to the right of the original dot. The thick line is then generated by overlapping these thick dots accordingly. (10, 10) Figure Example 6-15 Draw a black line STATUS ret; /* draw a black line from (60, 240) to (630, 470) */ ret = DrawLine(BLACK, 60, 240, 630, 470, 0, REPLACE_STYLE); 6.21 Draw a Rectangl (0, 0) STATUS DrawRec(U yDest, U Panning Screen (50, 50) (60, 240) This routine draws a rect corner at (xDest, yDest). LCD If the dot width is greater inside the rectangle and (630, 470) Figure 6-13 Screen output for Example 6-15 6-22 If both fill pattern mode a which is not covered by t If fill pattern mode is set rectangle border will be f Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual (0, 0) (x1, y1) (50, 50) (x1 < x2) and (y1 < y2) (x2, y2) (310 Freescale Semiconductor, Inc... (x2, y2) Figure (x1 < x2) and (y1 > y2) In this example, the dot w DrawRec(BLACK, 310, 2 with top left corner at (30 screen. However, only a will be seen on the LCD (x1, y1) (x1, y1) 6.22 Draw a Circle STATUS DrawCircle U16 styl (x1 > x2) and (y1 < y2) This routine will draw a c radius and grey level. (x2, y2) If the dot width is greater inside the circle and (dot (x2, y2) (x1 > x2) and (y1 > y2) If both fill pattern mode a which is not covered by b If fill pattern mode is set border will be filled. (x1, y1) Example 6-19 Draw a STATUS ret; Figure 6-19 Cases of DrawArc If the dot width is greater than 1, integer truncated (dot width - 1)/2 lines are drawn inside the arc and (dot width)/2 lines drawn outside the arc. If both fill pattern mode and border mode are set, those area inside arc which is not covered by the border of the arc will be filled. If fill pattern is set and border is off, those area inside and on the arc border will be filled. 6-28 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com /* draw a black outlin ret = DrawCircle(BLACK Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual (0, 0) (0,0) Panning Screen (50,50) (50, 50) LCD 150 (560, 290) Freescale Semiconductor, Inc... Figure 6-17 Screen output for Example 6-19 Figure In this example, the dot w In this example, the dot width is 1. The calling of DrawCircle(BLACK, 560, 290, 150, 100, REPLACE_ST 150, REPLACE_STYLE) will draw a circle centering at (560, 290) with radius 150. distance on y axi As the circle is drawn outside the LCD display screen, nothing will be seen on longest the distance on x axis from c LCD. 6.23 Draw an Ellipse 6.24 Draw an Arc STATUS DrawEllipse(U16 greyLevel, U16 xCenter, U16 yCenter, U16 xLength, U16 yLength, U16 style) STATUS DrawArc(U style) This routine will draw a ellipse centering at (xCenter, yCenter) with the specified This routine will draw an size. DrawArc() will draw a qu If the dot width is greater than 1, integer truncated (dot width - 1)/2 lines are drawn DrawArc(BLACK, x1, y1, inside the ellipse and (dot width)/2 lines drawn outside the ellipse. will be drawn according t If both fill pattern mode and border mode are set, those area inside ellipse which is not covered by the border will be filled. If fill pattern mode is set and border mode is off, the area inside and on the ellipse border will be filled. Example 6-20 Draw an ellipse with black outline STATUS ret; /* draw an ellipse with center at (560, 290), horizontal length 150 and vertical length 100 */ ret = DrawEllipse(BLACK, 560, 290, 150, 100, REPLACE_STYLE); 6-26 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual The following will be seen on LCD display screen: Example 6-21 Draw a LCD Display Screen STATUS ret; /* draw an arc from (2 ret = DrawArc(BLACK, 2 (0, 0) (50, 50) (100 Freescale Semiconductor, Inc... Figure 6-25 Screen output for Example 6-25 Example 6-26 When LCD Display screen crosses the bottom boundary of the panning screen (0, 0) Figure In this example, the dot w 50, OR_STYLE) will draw The arc is actually a qua distance of 141 pixels in center is determined by t of the first point which is Example 6-22 Draw a Panning Screen /* draw an arc from (1 ret = DrawArc(BLACK, 1 LCD (0, 0) Figure 6-26 Screen output for Example 6-26 (50, 50) The following will be seen: (100 LCD Display Screen Noise Figure Figure 6-27 Screen output for Example 6-26 In this example, the dot w the calling of DrawArc() i a black background. The pattern of the noise part of the display depends on the content of the memory that follows the panning screen. If the memory following the panning screen is all 0, the noise will appear as a blank image. If the memory following the panning 6-32 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.25 Draw a Vector from a List of Points 6.26.1 STATUS DrawVector(U16 greyLevel, U16 numberOfPoints, P_POINT pointPtr, U16 style, U16 mode) Special cases of Pu The following are the few Example 6-24 Displa This routine will draw lines to connect the points in the given list. It has options on setting whether the first point and last point need to be connected. Two similar images will b 6.26 (0, 0) Put a Rectangular Area on Panning Screen STATUS PutRec(P_U8 bitmap, U16 xSrc, U16 ySrc, U16 width, U16 height, U16 style, U16 reserved) Freescale Semiconductor, Inc... This routine puts an image from memory to panning screen. PutRec() supports style such as REPLACE_STYLE, OR_STYLE, EXOR_STYLE and AND_STYLE. There is error checking done on the argument style, but not on the value of bitmap. Example 6-23 Put a bitmap on screen with REPLACE_STYLE /* put an image on panning screen with top left corner at (0, 0), width 640 and height 480 */ ret = PutRec(bitmap, 0, 0, 640, 480, REPLACE_STYLE, 0); Figure Example 6-25 LCD D panning screen (0, 0) (0, 0) Panning Screen (50, 50) LCD Figure 6-22 Screen output for Example 6-23 The calling of PutRec(bitmap, 0, 0, 640, 480, REPLACE_STYLE, 0) copies the image from the memory area pointed to by bitmap onto the panning screen. 6-30 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Figure 6 Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual memory is invalid, a bus /* set hardware cursor width to 15 and height to 15 pixels */ CursorInit(15, 15); /* turn on the hardware cursor in full density mode */ CursorSetStatus(PPSM_CURSOR_ON); 6.27 Save a Rectangu The above will create a cursor at (150, 158) with 15 pixels wide by 15 pixels high, STATUS SaveRec(P U16 rese and will turn the cursor on. This routine saves an im 6.31.2 Set Hardware Cursor Position Example 6-27 Save a STATUS CursorSetPos(U16 xPos, U16 yPos) /* save the portion of width 320 and he ret = SaveRec(bitmap, Freescale Semiconductor, Inc... This routine will set the hardware cursor top left corner position at (xPos, yPos). (0, 0) Example 6-32 When the hardware cursor needs to be changed to other position: (50, 50) /* set hardware cursor position to (15, 150) */ CursorSetPos(15, 150); This will change cursor to new position at (15, 150) 6.31.3 LCD Set Hardware Cursor Status STATUS CursorSetStatus(U16 status) This routine will change the hardware cursor status to one of the following states: PPSM_CURSOR_OFF, PPSM_CURSOR_ON or PPSM_CURSOR_REVERSED. The calling of SaveRec(b display image into memo Table 6-12 Status name Figure Descriptions PPSM_CURSOR_OFF Temporarily turn cursor off PPSM_CURSOR_ON Turn cursor on PPSM_CURSOR_REVERSED Reverse cursor 6.28 Exchange a Rect STATUS ExchangeR rese This routine exchanges i Example 6-33 When hardware cursor is turned off after creation and it needs to be on with reverse video mode: Example 6-28 Save a U16 x, y; /* exchange the image o and height 120 t ret = ExchangeRec(bitm /* turn on hardware cursor in reverse video mode */ CursorSetStatus(PPSM_CURSOR_REVERSED); 6.31.4 Get Hardware Cursor Status STATUS CursorGetStatus(P_U16 status) This example swaps the rectangular region from t 169). After this call, bitma region (50, 50) to (369, 1 displayed on the rectang This routine will return the current hardware cursor status. The status will be one of the following states: PPSM_CURSOR_OFF, PPSM_CURSOR_ON or 6-36 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 6.29 Fill a Rectangular Area (0, 0) STATUS ClearRec(U16 greyLevel, U16 xSrc, U16 ySrc, U16 width, U16 height, U16 style) (50, 50) This routine fills an rectangular area with the specified grey level. Example 6-29 Fill a rectangular region with BLACK and OR style STATUS ret; /* fill a rectangular area with top left corner at (300, 240), width 261 and height 161 */ ret = ClearRec(BLACK, 300, 240, 261, 161, OR_STYLE); Freescale Semiconductor, Inc... (0, 0) Figure 6 Panning Screen (50, 50) LCD In this example, the LCD screen is white. After inv 200) and 200 pixels wide screen at bottom right po (300, 240) (560, 400) 6.31 Hardware Curso Figure 6-29 Screen output for Example 6-29 6.30 When there is no hardwa requires to set the cursor This example fills the rectangular region from top left corner at (300, 240) on CursorSetStatus(PPSM_ panning screen with width 261 pixels and height 161 pixels. When hardware cursor is should call CursorOff(). If has to set the cursor cha Inverse a Rectangular Area CursorSetStatus(PPSM_ STATUS InvRec(U16 xSrc, U16 ySrc, U16 width, U16 height) When hardware cursor is CursorSetStatus(PPSM_ This routine will inverse the grey level of the rectangular area with top left corner at (xSrc, ySrc) and bottom right corner at (xSrc + width - 1, ySrc + height - 1). A application can change hardware cursor status fr Example 6-30 Inverse a rectangular region calling of functions to cha STATUS ret; immediate effect. /* inverse a rectangular area with top left corner at (250, 200), width 200 and height 100 */ ret = InvRec(250, 200, 200, 100); 6.31.1 Set Hardware Curso STATUS CursorInit( This routine will change t both width and height is f Example 6-31 When /* set hardware cursor CursorSetPos(150, 158) 6-34 Using Graphics Using Graphics Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Table 7-1 Predefined field format used in the PDA environment Field Index 7.1.2 Field Name Max. Field Size PPSM_CURSOR_REVE Example 6-34 When DB_COMPANY Company 60 U16 status; 1,2,3,4,5 5 additional fields 60 /* get the hardware cu CursorGetStatus(&statu Unformatted Data 6.31.5 Set Hardware Curso Freescale Semiconductor, Inc... Unformatted data is data that has to be accessed as one complete block. There is STATUS CursorSetB only one unformatted data field allowed per record. The unformatted data can be one of the following eight types defined as follows: This routine will set the h of blinks per 10 seconds * type 0 text (ASCII code record) * type 1 decompressed PPSM LCD bitmap 6.31.6 Turn Hardware Curs * type 2 compressed PPSM LCD bitmap * type 3 mixed text and graphics STATUS CursorOff( * type 4 reserved * type 5 text followed by decompressed PPSM LCD bitmap This routine will turn off t * type 6 text followed by compressed PPSM LCD bitmap hardware cursor again, th and follows by calling Cu * type 7 text followed by mixed text and graphics PPSM will keep track of the size of the unformatted data field of a record in the record information field. 6.32 Display Other Re STATUS CursorSetO 7.2 The Database Manipulation Tools STATUS LCDScreen PPSM provides a set of tools to operate on databases and records. Conceptually, These two routines toget they can be grouped together in the following way: different regions of the pa 1) Operate at the database level: two routines must be use * Add or delete a database. replaced by DisplayMove * Inquire the total number of database present in the current Example 6-35 Displa environment. * Set or clear the database secret flag. U16 x=50, y=50; * Interrogate the database secret flag. /* set the LCD display CursorSetOrigin(x, y); 2) Operate at the individual record level: * Add or delete a record. /* change the hardware top left corner * Add a blank record to the top of the record list. LCDScreenMove(x, y); * Append a blank record after a specified record in the record list. * Write or read formatted data of a record. The LCD Display screen * Write or read unformatted data of a record. screen with top left corne * Get the ID of the first record in the list. * Get the ID of the previous or next record in the list. 6.33 Get LCD Display * Search for a record using a formatted data field as a key. * Set or clear the record secret flag. STATUS CursorGet * Interrogate the record secret flag. * Inquire the total number of record present in a particular This routine will return th 7-2 UsingDatabase GraphicsManagement Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual panning screen. Chapter 7 Database Ma Example 6-36 Get LCD display origin on panning screen U16 x, y; /* get the position of LCD display screen on panning screen */ CursorGetOrigin(&x, &y); 6.34 PPSM supports global da type may be formatted or The Database Tools ena Allocate memory for Panning Screen Freescale Semiconductor, Inc... * P_VOID GetScreenMem(U16 width, U16 height) * * This routine will allocate memory for panning screen with specified size. However, * the size of the new panning screen area cannot be larger than 64K. If no memory * is available, it will return NULL. Example 6-37 Allocate memory for panning screen P_U8 screenPtr; /* allocate memory for panning screen with width 320 and height 240 */ screenPtr = (P_U8)GetScreenMem(320, 240); 7.1 create and delete add and delete r store, retrieve an search for particu get status about This chapter gives some getting up to speed fast. power reset, all database to save the database info Data Format PPSM database tools su 7.1.1 Formatted Data Formatted data means te in Table 7-1, will be used predefined. Other Forma need arise. When a new seven by default. PPSM record. The number of m PPSM at compile time, c Formatted Data, not Unfo There is a size limit of 60 Table 7-1 Predef Field Index DB_LAST DB_FIRST DB_HOME DB_OFFICE DB_ADDRESS DB_FAX 6-38 Using Graphics Tools Database Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual database. 7.3 Creating and Edi Whenever a record is cre Application will need to u particular record. The following example ill memory variables which formatted data field in a r Freescale Semiconductor, Inc... Note that user must have calling DBAdd(). It is imp access to the database n Note also that in the exam creation of the next recor because of the linked list retrieve the record that w ID. However, for those fre memory variable to keep Example 7-1 Create a d number of records /* Database identifier U32 gAddBkDBaseID; /* Data to be wr TEXT grec1LName[5]={'A TEXT grec1FName[4]={'K TEXT grec1Phone[9]={'2 TEXT grec1Add[17]={'1' TEXT TEXT TEXT TEXT /* Data to be wr grec2LName[8]={'A grec2FName[4]={'J grec2Phone[9]={'6 grec2Add[17]={'1' STATUS buildDBase( { STATUS ret; U32 recID; S32 numRec; ret = DBAdd(&gAd if(ret != PPSM_O /* Add Rec DBAddRecord(gAd DBChangeStdData DBChangeStdData DBChangeStdData DBChangeStdData /* Add Rec DBAddRecord(gAd DBChangeStdData DBChangeStdData DBChangeStdData DBChangeStdData /* Read bac 7-6 Database Management Database Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual DBReadTotalNumberRecords(gAddBkDBaseID, &numRec); } STATUS ret; /* Get the first r ret = DBGetFirstRe 7.4 Searching and Retrieving Data /* Check if the da if (ret == PPSM_ER The following example uses the database created from Example 7-1, and searches for a particular record using a formatted data field as the key. It is good programming practice to check the returned status of the call DBSearchData() ensuring that a match is found before using the recID returned for subsequent operation. /* Read back data DBReadData(gAddBkD . /* Do something he . /* Get next record Freescale Semiconductor, Inc... Example 7-2 Search a database record list using a formatted data field and retrieve record data /* Global database identifier */ U32 gAddBkDBaseID; /* This is the search key */ TEXT grec1FName[4]={'K','e','n',0}; STATUS searchRec(void) { STATUS ret; U32 recID; /* Pointers to the formatted data field to be read out */ P_TEXT tempLname, tempFname, tempPhone, tempAddress; /* Search for a record in the record list with the DB_FIRST formatted data field matching the key string grec1FName */ ret = DBSearchData(gAddBkDBaseID,DB_FIRST,grec1FName,&recID); if (ret != PPSM_OK) return (-1); /* Search unsuccessful! */ /* recID now is the record which match the search key */ /* We can now access the data contained in the record via recID */ DBReadData(gAddBkDBaseID, recID, DB_LAST, &tempLname); DBReadData(gAddBkDBaseID, recID, DB_FIRST, &tempFname); DBReadData(gAddBkDBaseID, recID, DB_HOME, &tempPhone); DBReadData(gAddBkDBaseID, recID, DB_ADDRESS, &tempAddress); /* tempLname, tempFname, tempPhone, tempAddress now points to data field stored in the record identified by recID */ } /* end searchRec() */ 7.5 Navigating along a Record List The following example uses the record list navigation tools to access record sequentially. It is assumed that a database with the identifier gAddBkDBaseID has already existed. Initially, the first record ID in the record list is retrieved. Then a while loop is set up to access record in the list sequentially. Termination of the loop is by using the botFlag passed to the routine DBGetNextRecID(). When this flag is set to 1, it signifies that the current record is the last record of the record list. Example 7-3 Use the record list navigation tools to access record sequentially /* Global database identifier */ U32 gAddBkDBaseID; STATUS seqAccessofRec(void) { U32 RecId,nextRecId; S32 srchToken = 1; U16 botFlag = 0; P_TEXT stdDataOut; 7-4 Database Management Database Management For More Information On This Product, Go to: www.freescale.com } while(srchToken) { DBGetNextRecID(g /* The RecId pa if(botFlag == 1) /* Read back dat DBReadData(gAddB . /* Do something . /* Continue sea RecId = nextRec } /* end whil /* end of seqAcc Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 8 8.4.2.1 Text output style Text Display The output style defines an operation between the text bitmap and the existing image at a specified display location. Five output styles are supported. The text bitmap can replace, OR with, AND with, exclusive OR with, or be inverted to replace the existing image. Applications must map th an area on the display sc seen. This chapter descr the display of text on the Table 8-1 Supported Output Styles Freescale Semiconductor, Inc... Output Styles Operation REPLACE_STYLE Replace OR_STYLE Or with AND_STYLE And with EXOR_STYLE Exclusive-Or with INVERSE_STYLE Invert and replace PPSM supports 16-bit te coded languages. The de Asian and English charac scalable and bitmap font fonts with size 8 x 10 and ISV. 8.1 8.4.2.2 Text Grey Levels Text Representat Both ASCII and Asian ch Depending on the hardware system, up to four grey levels (0 to 3) can be TEXT) system-wide. For supported. For details about the grey levels, refer to Section 6.4 - 1 bit-per-pixel Chinese, both GB and BI Graphics and Section 6.5 - 2 bits-per-pixel Graphics. The most significant byte zero-extended ASCII and most significant byte whi byte. Table 8-2 Supported Grey Levels Grey Level Values 8.4.3 Color BLACK Black DARK_GREY Dark Grey LIGHT_GREY Light Grey WHITE White 8.2 Text Display Are Text can be displayed an 2.3.2.2 - Panning Screen row by column format on Setting Font Attributes STATUS TextSetFont(U32 templateId, P_FONTATTR pFontAttr) Font attributes includes font type, font size (where applicable), and any attributes (e.g. outline) that's related to a particular font type. A font attribute data structure, called FONTATTR, needs to be filled with the desired values in order for these font attributes to be modified. These new font attributes will take effect when text is displayed using the text template which has these new values set. The following is the font attribute structure defined in ppsm.h: typedef struct { U16 U16 U16 U16 8-4 type; width; height; attrib; /* /* /* /* font type */ font width (in #pixels) */ font height (in #pixels) */ other font attributes */ Text Display Management Text Display Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 339 340 return PPSM_ERROR; Panning Display Screen Width 8.3.2 Deleting text templa y-coord 0 0 1 a b c 1 n-1 Example 8-2 Delete a 2 ........... .... m ROWS 352 353 354 8.4 Text Properties m-1 Figure 8-1 A Text Display Area on the Panning Display Screen 8.3 When a text template is n up space that is being us returned by TextCreate() ........... .... Freescale Semiconductor, Inc... x-coord ............... Panning Display Screen Height STATUS TextDelete n COLUMNS 2 ............................... Text Templates 8.4.1 /* Delete the text w if(TextDelete(tId) ! return PPSM_ERROR; Text properties describes the panning display scre template, include the pos text characters, the font a the text display area. Ref of a text template when i Setting Text Display STATUS TextSetDis U16 heig A text template refers to a collection of text properties that describes the text to be displayed. These text properties include font type, font size, grey level, output The text display layout of style, coordinates and size of the text display, and the position of the display soft cursor. These text templates are independent of the text itself and provide theboundary of the panning flexibility for applications to change the appearance of text in a collective and the upper left corner, and efficient manner. Applications can create and delete the text templates at theircharacters. The size of th to the size of the selected discretion on an as needed basis. The soft cursor in text is an invisible position the range of 0 and one le indicator showing where the text should be mapped. can display. 8.3.1 Creating text templates STATUS TextCreate(P_U32 templateId) In Figure 8-1, the text dis columns in size. This tex wishes. A text template needs to be created before any text can be displayed. A unique unsigned 32-bit text template identifier is returned from the system8.4.2 for each text Setting Text Outloo template created. This text template identifier is used for future references to the STATUS TextSetOu created text template. Refer to Table 8-4 for the default values of the text properties when a text template is created. The text outlook of a text to be displayed on the te Example 8-1 Create a text template take effect on subsequen 336 U32 tId; /* textId for the text template */ modified. 337 338 8-2 if(TextCreate(&tId) != PPSM_OK) Text Display Management Text Display Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 8.6 Text character cursor position P_U8 bit } FONTATTR, *P_FONTATT The character cursor position determines where within the text display area text will be displayed next. This position is relative to the origin of the text display area specified in the given text template. The range of valid cursor positions is zero8.4.3.1 Font Types through one less than the size of the text display area in number of characters. Eight font types are supp English fonts. Large Norm In Figure 8-1, the range of valid cursor positions is zero through (m * n - 1), and Normal is 16 x 16 Chines the current cursor position is 3 after "abc" is displayed as GB Normal (for backw in BIG5 code format. BIG 8.6.1 Setting the character cursor position Table 8-3 Support STATUS TextSetCursor(U32 templateId, U16 cursor) Freescale Semiconductor, Inc... Output Styles Setting the character cursor position of the text display area of the specified text SMALL_NORMAL_FONT template to the given value. Subsequent displaying of text start at this new character cursor position. SMALL_ITALIC_FONT Example 8-5 Set character cursor position LARGE_NORMAL_FONT 53 LARGE_ITALIC_FONT static U32 gTextId, gTmpTextId; . . . 279 /* Clear the text on the display and reset cursor */ 280 TextUnmap(gTextId); 281 TextSetCursor(gTextId, 0); GB_NORMAL_FONT CHINESE_NORMAL_FON BIG5_NORMAL_FONT 8.6.2 Reading the character cursor position BIG5_VARIABLE_FONT STATUS TextReadCursor(U32 templateId, P_U16 cursor) Note: Asian fonts a Applications can inquire the current character cursor position of a text display area 8.4.3.2 Font Sizes specified by a text template. The returned character cursor position is where text will be displayed next. If a scalable font engine i an application to specify Example 8-6 Set and read the character cursor position template. The minimum a U32 tId; /* text template id */ particular scalable font e TEXT moto[] = {'M', 'o', 't', 'o', 'r', 'o', 'l', 'a', 0};/* text to be displayed */ len; /* # chars to be displayed */ All the other font types ar curPos;/* cursor position */ and height of those font t U16 U16 . . . /* create a text template */ TextCreate(&tId); /* calculate # chars to be displayed */ len = Strlen(moto); 8.4.3.3 Special font a No other special font attr modify the font attributes /* set up text properties. */ TextSetup(tId, LARGE_NORMAL_FONT, EXOR_STYLE, 3, 102, 0, len, 6); /* set current character cursor position to beginning of 2nd row in the text template */ TextSetCursor(tId, len); /* display "Motorola" using the modified text properties */ 8-8 Text Display Management Text Display Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual reserved for future extensions and is set to zero. TextDelete(tId); . . . Freescale Semiconductor, Inc... Table 8-4 Text Properties Default Values Text Properties Default Value (x,y)-coordinate of the origin (top left corner) of the text display area (0, 0) Width of text display area in number of characters 0 Height of text display area in number of characters 0 Character cursor position relative to origin of text display area 0 8.5 Mapping functions are pr panning display screen a template. 8.5.1 Font type SMALL_NORMAL_FONT Font width 8 Font height 10 Special font attributes 0 Text grey level value BLACK Text output style OR_STYLE Example 8-3 Setting text properties U32 Text Mapping tId; /* text template id */ /* text to be displayed */ TEXT moto[] = {'M', 'o', 't', 'o', 'r', 'o', 'l', 'a', 0}; /* this is to initialize every ASCII character in 2-byte format with high byte being zero */ U16 len; /* # chars to be displayed */ FONTATTR fontAttr; /* font attributes */ . . . /* create a text template */ TextCreate(&tId); Displaying text STATUS TextMap(U The given text is displaye character cursor position described by the specifie There is no word-wrap fu characters of a word that text display area. Text dis end of the text display ar mapped, or when numCh on panning screen, chara available position, or (the at the end of the template without returning any erro Example 8-4 Display 333 STATUS DisplayString( 334 { 335 U16 len; /* length 336 U32 tId; /* textId . . . 341 /* get the string le /* calculate # chars to be displayed */ 342 if (len = Strlen(str len = Strlen(moto); 343 { 344 /* Set up the te /* subsequent text displayed with text template tId will be located at (102, 0), 345 if(TextSetup(tId length of moto characters wide and 6 characters high, starting at text cursor 346 return PPSM_ERRO position zero. */ 347 TextSetDisplay(tId, 102, 0, len, 6, 0); 348 /* Map the text 349 if(TextMap(tId, /* subsequent text displayed with text template tId will be exclusive OR'ed with 350 return PPSM_ERRO the existing image on screen, with grey level BLACK. */ TextSetOutlook(tId, EXOR_STYLE, BLACK); /* set up font attributes */ fontAttr.type = BIG5_VARIABLE_FONT; fontAttr.width = fontAttr.height = 20; fontAttr.attrib = 0; 8.5.2 Removing text STATUS TextUnmap /* subsequent text displayed with text template tId will be of BIG5 Variable font type of size 20x20 pixels. */ The TextSetFont(tId, &fontAttr); /* delete unused text template */ 8-6 unmapping of text m and size of the text displa template. Text Display Management Text Display Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual Personal Porta Program STATUS AlarmReadId(U32 alarmId, P_U16 year, P_U16 month, P_U16 day, TextMap(tId, (P_TEXT)m P_U16 hour, P_U16 minute, P_U16 second) /* read current charact case) */ Read the coming clock alarm time using AlarmRead() and read the specific clock TextReadCursor(tId, . alarm time by using AlarmReadId(). If no alarm is set, all arguments will return . zero. . 9.4 Setting Clock Alarm STATUS AlarmSet(U16 year, U16 month, U16 day, U16 hour, U16 minute, U16 second) Freescale Semiconductor, Inc... STATUS AlarmSetId(P_U32 alarmId, U16 year, U16 month, U16 day, U16 hour, U16 minute, U16 second) Set the clock alarm. When the alarm time is reached, PPSM will generate a soft interrupt to the application that called this tool. The interrupt message type will be IRPT_RTC. If AlarmSetId() is used, the alarm id. will be returned with the IRPT_RTC when time is reached. 9.5 Clearing Clock Alarm void AlarmClear(void) void AlarmClearId(U32 alarmId) Clear the clock alarm in current task using AlarmClear() or clear specific alarm using AlarmClearId(). PPSM will no longer generate the IRPT_RTC message to the application. 9.6 Setting Periodic Alarm STATUS SetPeriod(U16 period) STATUS SetPeriodId(P_U32 alarmId, U16 period) Set or clear the periodic alarm. PPSM generates periodic interrupts to the application that calls this tool. The HOUR periodic interrupt is applicable to MC68EZ328 only. If SetPeriodId() is used to set a periodic alarm, the alarm id. will be returned. The period that is allowed are: 9-2 RTC_PERI_NONE Disable periodic interrupt RTC_PERI_SECOND Second periodic interrupt RTC_PERI_MINUTE Minute periodic interrupt RTC_PERI_HOUR Hour periodic interrupt RTC_PERI_MIDNIGHT Midnight periodic interrupt Timer Management Text Display Management For More Information On This Product, Go to: www.freescale.com &c Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 9 Timer Manag PPSM uses one DragonB reference timer and the s microseconds and the sy tools are included for app alarm, clock alarm and ti Freescale Semiconductor, Inc... PPSM manages all the ti specific time-out or alarm appropriate alarm time o interrupt to notify the app The system default time Two types of interrupt me * * IRPT_RTC IRPT_TIMER IRPT_RTC message is s IRPT_TIMER message is If the timeout or alarm ha alarm task, the timer or a current task are handled 9.1 Reading System STATUS DateTimeR P_U16 m Read the system date an 9.2 Setting System D STATUS DateTimeS U16 sec Set the system date and 9.3 Reading Clock A STATUS AlarmRead P_U16 m 8-10 TextManagement Display Management Timer For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual RTC_PERI_NO_SECOND RTC_PERI_NO_MINUTE RTC_PERI_NO_HOUR RTC_PERI_NO_MIDNIGHT Freescale Semiconductor, Inc... 9.7 Setting Timeout STATUS Timeout(U STATUS TimeoutId( General time-out tool. PP caller once the time-out p immediately disable the t timeout set by reference which will be returned in IRPT_TIMER is the interr occurs. 9.8 Setting Input Tim STATUS InputTimeo Set the repetitive time-ou routine is an explicit time Once this time-out is acti immediately after a valid next pen input occurs, PP otherwise, the time-out p time-out because once a after each pen input stok IRPT_TIMER is the inter returned in IrptGetData() timer set by Timeout(), T To cancel the input timeargument. 9-6 Timer Management Timer Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 9.9 Continuous Reference Timer Compute the difference in is in millisecond resolutio PPSM provides a continuous 32-bit reference timer to applications. This 32-bitRefFineTimeDiff(). value wraps around about every 5 days, but PPSM takes care of the wrap-around Example 9-1 Timer U condition, making it transparent to the application. Applications can select to use either a resolution of 1 millisecond unit or 100 microsecond unit. The followingU32 (*TimeRead)(); tools allow the user to make use of this reference timer for functions, such as timeSTATUS (*TimeAlarm)(U32 a stamping and time-out. U32 (*TimeDiff)(U32 be . Note that there are two sets of timer tools, one for millisecond resolution, one .for STATUS 100 microsecond resolution. The reference value returned by these two separate { sets of tools should NOT be mixed. That is, values returned from the millisecond . . tools cannot be used in the 100 microsecond tools. Freescale Semiconductor, Inc... The millisecond resolution timer tools are named with prefix "RefTime", and the 100 microsecond resolution tools are named with prefix "RefFineTime". 9.10 Read The Reference Timer U32 RefFineTimeRead(void) Read the reference timer value. The return value is an unsigned 32-bit integer representing the current reference timer value, either in millisecond resolution for RefTimeRead(), or in 100 microsecond resolution for RefFineTimeRead(). Set Reference Timer Alarm STATUS RefTimeAlarm(U32 alarmTime) STATUS RefFineTimeAlarm(U32 alarmTime) STATUS RefTimeAlarmId(P_U32 alarmId, U32 alarmTime) STATUS RefFineTimeAlarmId(P_U32 alarmId, U32 alarmTime) Set the alarm time, using the reference value as reference. This is a relative alarm tool. When using this tool, the input argument is the time that the system will generate an alarm interrupt to the caller application. This value can easily be obtained by calling the respective RefTimeRead() or RefFineTimeRead() tool. The alarmId output from this functions will be returned in IrptGetData() once the alarm time is reached. 9.12 /* Initialize al } }/*while*/ }/*RefTimer*/ U32 RefFineTimeDiff(U32 beginTime, U32 endTime) Timer Management Timer Management For More Information On This Product, Go to: www.freescale.com = 0; = 0; = 0; /* Set up time f * to start the */ if (gUnit == MIL { /* Assign the * timer fun */ TimeRead = Re TimeAlarm = Re TimeDiff = Re } else if (gUnit== { TimeRead = Re TimeAlarm = Re TimeDiff = Re } SetUnit(MILLI_SE . if (*inData == P { . . if (id == { /* * * */ Compute Reference Times Differences U32 RefTimeDiff(U32 beginTime, U32 endTime) 9-4 while ( 1 ) { gOldTime gNewTime gDiffTime U32 RefTimeRead(void) 9.11 RefTimer(void) gOl gNe gDi Dis }/*if rea . . Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 10 Memory Man are driven by the system clock, power saving on the CPU core can be achieved without sacrificing peripheral response time. 11.2 Power Modes Freescale Semiconductor, Inc... In order for PPSM to man management tools provid Figure 11-1 shows the state diagram for the power modes. There are six modes its own memory tools tha defined in PPSM. allocate memory from the PPSM is specified in the System Internal Modes: Specification File). * Initialization mode Note: For allocatin * System mode allocation fun * Wake-up mode Graphics To Application Modes: * * * Normal mode Doze mode Sleep mode 10.1 Allocating Memo void *Lmalloc(U32 s Power On / Reset Normal void *Lcalloc(U32 si Memory can be allocated a pointer to a block of av returned to the caller is n Lcalloc() is used. No auto when used by the caller. through Lmalloc() can be Initialization If no memory is left in the System The actual size of memo requested by user. A hea memory management. N use the required size of m value is not NULL. Wake-up 10.2 Doze Freeing Memory Sleep void Lfree(void *ptr) System Internal Modes When an application finis Application Modes memory can be recycled into the system heap and Figure 11-1 PPSM Power Modes 11.3 The pointer passed into t Lmalloc() ,Lcalloc() or Lre System Internal Modes Initialization, System and Wake-up modes are only used internally by PPSM. 11-2 Memory Power Management Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 10.3 Reallocating Memory Chapter 11 Power Manag void *Lrealloc(void *src, U32 size) Moving of memory. This routine re-allocates the memory that is being used in the system from one location to another. It allocates a new area, then copies the PPSM utilizes the power content from the old location to the new area and free up the old memory, putting power management tools it back into the system heap. The purpose of this routine is for defragmentation of the system memory. The Power Management 10.4 * * Copying Memory * Freescale Semiconductor, Inc... STATUS MoveBlock(P_U32 srcAddr, P_U32 destAddr, U32 size) Copying memory from one region to another. This tool can cope with over-lapping * area. It performs memory copy in 32-bit operations whenever possible. switch to one of control the duty c Normal mode switch automatic idle control user defin transition Applications can choose 10.5 Inquiring Memory * * STATUS TaskMemUsed(U32 taskId, P_U32 pSizeUsed) control the syste use the PPSM's By default, the system w message waiting to be se period and sleep period c U32 TotalMemUsed(void) U32 TotalMemSize(void) S32 TaskStackAvail(void) 11.1 Power Control M Memory allocated to the application and the whole system can be inquired at run time. PPSM returns to the caller the total number of bytes of memory allocatedPPSM to makes use of the the task with the given task identifier when calling TaskMemUsed(), or numberefficiency. of It allows the al bytes of memory allocated to the whole system when calling TotalMemUsed().software control. System PPSM returns the number of bytes of memory on the system can be allocatedthe CPU via the PCM. By through Lmalloc(), Lcalloc() or Lrealloc() when calling TotalMemSize(). the CPU core from a min referred to as the CPU co PPSM returns to the caller the total number of bytes of stack can still be used by current task when calling TaskStackAvail(). Positive returned value indicates stack * While the CPU d application, the c has not been used up, negative value implies stack has already overflowed. * While the CPU d recognition appli User can inquire the size of the largest continuous memory block by calling 100% duty cycle Lmalloc() with input flag LARGEST_MALLOC_SIZE. The PCM uses a period o * For example, wit period of time, th clock cycles), fol Please refer to the MC68 PCM. When using the PCM to Phase Locked Loop rema 10-2 Management Power Memory Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Applications need not be are included in this chapt * agement. All of these are where PPSM takes contr swapping, message pass This automatic Sleep mode time-out countdown is repeatedly performed in Doze mode until the Sleep mode period is set to zero, i.e. disabling Sleep mode transi11.3.1 Initialization Mode tion. mode. If a Wake-up condition is met anytime during Doze mode before the time-out countdown for Sleep is reached, PPSM will reset the countdown and return the system to Wake-up mode. This is the power on or s PPSM occur in this mode PPSM is initialized, unles Any one of the following internal or external interrupts can wake up PPSM from Sleep mode. The interrupts are: 11.4.3.3 Waking up from Sleep Freescale Semiconductor, Inc... * * * 11.3.2 Pen Interrupt Real Time Clock Alarm, Periodic and Mid-night Interrupts External Interrupts from IRQ1, IRQ2, IRQ3, IRQ6, INT0-7, UART and PWM System Mode PPSM performs all of its power module controlling frequently invoked, only f ning, for example, to han For Mid-night interrupt, system will wake up from Sleep mode, update system To minimize the actual tim date and time and then go back to Sleep mode. For other interrupts listed above, regardless of its set value system will wake up from Sleep mode and go to Normal mode. leaves System mode, it w 11.5 Power Management Tools 11.5.1 Setting Duty Cycle 11.3.3 This is invoked either fro Sleep mode, only interna refer to Section 11.4.2.3 from Sleep for the Wake- U16 SetDutyCycle(U16 percentage) 11.5.2 Wake-up Mode This tool allows the application task to set the duty cycle level for itself in Normal In Wake-up mode, the sy mode. Applications within a system can have different duty cycle percentages. * which of the inte PPSM automatically changes the PCM accordingly when an application task * where the interru becomes active. * which application * which mode the Setting Doze Period For example, mid-night in STATUS SetDozePeriod(U16 millisecond) 1) Sets the countdown period, in units of millisecond, to switch the system from Nor- 2) mal mode to Doze mode. A value of PPSM_NO_DOZE disables the system from 3) going into Doze mode automatically which implies no automatically to sleep mode. A value of zero will bring back the system to default doze setting. The default doze 4) setting is to go to doze mode whenever there is no task swap nor message in current task to be handled. 11.4 11.5.3 Setting Sleep Period STATUS SetSleepPeriod(U16 second) Application Mod Normal, Doze and Sleep that an application sees a Sets the countdown period, in units of second, to switch the system from Doze 11-6 Go into Wake-up Determine that th Update the syste Go directly back Power Management Power Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 11.4.1 Normal Mode 11.4.2.3 Waking up fr Any one of the following In this mode, applications can make use of the Power Control Module to control Doze mode in MC68328. the CPU duty cycle value, please refer to Section 11.5.1 - Setting Duty Cycle . The Phase Locked Loop is on, all peripherals are active, LCD controller is enabled. * Pen Interrupt Application is actively executing code. * Real Time Clock * Timer 1 and Time PPSM is designed as an event driven system. It determines interrupt activities by * External Interrup monitoring the calls to the system tool IrptGetData(). * Freescale Semiconductor, Inc... * 11.4.2 When there are interrupts, IrptGetData() returns to the application with interrupt messages. These messages are processed by the application accordingly. When there is no more interrupt pending for processing, a special message, IRPT_NONE is returned to the application. For MC68EZ328, whatev wake up the system. The kind of interrupt to w able() and restored in Po The system can also be sage() to send message Doze Mode In this mode, the CPU is disabled to save power consumption. The LCD controlFor Mid-night interrupt, sy ler, Real Time Clock, Timer and Phase Locked Loop remain operational but alland time and then go bac other peripherals are disabled. System is waiting for interrupts to wake up the tem will wake up from Do CPU for more activities. There are two ways for applications to enter Doze mode: * * direct system call automatic time-out 11.4.3 Sleep Mode In this mode, * 11.4.2.1 Direct System Call To Doze Mode * CPU, Phase Loc disabled. Only the Real Tim Application can go into Doze mode directly by calling SetDozeMode(), please This is the mode where p refer to Section 11.5.4 - Going Into Doze Mode. In this operation, PPSM will put power consuming parts o the system into Doze mode immediately, until a Wake-up condition is met. 11.4.2.2 Automatic Time-out To Doze Mode There are two ways for a * direct system ca Application can set a time-out period for the system to go into Doze mode from * automatic time-o Normal mode. When PPSM detects that there are no more interrupt activities, either from the pen, timers, real time clock or external I/O, it will start this time-out 11.4.3.1 Direct System period countdown. When this time-out expires, it will switch the system to Doze mode. Application can go into S refer to Section 11.5.5 - G PPSM uses IRPT_NONE as an indication that the application is waiting for events the and is ready to go into Doze mode. The doze time-out countdown, if set, begins. system into Sleep mo Automatic Ti However, if a Wake-up condition occurs before the doze time-out has expired, 11.4.3.2 the doze time-out countdown is reset, and PPSM will return to the monitoring stage. Application can set a tim Sleep mode. This automatic Doze mode time-out monitoring is repeatedly performed in Normal mode until the Doze mode period is set to zero, i.e. disabling Doze mode transiWhen PPSM puts the sy tion. to Sleep time-out countd * 11-4 Power Management Power Management For More Information On This Product, Go to: www.freescale.com When this time-o Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual mode to Sleep mode. A v mode. 11.5.4 Going Into Doze Mo VOID SetDozeMode System goes directly to D up condition is met. 11.5.5 Going Into Sleep M Freescale Semiconductor, Inc... VOID SetSleepMod System goes directly to S up condition is met. 11.6 I/O Ports Contro For those I/O ports that a required as PPSM does n system integrator will nee to disable and enable the sitions. 11.6.1 Disabling I/O Port B VOID PortDozeDisa Just before PPSM goes i defined I/O ports that are code to disable the I/O p 11.6.2 Enabling I/O Port A VOID PortDozeEnab When PPSM wakes up fr user defined I/O ports tha their own I/O initialization 11.6.3 Disabling I/O Port B VOID PortSleepDisa Just before PPSM goes i defined I/O ports that are code to disable the I/O p 12-2 Power Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 11.6.4 Enabling I/O Port After Sleep Mode Chapter 12 VOID PortSleepEnable(VOID) Freescale Semiconductor, Inc... When PPSM wakes up from Sleep mode, it will call this routine to re-enable any user defined I/O ports that are not handled internally by PPSM. User must add in their own I/O initialization code in this routine. 11-8 Power Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 12 UART Comm APPLICATION Data Transmit H/W PPSM Access Permission Request (if not already) PPSM supports serial co IrDA mode. A set of interf data through the UART. Check Access Permission Request Access Granted / Denied 12.1 Data Sent Transmit Request & Data Freescale Semiconductor, Inc... The UART interface tools receive data serially with and Figure 12-2 for an ov between a calling applica transmission. Send Data To Hardware & Acknowledge Request Transmit Complete / Error PPSM monitors the use o and IrptRelease() (refer t tools will have effect only to access the UART. The Release Access Request Release Access & Acknowledge Release Access UART Communic Acknowledge Once permission is grant or receive data through th receive operation. The sa UART hardware is config Figure 12-2 UART Communication Architecture - Data Transmit 12.1.1 UART hardware flo In PPSM v3.11, data com communication devices u RTS is asserted automat hardware flow control is e sender, receiver needs to it's RTS pin. When Drago asserting RTS pin. Thus, communication device ar Three APIs are available UARTFlowCtrl(), UARTR be enabled or disabled b UARTSendCtrl(), PPSM transmission respectively An API, UARTSendAbor send buffer and number API can abort the transm 12-6 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 12.1.2 UART Interface Constraints APPLICATION Only one task in the system can access the UART at any one time. Except for inquiring current settings, an error code will be returned to the application if it Data Receive attempts to use the UART interface tools before permission is granted. Access Perm (if not alread Request Applications swapping is inhibited during UART data transmission and reception. Access Once a data transmission or reception request has been initiated by an application, pen touches on application icons will be ignored. This constraint prevents data loss due to suspension of the application which initiated the request. Freescale Semiconductor, Inc... The enforcement of these constraints requires cooperation among applications in initiating a request only when it is needed, and cancelling a request as soon as Request Receive data transmission or reception is completed. Grante Receiv Grante Data R Read Data & Determine End of Data Data Re Data R Abort Read Data Abort Re Release A Release Access Ackn Figure 12-1 UART Commun 12-4 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual mode, various baud rates, parity settings, stop bit settings, character length settings, and data transmission time out settings. When configured to operate in APPLICATION normal mode, the minimum and maximum baud rates supported are 300 bps (bits per second) and 115200 bps respectively. When configured operate in IrDA DatatoReceive Access Perm mode, only the 115200 bps baud rate is guaranteed. with RTS/CTS (if not alread Freescale Semiconductor, Inc... flow control 12.2.1 Request There is no default UART configuration after system start-up. Please make sure Access UART is configured properly by calling UARTConfigure() before initiating any data communciation. Grante Please note that the application must have the permission to access the UART before it can configure the UART. Refer to Chapter 15 - Interrupt Handling regarding the usage of IrptRequest() to request permission. Receiv Request Receive Configuring the UART Grante STATUS UARTConfigure(U8 mode, U16 baudRate, U8 parity, U8 stopBits, U8 charLen) Applications can use UARTConfigure() to reconfigure the UART to the required settings. Any on-going data transmission request will be aborted and the data transmission time out reset to the default. The actual baud rate will be the closest approximation to the specified baud rate. Table 12-2 shows the list of configurations and settings supported, and the corresponding selection flag to be used with UARTConfigure(). (Refer to Section 26.1 - UARTConfigure for details) Read Data Table 12-2 UART Configurations and Supported Settings & Determine End of Data Configurations Operating Mode Baud Rate Parity Supported Settings * * Normal NRZ mode IrDA mode * * * * * * * * * * * * 300 bps 600 bps 1200 bps 2400 bps 4800 bps 9600 bps 14400 bps 19200 bps 28800 bps 38400 bps 57600 bps 115200 bps * * * No parity Odd parity Even parity Data R Data Re Data R Abort Read Data Abort Rea Release A Release Access Ackno Figure 12-3 UART Communication Archit 12-10 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual APPLICATION Data Transmit with RTS/CTS flow control PPSM 12.1.3 UART Interface Inte H/W The UART interface com returned by IrptGetData( Interrupt Handling for det Access Permission Request (if not already) Check Access Permission Request Access After an application is gra transmission request. As IRPT_UART interrupt me following circumstances. Granted / Denied * Transmit Request & Data Check transmit Permission Freescale Semiconductor, Inc... Request Transmit Granted / Denied Assert RTS and Initiate TX timeout Pull Low RTS pin * Wait for end of transmission Complete / Error Send Data To Hardware & Acknowledge * Data Sent An error conditio UART_ERROR, the calling applic * UART_ERR_ once the tran * UART_ERR_ receive. * UART_ERR_ receive. * UART_ERR_ receive. * UART_ERR_ data before d Data has been re data, UART_DAT application. Data send reque data, UART_DAT application. Table 12-1 shows the ne with it during IrptGetData Negate RTS and Clear TX timeout Table 12-1 UART Pull High RTS pin Interrupt Message IRPT_UART Release Access Request Release Access & Acknowledge Release Access Acknowledge 12.2 UART Configura Figure 12-4 UART Communication Architecture - Data Transmit with RTS/CTS flow control PPSM allows application 12-8 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 12.4.1 Initiating a Receive Request Table 12-2 UA Configuratio Applications can receive data from the UART by calling UARTReceive() to initiate receive requests. A receive request will be accepted if both of the Number of Stop Bits following is true: * * the application has permission to access the UART (refer to Chapter 15 - Interrupt Handling) there is no other on-going receive request Character Length Freescale Semiconductor, Inc... Actual data receiving does not happen within the scope of UARTReceive(). If UARTReceive() returns success for the request, PPSM will handle12.2.2 the UART Inquiring the UART interrupts and start waiting for data in the background. The application will be able void UARTInquire(P to handle other interrupts (e.g. pen interrupts) in the foreground. stopBits, For power saving reason, system is in Doze mode during data reception. For fast data reception, it is recommended to disable the Doze mode before calling UARTInquire() provides t configuration settings of UARTReceive(). the corresponding config Note: Application swapping is disabled when there is an on-going rate. The actual baud rat receive request. Note: UARTInquire UART acces 12.4.2 Reading Received Data 12.2.3 Setting Data Transm When PPSM has received data from the UART, it will post an IRPT_UART interrupt message with message data UART_DATA_RECEIVED to the calling application. The calling application should then call UARTReadData() as soon as STATUS UARTTime possible to read the received data from PPSM. The data transmission tim As PPSM is receiving data from the UART, the following error conditions may hardware UART interrup deadlocking itself when t arise: * * * a frame error generated by the UART hardware a parity error generated by the UART hardware an overrun error when PPSM or the calling application is falling behind in reading the received data If RTS/CTS is enabled, a application will receive a period. If CTS is asserted interval between two har In any of the above error conditions, PPSM will post the IRPT_UART interruptThe range of time out va message with message data UART_ERROR and the corresponding error code. * Zero means disa These error related interrupt messages only serve as a notification to the calling * 1 to 60,000 mean application, and does NOT stop PPSM from continuing the receive request. The UART interrupts calling application should determine the appropriate recovery actions. (Refer to Section 15.1.9 - IRPT_UART for details about the UART interrupt message). If RTS/CTS is enabled, RTS pin is negated when PPSM running UARTReadData() and asserted after data reading completed. 12.4.3 12.2.4 Terminating a Receive Request A receive request will be terminated under the following circumstances: * 12-14 If a timed out error condition occurs during the course of receiving data, PPSM will post the IRPT_UART interrupt message with message data UART_ERROR and the corresponding error code. Setting Data Transm STATUS UARTSetD In order to communicate transmitting data in a bur accuracy of transmission between each transmissi interrupts). In Example 1 UART to HyperTerminal between each UART har UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual The range of delay values supported is 1 to 60,000. * * Example 12-2 Initiati UART_TXDELAY_CLEAR means clear the delay during transmission 1 to 60,000 means allowing the delay interval between two hardware UART interrupts to be 100 microsecond to 6 seconds. Example 12-1 Setting delay within transmission 12.3.2 ..... IrptRequest(IRPT SetDozePeriod(PP UARTSend(UART_SE ..... Terminating a Send Freescale Semiconductor, Inc... ..... ..... 12.3 IrptRequest(IRPT_UART_FLAG); A send /* Enable RTS/CTS flow control */ UARTFlowCtrl(UART_RCTS_ENABLE); * /* Configure UART */ UARTConfigure( UART_NORMAL_MODE, UART_115200_BPS, NO_PARITY, ONE_STOP_BIT, EIGHT_BIT_CHAR); /* Set a 600 us delay between each hardware interrupt */ _UARTSetDelay(UART_TXHALF_DELAY, 6); /* release irpt */ IrptRelease(IRPT_UART_FLAG); * Sending Data to the UART STATUS UARTSend(U8 sendFlag, P_U8 data, U16 dataLen) Refer to Figure 12-2 and Figure 12-4 for an overview of the data transmit architecture. 12.3.1 * request will be te After PPSM finis interrupt messag calling applicatio (Refer to Section interrupt messag If a timed out err data, PPSM will message data U This marks a fail determine the rec after time out ha An application ab UARTSend() or U The calling application sh IrptRelease() as soon as Initiating a Send Request It is recommended to forc Applications can send data out to the UART by calling UARTSend() to or a transmission is comp initiate send requests. A send request will be accepted if both of the following are true: * * the application has permission to access the UART (refer to Chapter 15 - Interrupt Handling) there is no other on-going send request Note: Application s completed o Example 12-3 Termin Actual data sending does not happen within the scope of UARTSend(). If UARTSend() returns success for the request, PPSM will handle the UART interrupts and start sending data in the background. The application will be able to handle other interrupts (e.g. pen interrupts) in the foreground. ..... /* Abort send. S /* .. sent in gp UARTSendAbort(UA IrptRelease(IRPT SetDozePeriod(0) ..... The calling application cannot modify the content of the data buffer during the entire course of the send request. 12.4 Receiving Data f If RTS/CTS hardware flow control is enabled, PPSM only transmits data through STATUS UARTRece UART when CTS pin is asserted by receiver. STATUS UARTRead For power saving reason, system is in Doze mode during transmission. However, to Figure 12-1 and transmission speed is reduced. For fast data transmission, it is recommended Refer to architecture. disable the Doze mode before calling UARTSend() which is shown in Example 12-2. Note: 12-12 Application swapping is disabled when there is an on-going data transmission. UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual * This marks a fail should determine is aborted after t An application ab UARTReceive() The calling application sh is not needed anymore. It is recommended to forc reception or a reception i Freescale Semiconductor, Inc... Note: 12.4.4 Application s terminated. Setting Data Recep If RTS/CTS is enabled, a time out error depends o application will not receiv is off. On the other hand, if no data arrived within th programmer is prefer to s UARTReceive() to avoid Example 12-4 Setting ..... IrptRequest(IRPT_UART_ UARTTimeout(1000); /* UARTReceive(UART_RECEI RefTimeAlarmId(&RxAlar ..... if(*inData==UART { DeleteTim UARTReadD ..... } 12.5 UART hardware 12.5.1 Enabling RTS/CTS Applications can enable UARTFlowCtrl(UART_RC when calling RTS/CTS fl returned to the applicatio 12.5.2 Disabling RTS/CTS Applications can disable UARTFlowCtrl(UART_RC after disabled hardware f 12-18 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual ignored by the system. RTS is asserted after disabled RTS/CTS flow control. 12.7.2 12.6 Data reception with hardware flow control 12.6.1 Pause data reception Continue data trans Applications can continue UARTSendCtrl(UART_R Error code PPSM_ERR_ enabled. After RTS/CTS hardware flow control is enabled, PPSM automatically pauses data reception once internal UART buffer (not FIFO) is full. Data reception is resumed after data is read out by UARTReadData() in application. If the interval of CTS remain negated is longer than the time out period, time out error will occur. Freescale Semiconductor, Inc... Applications can pause data reception of UART when hardware flow control is enabled. Error code PPSM_ERR_RCTS_IDLE is returned if hardware flow control is not enabled. Applications can resume data reception by calling UARTRcvCtrl(UART_RCTS_CONT). There will be no receive timeout error occur after pausing the data reception. Because the purpose of UARTTimeout( ) is mainly for avoiding the system stays in dead loop when transmitting or receiving data. User can set a timeout by calling RefTimeAlarmId( ). The receive timeout is restarted when data reception is resumed by calling UARTRcvCtrl(UART_RCTS_CONT). 12.6.2 Continue data reception Applications can continue data reception which has been paused by UARTRcvCtrl(UART_RCTS_PAUSE) when hardware flow control is enabled. Error code PPSM_ERR_RCTS_IDLE is returned if hardware flow control is not enabled. 12.7 Data transmission with hardware flow control 12.7.1 Pause data transmission Applications can pause data transmission of UART when hardware flow control is enabled. Error code PPSM_ERR_RCTS_IDLE is returned if hardware flow control is not enabled. Applications can resume data transmission by calling UARTSendCtrl(UART_RCTS_CONT). There will be no transmit timeout error occur after pausing the data transmission. Because the purpose of UARTTimeout( ) is mainly for avoiding the system stays in dead loop when transmitting or receiving data. User can set a timeout by calling RefTimeAlarmId( ). The transmit timeout is restarted when data transmission is resumed by calling UARTSendCtrl(UART_RCTS_CONT). 12-16 UART Communication Support UART Communication Support For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual Personal Porta Program Chapter 13 Task Manage needs to be swapped in later by AdvSendMessage() with SWAP_TASK_BACK_LATER, the current task will be put in the head of the queue while it's swapped out. Freescale Semiconductor, Inc... If the current task is parent task and there is no more message to be handled, the system will check whether there is need to swap to next parent task in the queue. Each application running If there is no more main task to be swapped in, the system will check from theof PPSM tasks: head of subtask to see whether any subtask needs to be swapped in. The subtask to be swapped in may due to message in the queue or the task swapping flag in * main task - appli * sub-task - task th the subtask is on. sub task. If the current task is subtask and there is no more message to be handled, the system will check whether there is need to swap to the next subtask in the headThe of task management to subtask queue. If not, system will check for the parent and then rest of the subtask * Create a main ta to see whether they need to be swapped in or they have message to handle. If no * Start execution o more message or task to swap in, system will check the head of the main task * Terminate execu queue to see whether it needs to be swapped in. Task switching can be disabled by calling AppSwap(FALSE). AppSwap() is a This chapter describes ho PPSM tasks. function to stop task swapping while the system is transferring UART data or any other critical operations. If the AppSwap(FALSE) is called several times, the same Message passing or task number of times of AppSwap(TRUE) must be called to let the task switching active task and any other main t again. the panning screen param task will affect the pannin belonging to the same m 13.4 Message Broadcasting 13.5 If the application programmer stores the task id, including main and sub tasks, into 13.1 Main Task a global list, message can be broadcasted to this list of task by using AdvSendmessage() with or without task switching. Most applications fall into each other. There canno They are created by the Task Control main task is created, the If the application programmer stores the task id, including main and sub tasks, into * By using the sys a global list, the task swapping sequence can be controlled by using * By pressing the a AdvSendMessage() with or without message passing. However, those task on the * By messages se task swapping queue will not be affected. So if a task is already on the task swapping queue, nothing can be used to change it. For those task not being on System Task swapping queue, AdvSendMessage() can be used to put it into the13.1.1 task swapping queue. The earlier the task is put into the task swapping queue, the higher priority System task is a special the task will be swapped in. terminated since creation defined in SPC file so it c In task swapping, PPSM will check whether there is other main task to swap to can be deleted and repla before checking the sub tasks of current main task. method: The system will always check to see whether their are any messages need to be handled within the family and swap to that member task to finish the job. Example 13-1 Sharin Sometimes the message in current task are cleared and SWAP_TASK is called variable immediately to other member of the family. This task may be swapped bad later as /* Global variable for the memory for the last message is not free yet. Message is still in the task until U32 gPanScreen; next IrptGetData() is called. And next task swapping for SWAP_TASK_LATER in that task will be next IrptGetData() after the one freeing last message's memory. STATUS TaskApp() 13-4 Task Management Task Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual { PAN_SCREEN tempScreen; 13.2.1 Sub-task Managem tempScreen.panAddress = tempScreen.displayScreenAddr = gPanScreen; When the active area of tempScren.horzSize = 160; the current task. tempScreen.vertSize = 240; tempScreen.displayXOrigin = tempScreen.displayYOrigin = 0; tempScreen.regPOSR = 0; The IrptGetData() tool is tempScreen.regPSW = tempScreen.horzSize/PIXELS; /* where PIXELS=8 if the LCD pending among a main ta is set to 2 bits/pixel and PIXELS=16 if the LCD is set to 1 bit/pixel. */ current main or sub-task or its sub tasks, task /* Set the panning screen of current task to the sharing panning screentask */ ChangePanning(tempScreen, 0); If there are multiple sub-t most recently swapped o system is ready to restar of the queue. while(1) { .... } Freescale Semiconductor, Inc... } main() { U32 taskAppId; PAN_SCREEN tempScreen; 13.3 Task Switching When the task is started task application. When th current Program Counter resume execution from w /* PPSM Initialization */ PPSMInit(FALSE); /* Get screen memory */ gPanScreen = (U32)GetScreenMem(160, 240); /* Assign panning screen parameters */ Example 13-2 Task s tempScreen.panAddress = tempScreen.displayScreenAddr = gPanScreen; tempScren.horzSize = 160; tempScreen.vertSize = 240; TaskApp1() tempScreen.displayXOrigin = tempScreen.displayYOrigin = 0; { tempScreen.regPOSR = 0; TaskInit(); tempScreen.regPSW = tempScreen.horzSize/PIXELS; /* where PIXELS=8 if the LCD 1 /* Delete the default system panning screen and assign the new panning screen to system task */ ChangePanning(tempScreen, 0); /* Create a main task without application icon nor panning screen */ AdvTaskCreate(taskAppId, TaskApp, 0, 0, 0, 0, 2048, PPSM_SCREEN_NOSCREEN, 0, 0, NULL); while(TRUE) { switch(I ...... ...... } TaskStart(taskAppId); } 13.2 13-2 At arrow 1, TaskApp1() is also started for the first ti TaskApp1() is swapped b Sub-task, on the other hand, can be active at the same time as the parent task that generated the sub-task and other sub tasks with same parent task. A main If the task is swapped by task can create multiple sub-tasks. These sub-tasks are queued in the reversebeing SWAP_TASK or S order they are created initially. However, the order may be changed when any sub task is swapping in or out by using SendMessage() or AdvSendMessage(). If the task is swapped by parameter being SWAP_ Sub-task uses the display resource, hardware cursor and input pad of its parent immediately. It will be sw and can only be created with the system tool SubTaskCreate(). task are handled. If the ta parent of the other family Sub-tasks are tied to the parent task. If the parent task is swapped out or terminated, the sub-task will be swapped out or terminated too. Sub-task inherits All tasks to be swapped i the input pad properties from the parent task at creation. There can only be one swapped out will be put a input pad among the main task and its sub-tasks. Sub-task Task Management Task Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual This tool launches a task that has been created by the tool TaskCreate() 13.6 or Task Swapping E AdvTaskCreate(). This routine never terminates. It takes the task identifier as input TaskAppA() argument and begins execution of the task. Since this tool may prevent the application caller from executing again, it should always be called at the end of { SubTaskCreate(&s main() to start the first task. SubTaskCreate(&s AdvSendMessage(t ..... while(1) { IrptGetDa .... } Example 13-4 Start a task 59 . . . 91 92 Freescale Semiconductor, Inc... 13.11 U32 SlideTask; /* Task id for slide */ /* Slide is the default task to be run when the system starts up */ TaskStart(SlideTask); Termination of a Task STATUS TaskTerminate(U32 taskId) Termination of a task. The task identifier can be of a main or sub-task. All system memory associated with the task and its sub-tasks that are allocated by PPSM are freed, such as stack memory and screen, if any. Any memory that was explicitly allocated by the task through Lmalloc(), Lcalloc() or Lrealloc(), is not going to be freed by the system because that area may be shared by several tasks. That area can be freed by calling Lfree() in application program. A task cannot terminate itself. If it is a sub-task, it cannot terminate its parent task either. 13.12 Task Reinitialization STATUS TaskReInit(U32 taskId, U16 flag) This tool will set the reinit flag in the specified task. If the flag is TRUE, whenever the task is swapped in, it will start at the beginning of the task function. However, application programmer needs to handle the cleaning up of memory in task swapping using TaskHook(). In task swapping, the PC and stack, etc. will be restored to the value when the task is not executed. This function must be called immediately after TaskCreate() or AdvTaskCreate() when the task is created. This function can be called to disable the task reinitialization at anytime but cannot be called to enable the reinitialization again. 13.13 13-8 } TaskAppB() { SubTaskCreate(&s SubTaskCreate(&s ..... While(1) { IrptGetDa ..... } } SubTaskAppA1() { ..... While(1) { IrptGetDa ..... } } SubTaskAppA2() { ..... AdvSendMessage(t ..... While(1) { IrptGetDa ..... } } SubTaskAppB1() { ..... While(1) { IrptGetDa ..... } } SubTaskAppB2() { ..... AdvSendMessage(t AdvSendMessage(t AdvSendMessage(t STATUS TaskHook(U32 taskId, P_VOID entryCallback, P_VOID exitCallback) ...... While(1) { This tool will hook the entryCallback() and exitCallback() functions to the specified IrptGetDa task. When the task is swapped in, the entryCallback() will be called after updating ..... the registers. When the task is swapped out, the exitCallback() will be called } Task Hook Task Management Task Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual same manner as the exis allows the caller to speci required by the applicatio Task swapping sequence is A->B->A->A1->A2->B->B1->B2->B1->B->A->A1 settings for the panning s } Freescale Semiconductor, Inc... When task A is created, it will create subtask A1 and subtask A2. These 2 * PPSM_SCREEN subtasks wouldn't be executed until IrptGetData() is called. However, * PPSM_SCREEN AdvSendMessage() with SWAP_TASK_BACK_LATER is called before screenHeight an IrptGetData() so the next task is B. In task B, subtask B1 and subtask B2 are However, if eithe created. In IrptGetData() of task B2, it will swap back to A as the previous screenHeight, is command is SWAP_TASK_BACK_LATER. Then subtask A1 and subtask A2 will the linker specific be executed in sequence. In subtask A2, SWAP_TASK to B is executed so next task is B. In IrptGetData() of task B, it will swap to B1 as B1 is not executed yet. A default of 512 byte of m Then in IrptGetData() of subtask B1, it will swap to subtask B2. In subtask B2,argument is negative. SWAP_TASK_LATER is called for task B, subtask A1 and subtask B1. As the system will check for next subtask first, subtask B1 will be swapped in Example 13-3 Create IrptGetData() of subtask B2. In IrptGetData() of subtask B1, it will swap to B as it 57 main() will check for the parent after checking the next subtask. Then it will swap to task A 58 { and then A1 in IrptGetData() of these tasks as AdvSendMessage() is called for 59 U32 SlideTask; swapping task to A1 in subtask B2. Whenever SWAP_TASK_LATER is called60 for U32 UartDemoTask, . subtask in other family, the parent of the other family will be swapped in first. . 13.7 Creating a Task STATUS TaskCreate(P_U32 taskId, P_VOID procAddr, S16 xSrc, S16 S16 xDest, S16 yDest, P_U8 bitmap) . 66 67 68 69 70 ySrc , 71 72 /* Create the UART * and a panning sc */ if (AdvTaskCreate(&U src_y[UART_ICON], PPSM_SCREEN_NEW, 0 return(PPSM_ERROR) PPSM needs to know the existence of each application task before the task can access PPSM resources. The main body of a PPSM system must13.9 call this routine Creating a Sub T once for each application. PPSM will create the necessary data structure and memory space required to run the application. An application icon is created for STATUS SubTaskCr each application with the coordinates as supplied in the argument list. The U16 num application is put to the foreground whenever this icon is selected. This tool does not start the execution of the application. It registers the task with PPSM only. Creating If a sub-task. Any the user does not want to have an application icon, the user should set either task is itself a sub-task, t width or height to be zero(xSrc = xDest or ySrc = yDest). Hence, there is no parent(ie. the calling and application icon to be created. task has already created to the head of the sub-ta By default, a screen is created with the task. PPSM uses the system default task a parent task can cr physical size as the dimension for this screen. The default physical size is specified in the Linker Specification File, as described in Chapter 34 - Linker This routine accepts varia Specification File. into the sub-task by PPS input arguments. A 2K byte of memory is allocated for each task as the task's stack. 13.8 Creating a Task with Specific Task Parameters Subtask will be started w handled and there is no n the IrptGetData() routine STATUS AdvTaskCreate(P_U32 taskId, P_VOID procAddr, S16 xSrc, S16 ySrc, S16 xDest, S16 yDest, S32 stackSize, U16 newScreen, 13.10 U16 Starting screenWidth, U16 screenHeight, P_U8 bitmap) Creation of a new PPSM task. This tool creates a PPSM application task in the 13-6 Task Management Task Management For More Information On This Product, Go to: www.freescale.com a Task STATUS TaskStart(U Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual before storing the registe In the above example, task B will be put on the head of task swapping queue and then task C will be put after task B. So when all messages in task A are handled, one input parameter func system will swap to task B. When all messages in task B are handled, system task will id. for the task just s swap to task C. be the task id. for the tas Note: 14.1.1 If UARTSend() or UARTReceive() is called, no task swapping can be happened in any case until transmission or reception is aborted. It is applied to all task swapping cases discussing in this chapter. With Delayed Task Swapping This function can be calle the task, the entry routine function. Example 13-5 TaskH TaskApp1() { TaskInit(); Freescale Semiconductor, Inc... e.g. STATUS Entry(U32 p VOID EntryR(U32 oldId) { ...... } TaskApp2() { TaskInit(); while(TRUE) { switch(IrptGetData... ...... SendMessage(TaskApp2Id... ...... } 1 2 while(TRUE) { switch(IrptGetData... ...... ...... } VOID ExitR(U32 nextId) { ...... } Task1() { Task1Init(); TaskHook(task1Id EntryR(0); 3 While(1) In the diagram above, TaskApp1() will call SendMessage() to send a message to .... TaskApp2(). However, the active TaskApp1() will not be swapped out. It will still } be active until it executes IrptGetData() as in arrow 1. Then, TaskApp2() will be swapped back in as in arrow 2. Message from TaskApp1() will be received in If TaskHook() is called ou automatically once the ta IrptGetData() of TaskApp2() as in arrow 3. The task swapping happens when all messages in TaskApp1() are handled. 13.14 14.1.2 14.1.3 Stop task swapp This will happen if SendMessage() or AdvSendMessage() with SWAP_TASK_LATER are used. The target task will be push into the tail of main void AppSwap(U16 task swapping queue if the target task is main task or the tail of sub task swapping queue otherwise. If flag is FALSE, no task SendMessage() or AdvS the message will be sent With Immediate Task Swapping executed. This function w FALSE several times, the In AdvSendMessage(), if the flag is SWAP_TASK, message passing and task before task swapping is a swapping will happen inside AdvSendMessage() immediately if the pen is not touching the panel. With Immediate Task Swapping and Delayed Swap Back In AdvSendMessage(), if the flag is SWAP_TASK_BACK_LATER, message passing and task swapping will happen immediately inside AdvSendMessage() if the pen is not touching the panel and the current task will be put into the head of the task swapping queue. So when all messages are handled in target task, the current task will be swapped back. 14-2 Inter-Task Messaging Task Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 14 Inter-Task Me PPSM supports asynchro provided tools. This tool c different parent tasks. The sender task sends o structure using the tool S task identifier of the task Freescale Semiconductor, Inc... The receiving task receiv the same way as other in this message by the app The messaging tool enab * * * notify other appli pass data betwe swap to the spec The format of the data pa receiver must have their PPSM only performs the application task of the ar The AdvSendMessage() without message passing This can be used to send are called to send messa the system is in doze mo 14.1 Message Passin Message can be sent be SendMessage() will send the target task once all m AdvSendMessage() has message sent to the targ can be used to send mes as a purely message pas Example 14-1 Multip TaskA() { ...... SendMessage(task SendMessage(task ..... } 13-10 Inter-TaskTask Messaging Management For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 14.1.4 Message Passing w In AdvSendMessage(), if passing only and no task 14.2 Message Structu A pre-defined structure is Freescale Semiconductor, Inc... typedef struct _MESSAG { U16 mes U16 mes U32 mis P_VOID dat U16 siz U16 res } PPSM_MESSAGE, Name messageType message misc data size 14.3 Sending Messag STATUS SendMess This tool sends a messag 14-6 Inter-Task Messaging Inter-Task Messaging For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual The arguments returned the MESSAGE structure All data that the sender wants to send must be stored in the form of MESSAGE structure. No protocol or data format is put on the message data. The sender and IrptGetData Data Type receiver must have a mutual understanding of the representation of the data being transferred. return value STATUS not known, this tool cannot be used. 14.4 Advanced Sending Message sData P_U32 data P_U32* size STATUS AdvSendMessage(U32 taskId, P_MESSAGE msg, U8 flag ) P_U32 Freescale Semiconductor, Inc... This is similar to SendMessage() except it enhances the task swapping control. Example 14-2 Receiv The flag can control whether the target task is swapped in immediately or later. It 73 STATUS UartDemo() also controls whether the current task will be swapped in again after all messages 74 { 75 P_U16 inData in target task are handled. 76 77 If msg is NULL, this is a task swapping control function without message passing. . If flag is NO_TASK_SWAP, this is a message passing tool without task swapping 134 control. 135 14.5 Deleting Message for Current Task STATUS MessageDelete(U16 type) 136 137 138 139 140 141 142 143 This is for deleting all messages in current task with the same type as the input parameter such as IRPT_PEN, IRPT_UART, etc. 14.6 Deleting Message for any Task STATUS AdvMessageDelete(U32 taskId, U16 type, U32 shortData) This is for deleting messages in specific task matching the type and shortData. The short data here refers to the area id. for active area, timeout id. for reference timer, etc. If taskId is 0xFFFFFFFF and the current task is a main task, all messages in main task queue with matching type and shortData will be deleted. If the taskId is 0xFFFFFFFF and the current task is a subtask, all messages with matching type and shortData in current sub task list will be deleted. If the type is 0xFFFF, all messages with matching taskId and shortData will be deleted. If type is 0xFFFF and shortData is 0xFFFFFFFF, all messages in the specific task will be deleted. 14.7 Receiving Message STATUS IrptGetData(P_U32 sData, P_U32 *data, P_U32 size) This tool is used to receive the messages sent by another task, as well as to receive the standard software interrupt message (see Section 29.1 - IrptGetData). 14-4 Inter-Task Messaging Inter-Task Messaging For More Information On This Product, Go to: www.freescale.com U8 U32 selected; size, id; . . while (1) { switch (IrptGetD { case IRPT_UART: switch (*inDat { case UART_DA /* Data ha Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 15 Interrupt Han PPSM maintains a set of internal hardware events aware of the characterist real time clock. The kern event and send them to t Freescale Semiconductor, Inc... PPSM maintains a uniqu hardware interrupt occur stored into this software PPSM and the applicatio if the application is slow i time interrupt of the perip PPSM_ICON_TOUCH and PPSM_INPUT_TOUCH PPSM_ICON_PEN_UP and PPSM_INPUT_PEN_UP P Hardware In Interrupt Ha PPSM_ICON_DRAG and PPSM_INPUT_DRAG Figure 1 PPSM has two distinct ty PPSM_ICON_DRAG_UP and PPSM_INPUT_DRAG_UP * * System interrupt User defined inte Figure 15-2 ICON and INPUT area pen status messages 15.1 15.1.5 15-4 System Interrupt IRPT_KEY These are interrupts that developers can make us PPSM provides a soft keyboard as part of the character input tool. Once hardware resources such activated, a keyboard is displayed on the display area. Pressing any one of the keys on the soft keyboard will result in a IRPT_KEY message generated by PPSM Table 15-1 shows the list to the application. The message will also include the ASCII code of the key that was pressed. The ASCII code returned is of type TEXT, i.e. 2-byte format with zero extended in high byte and the coordinate of pen touch on the key. Interrupt Handling Interrupt Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual to the application. Table 15-1 System Interrupt Identifiers Freescale Semiconductor, Inc... Interrupt Identifier Data from Handler IRPT_AUDIO PPSM Audio tools, indicating audio stopped N/A IRPT_HWR Handwriting recognition Data from handwriting recognition engine IRPT_ICON Icon input Message Icon active area identifier and status PPSM_INPUT_TOUCH IRPT_INPUT_STATUS Pen input with pen status Pen status information IRPT_KEY Soft keyboard input IRPT_NONE No interrupt Keycode, coordinate of pen PPSM_INPUT_PEN_UP touch PPSM_INPUT_DRAG_UP N/A IRPT_PEN Pen input Pointer to (x,y) list IRPT_RTC System clock alarm N/A IRPT_TIMER Timer timeout and alarm N/A IRPT_UART UART data transfer Data transmission status Table 15-2 Me PPSM_INPUT_DRAG messages. 15.1.4 IRPT_ICON Icon area is for the purpo from the pen interrupt ha a soft interrupt with its ide interrupts will be generat IRPT_AUDIO drag in, and one interrup It is a message generated from audio tools. An audio stops after it has finishedfor orbuttons, and selection IRPT_USER 15.1.1 Interrupt Source together with the pen sta coordinates are sent; the touch panel, this messag coordinate to report the p aware of the pen action s area, or it is a pen down, returned. Figure 15-2 sho User User defined the user has called AudioStopTone() or AudioStopWave(). After audio playing Table 15-3 shows the me stops, this interrupt is sent to the task that called AudioPlayTone() or AudioPlayWave() to indicate that the audio playing is finished. Table 15- 15.1.2 Message IRPT_PEN PPSM_ICON_TOUCH It is a message generated from a pen active area. When the application defines PPSM_ICON_DRAG an active area as pen area on the display, this message is sent to the application when pen input sequence occurs over this active area. The message returns the PPSM_ICON_PEN_UP coordinates of the pen input points. PPSM_ICON_DRAG_UP The data message returned by IRPT_PEN consists of a list of 16-bit words. Each pair of 16-bit words in the list represents the x and y coordinate of a pen input point on the touch panel. There will always be at least 1 pair of coordinate. A pair of (-1,-1) signals the end of the list. 15.1.3 IRPT_INPUT_STATUS This message is sent to the application to report the pen action status at the beginning and the end of each pen action within a valid pen active area. For example, when an active area created for pen input is touched, this message, 15-2 Interrupt Handling Interrupt Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Table 15-6 Interrupt Handler Flags Freescale Semiconductor, Inc... Interrupt Handler 15.1.6 Interrupt Flag SPI Slave IRPT_SPIS_FLAG(DragonBall only) IRQ1 IRPT_IRQ1_FLAG IRQ2 IRPT_IRQ2_FLAG IRQ3 IRPT_IRQ3_FLAG IRQ6 IRPT_IRQ6_FLAG INT0 - INT7 IRPT_INT_FLAG WatchDog IRPT_WDOG_FLAG PWM IRPT_PWM_FLAG UART IRPT_UART_FLAG User Defined IRPT_USER_FLAG IRPT_RTC This is the clock alarm. W message will be generate No data is included in thi 15.1.7 IRPT_TIMER Time-out message. This out period is reached. No 15.1.8 IRPT_HWR PPSM provides an input 5 - Character Input Meth resultant characters gene message. The data pass character candidates and The IRPT_USER is intended for internal software interrupt use. For15.1.9 example, user IRPT_UART defined interrupt messages to inform caller of particular event. Users can specify their own meanings to this message. When an application is g UART Communication S Example 15-1 Request an Interrupt Handler report UART data transm 203 204 205 /* request usage of UART */ if ( IrptRequest(IRPT_UART_FLAG) != IRPT_UART_FLAG ) return (PPSM_ERROR); A 16-bit message data is have one of the following . . . 216 217 Table 15/* Release the handler after use */ IrptRelease(IRPT_UART_FLAG); Message UART_DATA_SENT 15.3 Message Handling UART_DATA_RECEIVED STATUS IrptSendData(U16 irptType, U32 sData, P_U32 data, U32 size) UART_ERROR STATUS IrptGetData(P_U32 sData, P_U32 *data, P_U32 size) User can send messages, with or without extra data information, to the application using IrptSendData(). This tool can only be used within a user installed handler. When an application requested and has been granted access to a user installed handler, any messages sent by IrptSendData() from that handler will always be directed to that application, until the application has released the handler. IrptSendData() appends the message from the handler at the end of the application's software interrupt buffer. The receiving application retrieves the 15.2 Device Interrupts message via the system tool IrptGetData(), in the same manner as other system messages. PPSM supports another 15-8 Interrupt Handling Interrupt Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual . devices. The list of device interrupt identifiers are list in Table 15-515.2.2 Device Interrupt Ide Table 15-5 Interrupt Identifiers and User Defined Handlers Freescale Semiconductor, Inc... Interrupt Source 15.2.1 Interrupt Identifier The device interrupt iden handlers to send soft inte PPSM User Defined Handler much like the system pen IrptSendData(), to allow m _SPIMIrptHandler handlers to the applicatio SPI Master IRPT_SPIM SPI Slave IRPT_SPIS _SPISIrptHandler(DragonBall only) IRQ1 IRPT_IRQ1 _IRQ1IrptHandler IRQ2 IRPT_IRQ2 _IRQ2IrptHandler IRQ3 IRPT_IRQ3 _IRQ3IrptHandler IRQ6 IRPT_IRQ6 _IRQ6IrptHandler INT0 - INT7 IRPT_INT _INTIrptHandler WatchDog IRPT_WDOG _WatchdogIrptHandler PWM IRPT_PWM _PWMIrptHandler UART IRPT_UART _UARTIrptHandler User Defined IRPT_USER None User Defined Interrupt Handlers For example, user install message to the applicatio event, or to pass data fro 15.2.3 Application Access By isolating the interrupt have access to the same only be registered with a application is requesting first application making th handler until it is release To control access conflic hardware concurrently, a * * IrptRequest() IrptRelease() For each of the external interrupts not used by PPSM system, user can install their own handler. The generic, or stub, handler source is provided in the PPSM 15.2.4 Request device library. These are: * * * * * * * * * * SPI Master SPI Slave(DragonBall only) IRQ6 IRQ3 IRQ2 IRQ1 INT0 - INT7 Watch Dog PWM UART and Releas U32 IrptRequest(U3 STATUS IrptRelease When an application task it must first request for se successfully registers wit are directed to the registe handler. One application task can handlers in the system, b Each of the stub handler is associated with an external interrupt. For example,attached to one single ap _IRQ6IrptHandler is associated with the IRQ6 external interrupt. When the release the handler after external interrupt event occurs, PPSM automatically calls up the associated To request or release a h handler as part of the interrupt handling procedure. the interrupt tools to spec For system that uses any of the external interrupts, they can supply their own values representing indiv handler such that integration into PPSM is possible. Table 15-6 Int For PPSM source licensee, if _UARTIrptHandler() needs to be used, "Interrupt Handler DNO_UART_HANDLER" needs to be included in the compiler option to indicate that the internal PPSM UART interrupt handler need not be used. SPI Master 15-6 Interrupt Handling Interrupt Handling For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 16.1.1 Motorola Logo 15.3.1 Example Depending on the physical LCD size, an appropriate Motorola logo is displayedAssuming on that an applica the LCD display during pen calibration stage. PPSM, when the user de sent to the application im For LCD display that is larger than 280 pixels wide by 150 pixels high, the shortMessage = COMMAND standard logo will be displayed. This logo is 256 pixels wide by 97 pixels high, messageSize = 4; messageData = pInData; Figure 16-2. IrptSendData( IRPT_IRQ Freescale Semiconductor, Inc... The application retrieve t Personal Portable System Manager Software Licensed by Motorola Semiconductor H.K. Ltd. 1995-1999 Motorola Inc. switch (IrptGetData( & . . . case IRPT_IRQ6: /* IRQ6 event h if (event == COM . . . default; Figure 16-2 Standard Motorola logo In the above example, th application: For LCD display that is larger than 150 pixels wide by 80 pixels high, but smaller Table 15-7 than 280 pixels by 150 pixels, a smaller Motorola logo will be used. This smaller Motorola logo will be 104 pixels by 25 pixels, Figure 16-3. IrptSendDa Argument Figure 16-3 Small Motorola logo For LCD display that is smaller than 150 pixels wide by 80 pixels high, no Motorola logo will be drawn. 16-2 System Tools InterruptUsing Handling For More Information On This Product, Go to: www.freescale.com irptType IR sData sho data me size me Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 16 Using System PPSM provides additiona resources. 16.1 PPSM Initializatio STATUS PPSMInit(U Freescale Semiconductor, Inc... PPSM needs to be initial PPSM tools can be calle devices initialization and display. A device driver (PenInit.c the touch panel origin and This function should call coordinate of origin is the screen coordinate. The c touch panel in terms of d Org - (-10, -10) Touch Panel Figu The default touch panel c pixels by 240 pixels (phy An offset of 100 (in A/D o the edge of the touch pan The caller of CalibratePe logoFlag is FALSE, no lo cross-hairs (one at top rig displayed on the LCD scr hairs, in no particular ord Example 16-1 Initiali 62 63 15-10 Using System ToolsHandling Interrupt For More Information On This Product, Go to: www.freescale.com /* Initialize PPSM w PPSMInit(TRUE); Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 17 Audio Tools /* Display message to indicate the audio has stopped */ .... break; case IRPT_ICON: /* Click icon to stop the wave playing */ rv = AudioStopWave(); .... break; } 17.1 Audio Playing PPSM supports two type hardware limitation, the w The audio tools have the Freescale Semiconductor, Inc... * * * 17.2 Only one wave fi A wave file or ton Modulation) mod An interrupt "IRP called AudioPlay playing has finish Tone playing STATUS AudioPlayTone autoRepeat) PPSM supports tone play PWM module. Tone play and changeable frequenc resolution, the tone frequ Name toneData toneSize toneDuration 17-154 Audio Tools For More Information On This Product, Go to: www.freescale.com Audio Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name autoRepeat Description /* Play a melody with 100 AudioPlayWave((P_U8)waveDa To indicate if auto-repeat is needed or not STATUS AdvAudioPlay 0 - no autorepeat. repeat, U8 clksel) 1 - autorepeat. Example 16-1 PPSM tone playing Name /* 100Hz, 1000Hz, 500Hz and 600Hz */ U16 toneData[] = {100, 1000, 500, 600}; waveData waveSize Freescale Semiconductor, Inc... /* Play a melody with 4 different tone frequencies, each with 250ms duration */ #ifdef EZ328 AudioPlayTone((P_U16)toneData, 4, TONE_DUR_4HZ, 1); #else AudioPlayTone((P_U16)toneData, 4, 250, 1); #endif prescaler(see Dragon manual) repeat(see DragonBa manual) To stop the tone playing, a user can call AudioStopTone(). To check if the Audio Tools are currently being used, a user can call AudioInUse(). clksel(see DragonBal manual) Note: This is impossible to play a tone with value of frequency less than the value The sampling rate can be of duration, since the duration of this frequency is longer than the allowed SamplingRate = ( ( 16.58MHz ) duration. 17.3 For more detail informati Wave playing (DragonBall-EZ only) Example 16-3 PPSM PPSM audio tools can play back a PCM(Pulse Code Modulation) audio wave /* file that can be generated by many audio programs. Wave playing can be done byU16 two PPSM audio tools - AdvAudioPlayWave() and AudioPlayWave(). Some PWM wave data */ waveData[] = {...}; /* Play a melody with 100 /* 16kHz = 16.58Mz/(2 x 1 who AdvAudioPlayWave((P_U8)wav AdvAudioPlayWave() is provided for users with solid knowledge of PWM want to have advanced configuration details over the DragonBall-EZ PWM module. For most cases, AudioPlayWave should be used. The device driver functio TRUE for proper wave pl STATUS AudioPlayWave(P_U8 waveData, U32 waveSize, U8 samplingRate)his/her own PWM interru playing tools, the _PWMI Name Description waveData The pointer to the PCM audio wave signal 17.4 Stop waveSize Total number of data bytes occupied by An audio stops after it ha the audio signal samplingRate The requested sampling rate * SAMPLING_32KHZ * SAMPLING_16KHZ * SAMPLING_11KHZ * SAMPLING_8KHZ * SAMPLING_4KHZ Example 16-2 PPSM wave playing /* Some PWM wave data */ U16 waveData[] = {...}; 17-152 Audio Tools For More Information On This Product, Go to: www.freescale.com the audio p AudioStopWave(). After a called AudioPlayTone() o finished. Example 16-4 Stoppi /* Some PWM wave data */ U16 waveData[] = {...}; /* Play a melody with 100 AudioPlayWave((P_U8)waveDa switch( IrptGetData((P_U32 { case IRPT_AUDIO: Audio Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Freescale Semiconductor, Inc... Name Part III API Too Description areaId Returns an active area identifier. This identifier is used by the PPSM to refer to the active area until it is removed from the list. code Type of active area. It takes either one of the following two value: * ICON_AREA Area for icon * INPUT_AREA Area for pen input mode This argument is valid only if INPUT_AREA is selected. It can take one of the following modes: * STROKE_MODE One interrupt per input stroke * CONTINUOUS_MODE One interrupt per sampled points * CONFINED_MODE same as STROKE_MODE but pen confined within active area xSrc Top left x-coordinate of the active area ySrc Top left y-coordinate of the active area xDest Bottom right x-coordinate of the active area yDest Bottom right y-coordinate of the active area Return Value Name 18.3 Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier pointer PPSM_ERR_AREA_CODE Invalid area code PPSM_ERR_COORDINATE Invalid coordinates PPSM_ERR_NO_MEMORY Not enough memory ActiveAreaRead Syntax 18-2 Pen Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 18 Pen Input To 18.1 ActiveAreaDisab Syntax STATUS ActiveArea Freescale Semiconductor, Inc... Description Removes an active a specifies the entry th obtained from the Ac creates the active ar Parameter Name areaId Return Value Name PPSM_OK PPSM_ERR_AREA_ 18.2 ActiveAreaEnabl Syntax STATUS ActiveArea S16 ySrc Description Creates and enables area. An active area where a software inte the area when the returned to the applic Active areas can be the boundary of the display area are the display area, echoing Pen Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 18.8 AreaEchoDisable STATUS ActiveArea xDest, P Syntax Description STATUS AreaEchoDisable(U32 areaId) Reads the area coor identifier areaId spec Description Parameter Disables active area pixel echoing mode. Once disabled, all pen-input device selected pixels will not be echoed back on the LCD display. Echoing is disabled for all active input area by default. Parameter areaId Freescale Semiconductor, Inc... Name areaId xSrc Description Active area identifier ySrc Return Value xDest Name 18.9 Name Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier yDest Return Value Name AreaEchoEnable PPSM_OK Syntax PPSM_ERR_AREA_ STATUS AreaEchoEnable(U32 areaId) Description 18.4 ActiveAreaSuspe Enables active area pixel echoing mode. Once enabled, all pen-input device Syntax selected pixels will be echoed back on the LCD display. Echoing is disabled for all active input area by default. STATUS ActiveArea Parameter Description Name areaId Active area identifier Return Value Parameter Name 18-6 Suspend or re-enabl active area is suspen will remain in the ac again respond to pen Description Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com Name areaId Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Description Description Pops the top backgr flag Flag to indicate whether to suspend or restack. The active list enable the active area: top background activ * AREA_SUSPEND Suspend the active area Parameter * AREA_REENABLE Re-enable the active area Name Return Value None Freescale Semiconductor, Inc... Name Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier Return Value Name PPSM_OK 18.5 PPSM_ERROR ActiveAreaToFront Syntax 18.7 ActiveListPush STATUS ActiveAreaToFront(U32 areaId) Syntax Description STATUS ActiveListP Given the active area identifier, this tool will extract the element from the active Description area linked list and insert the element at the front of the list. Once the element is at the front of the list, it becomes the active area to receivePushes the current pen input if other active areas that are overlapping the same physical area. creates a new empt these areas is disabl Parameter to the new active list Name areaId The number of active stored internally in an Description Active area identifier. Must be a valid identifier returned by PPSM Parameter Name Return Value None Name Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier Return Value Name PPSM_OK 18.6 ActiveListPop Syntax STATUS ActiveListPop(void) 18-4 Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com PPSM_ERR_ACTIVE Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 18.10 Return Value Name Description ActiveAreaPositi Syntax STATUS ActiveArea S16 yDe None 18.14 Description IconScanOn This function will cha by areaId. Syntax Parameter void IconScanOn(void) Freescale Semiconductor, Inc... Description Name Switches on system application icon scanning for the current task. This is on areaId by default. xSrc Parameter ySrc Name xDest Description yDest None Return Value Return Value Name Name Description PPSM_OK None PPSM_ERR_AREA_ 18.15 PPSM_ERR_COORD PenCalibration Syntax STATUS PenCalibration(U16 logoFlag) 18.11 Description CtrlIconDisable This function performs pen calibration routine. It calls CalibratePen()(in Syntax peninit.c of the device driver library) to calibrate the touch panel. User may use different calibration method by changing CalibratePen() in peninit.c. The STATUS CtrlIconDis default driver will clear the screen and wait for pen data until 2 valid points for Description pen calibration are captured. Removes a predefin must be a valid activ Parameter Name logoFlag 18-10 Description TRUE - Put a Motorola logo on screen FALSE - No Motorola logo will be put. Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name Name iconId iconType Description The identifier of the predefined icon area to be removed Return Value Freescale Semiconductor, Inc... Name 18.12 Description PPSM_OK Successful operation PPSM_ERR_AREA_ID Invalid active area identifier CtrlIconEnable Syntax STATUS CtrlIconEnable(P_U32 iconId, S16 xSrc, S16 ySrc, U16 iconType) Description Adds a predefined icon area to an application. The icon area can be placed ) anywhere on the application's display area. The argument ( xSrc, ySrc Return Value specifies the position of the icon's top left corner. An area identifier is returned to the caller. Parameter PPSM_OK Name iconId Name PPSM_ERR_ICON_T Description Returns an area identifier. This identifier is used by the PPSM to refer to the predefined icon area until it is removed from the list. PPSM_ERR_COORD PPSM_ERR_AREA_ xSrc X coordinate for the predefined icon's top 18.13 IconScanOff left corner ySrc Syntax Y coordinate for the predefined icon's top left corner void IconScanOff(vo Description Switches off system current task. Parameter Name None 18-8 Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Return Value For MC68EZ328 only Sampling Period samplingPeriod>= 250 250>samplingPeriod>=125 125>samplingPeriod>= 62 62>samplingPeriod>= 31 31>samplingPeriod>= 15 15>samplingPeriod>= 7 7>samplingPeriod>= 3 3>samplingPeriod>= 1 Pen Sampling Rate 4Hz 8Hz 16Hz 32Hz 64Hz 128Hz 256Hz 512Hz PPSM_OK 18.16 PenEchoParam Syntax STATUS PenEchoP Description Return Value Freescale Semiconductor, Inc... Name Name This tool allows the system pen echoing. Description Parameter PPSM_OK Successful operation PPSM_ERR_PEN_RATE Invalid sampling period specified Name echoCol 18.21 ScanningOff Syntax void ScanningOff(void) Description Switches off touch panel scanning for the current application. All application active areas will not response to pen-input interrupt. echoWidth Parameter Return Value Name Description Name None PPSM_OK Return Value PPSM_ERR_COLOU Name PPSM_ERROR Description None 18.17 18.22 ScanningOn PenGetInput Syntax STATUS PenGetInp Syntax void ScanningOn(void) 18-14 Description Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Returns a single pair of X and Y coordinates of the pen-touch panel contact 18.19 PenSetInputOrg point. A set of -1 will be returned from this module if the pen is out of the touch panel range, i.e. pen up. Syntax Parameter STATUS PenSetInpu Name Description xPos Returns the X position of pen input point yPos Returns the Y position of pen input point Return Value Freescale Semiconductor, Inc... It allows the user to d terms of screen disp doing calibration/re-c logoFlag) at the devi Parameter Name PPSM_OK 18.18 Description Description Name Successful operation x PenSetInputMax y Syntax STATUS PenSetInputMax( S16 x, S16 y) Return Value Description It allows the user to define the bottom-right corner of the touch panel coordinate in terms of screen display coordinate. It is usually called when the PPSM_OK system is doing calibration/re-calibration and should only be called by CalibratePen( U16 logoFlag) at the device driver level. 18.20 Parameter Name Description PenSetRate Syntax x-coordinate of the bottom-right corner x Name STATUS PenSetRat of the touch panel coordinate in turn Description of screen display coordinate. y-coordinate of the bottom-right corner of the touch panel coordinate in turn of screen display coordinate. y Parameter Return Value Name PPSM_OK 18-12 To allow user to defin period set in an task effect after at least o Name Description Successful operation Pen Input Tools Pen Input Tools For More Information On This Product, Go to: www.freescale.com samplingPeriod Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Freescale Semiconductor, Inc... Name Description Description Switches on touch pa timeOut Length of time to wait between a written all application active stroke and recognition start in number of milliseconds with range of 0 to 1000. If it is Parameter zero, time-out is disabled. So, recognition will only start after writing a stroke in another input box. Name samplingTime It is the time between two pen samples. It has range of 0 to 1000 milliseconds areaClean cleans after each character input or notReturn Value 0 - do not clean 1 - clean stackSize the stack size of input pad subtask Return Value Name 19.2 Description PPSM_OK Successful operation PPSM_ERR_INPUT_PAD_OPENED Input pad is already opened - by the same task or its sibling sub-task or its parent task. PPSM_ERR_INPUT_PAD_WIDTH Invalid width PPSM_ERR_INPUT_PAD_HEIGHT Invalid height PPSM_ERR_INPUT_PAD_X_POS Invalid X-coordinate PPSM_ERR_INPUT_PAD_Y_POS Invalid Y-coordinate PPSM_ERR_PEN_RATE Invalid pen sampling time PPSM_ERR_PAN_INIT Panning screen has not been initialized PPSM_ERR_NO_MEMORY Not enough memory PPSM_ERR_TMOUT_VALUE Invalid time out value AdvOpenSoftKey Syntax STATUS AdvOpenSoftKey( U16 xPos, U16 yPos, U16 keyWidth, U16 keyHeight, U16 numCol, U16 numRow, P_U16 keyMap, P_U8 bitmap) Description Opens a soft keyboard module in a similar manner as the tool OpenSoftKey() but with advanced configuration details. It allows the caller to specify: * 19-2 location of the soft keyboard Character Pen Input Tools Input Tools For More Information On This Product, Go to: www.freescale.com None None Name Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 19 Character Inp 19.1 AdvOpenInputPa Syntax Freescale Semiconductor, Inc... STATUS AdvOpenI numCol, echoWid stackSiz Description Opens the input pa OpenInputPad() but w specify: * * * * * * * * position of the in number of rows a the width and the the echo ink colo the length of time the sampling rate if the system sho character is writt the stack size for Parameter Name xPos yPos numRow numCol areaWidth areaHeight echoCol echoWidth 18-16 PenTools Input Tools Character Input For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Freescale Semiconductor, Inc... Name * * * * Description PPSM_ERR_INPUT_PAD_OPENED Input pad already opened by the same task or its sibling sub-task or its parent task PPSM_ERR_INPUT_PAD_X_POS Input pad x-coordinate out of range PPSM_ERR_INPUT_PAD_Y_POS Input pad y-coordinate out of range PPSM_ERR_INPUT_PAD_WIDTH Input pad width out of range PPSM_ERR_INPUT_PAD_HEIGHT Input pad height out of range PPSM_ERR_NO_MEMORY Not enough memory width and height number of rows a the return code o the bitmap of the Parameter Name xPos yPos keyWidth 19.6 OpenSoftKey keyHeight Syntax numRow STATUS OpenSoftKey(U16 xPos, U16 yPos) numCol keyMap Description Opens a soft keyboard module for type-written English character input. A soft keyboard is drawn at the position specified by the application. Once the bitmap keyboard is opened, key-pressed interrupt messages (IRPT_KEY) are generated to the application when key icons on the soft keyboard module are pressed. Each individual key pressed generates an individual interrupt message. Only one soft keyboard is allowed for each application. The image that is Return Value covered by the pseudo keyboard is saved by the system automatically, which will be restored upon closing of the keyboard. Note that the image saved by the system is a snap-shot of the display screen at the time this tool is called. Any changes to this area by the application will not be recorded by the system. PPSM_OK Parameter PPSM_ERR_SKBD_ Name Description PPSM_ERR_PAN_IN xPos X-coordinate of the top left corner of the soft keyboard PPSM_ERR_INPUT_ EN yPos Y-coordinate of the top left corner of the soft keyboard PPSM_ERR_SKBD_ PPSM_ERR_SKBD_ PPSM_ERR_NO_ME Return Value Name 19-6 Name Description 19.3 PPSM_OK Successful operation PPSM_ERR_SKBD_X_POS Input pad x-coordinate out of range CloseInputPad Syntax Character Input Tools Character Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual STATUS CloseInputPad(void) Name Description PPSM_ERROR Closes the handwritten character input pad. The input pad image is removed from the panning screen display and no more 19.5 OpenInputPad handwriting recognition messages (IRPT_HWR) will be generated from the system to the application. The original image covered by the input pad is Syntax restored by the system. STATUS OpenInput Parameter U16 area Freescale Semiconductor, Inc... Name Description Description Opens the input pad None The input pad is draw input pad has numRo box is of size areaSiz Return Value Name 19.4 Description PPSM_OK Successful operation PPSM_ERR_PEN_INIT No active area found PPSM_ERR_INPUT_PAD_CLOSED Input pad is not opened Once the input pad (IRPT_HWR) are ge recognized. Each r message. Only one input pad covered by the input restored upon closin system is a snap-sho changes to this area input pad needs to b CloseSoftKey Syntax STATUS CloseSoftKey(void) The default length of Description Parameter Closes the soft keyboard module. Name The soft keyboard image is removed from the display area and no more key xPos pressed messages (IRPT_KEY) will be generated from the system to the application. The original image covered by the keyboard is restored by the system. yPos Parameter numRow Name numCol Description areaSize None Return Value Return Value Name PPSM_OK 19-4 Name Description Successful operation Character Input Tools Character Input Tools For More Information On This Product, Go to: www.freescale.com PPSM_OK Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual Parameter Name Name Freescale Semiconductor, Inc... newPanning Description PPSM_ERR_SKBD_ A PAN_SCREEN structure containing the properties to set to: * P_U32 panAddress Panning screen address * U16 horzSize Panning screen horizontal size * U16 vertSize Panning screen vertical size * U16 displayXOrigin x-coordinate of LCD display origin relative to panning screen * U16 displayYOrigin y-coordinate of LCD display origin relative to panning screen * P_U32 displayScreenAddr the LCD Display screen address used in hardware register Display Screen Address * U8 regPOSR the bit position offset used in hardware register POSR * U16 regPSW (Panning screen width * number of bit per pixel)/16 PPSM_ERR_SKBD_ flag FALSE if the old panning screen is not needed any more and TRUE if the old panning screen needs to be kept and returned in oldPanning oldPanning A PAN_SCREEN structure returned by the system containing the original settings: * P_U32 panAddress * U16 horzSize * U16 vertSize * U16 displayXOrigin * U16 displayYOrigin * P_U32 displayScreenAddr * U8 regPOSR * U16 regPSW Return Value Name PPSM_OK 20-2 Personal Porta Program Description Successful operation Graphics Character Input Tools Tools For More Information On This Product, Go to: www.freescale.com PPSM_ERR_NO_ME Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 20 Graphics Too All coordinates mentione * * * Freescale Semiconductor, Inc... 20.1 The range of vali Screen Width - 1 The range of val The range of val ChangePanning Syntax STATUS ChangePan P_PAN_ Description This function change The panning screen w 16 for 1 bit/pixel disp 19-8 Character Graphics Tools Input Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Return Value Name Name PPSM_ERR_PAN_AD Description PPSM_ERR_PAN_INIT Error when the current task has no panning screen PPSM_ERROR If any of xPos or yPos is 0 PPSM_OK Successful operation PPSM_ERR_PAN_W PPSM_ERR_PAN_H Hint The panning screen some cases, a comm To achieve that, the The LCD display origin is the co-ordinate of top left corner of the LCD displayand ChangePanning screen relative to the panning screen origin. Freescale Semiconductor, Inc... Hint 20.6 20.2 CursorGetPos ChangeWindow Syntax Syntax STATUS ChangeWin P_U16 o STATUS CursorGetPos(P_U16 xPos, P_U16 yPos) Description Description Returns the coordinate (*xPos, *yPos) of the hardware cursor of the currentThis tool will direct al task. If this function is called after calling CursorOff(), error will be returned aswill be changed on t no more information about cursor exists after calling CursorOff(). divisible by 8 for 2 b The original settings Parameter Parameter Name xPos Description Name Pointer to X coordinate of the top-left corner of the cursor yPos addr Pointer to Y coordinate of the top-left corner of the cursor width height Return Value Name oldAddr Description PPSM_ERR_CURSOR_INIT Error if cursor is never set or CursorOff() is just called. PPSM_ERR_PAN_INIT Error when the cursor is not set PPSM_ERROR If any of xPos and yPos is 0 PPSM_OK Successful operation oldWidth oldHeight Return Value Name PPSM_OK 20-6 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Name Description PPSM_ERR_WIDTH Invalid graphics output area width PPSM_ERR_HEIGHT Invalid graphics output area height PPSM_ERR_LCD_ST Hint Hint If (xSrc, ySrc) is (5, 1 rectangle with top lef This is used for displaying image which needs a long time to generate. The LCD with specified g image can be plotted in other memory area by using ChangeWindow(). When the image is drawn, it can be copied to the panning screen by calling ChangeWindow() and PutRec(). 20.4 Freescale Semiconductor, Inc... 20.3 ClearScreen Syntax ClearRec void ClearScreen(U Syntax STATUS ClearRec(U16 greyLevel, U16 xSrc, U16 ySrc, U16 width, U16 height, U16 style) Description Description Fills the whole panni Parameter Fills the given area with grey level indicated by greyLevel with style. Name Parameter greyLevel Name Description Return Value greyLevel Grey level of the line xSrc Top left x-coordinate of the rectangular area ySrc Top left y-coordinate of the rectangular area width 20.5 Width of the rectangular area in pixels height Height of the rectangular area in pixels Syntax style Output Style (AND_STYLE, OR_STYLE, EXOR_STYLE, or REPLACE_STYLE). Name None CursorGetOrigin STATUS CursorGet Description Return Value Returns the coordina Name 20-4 Description PPSM_OK Successful operation PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_WIDTH Invalid width PPSM_ERR_HEIGHT Invalid height Parameter Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Name xPos yPos Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 20.7 Name Description CursorGetStatus PPSM_ERR_CURSOR_INIT Syntax No more memory to create the hardware cursor information record PPSM_ERROR Error if the frequency cannot be set STATUS CursorGet Description 20.12 Returns the status of CursorSetOrigin Parameter Syntax Name STATUS CursorSetOrigin(U16 xPos, U16 yPos) status Freescale Semiconductor, Inc... Description Sets the LCD display screen origin to (xPos, yPos). Parameter Name Description xPos X coordinate of the display origin yPos Y coordinate of the display origin Return Value Name Return Value PPSM_ERR_CURSO Name Description PPSM_ERR_PAN_INIT Current task has no panning screen PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_OK Successful operation 20.8 PPSM_OK CursorInit Syntax Hint STATUS CursorInit( This must be used with LCDScreenMove(). 20.13 Description Changes hardware cursorHeight. The wi CursorSetPos Parameter Syntax STATUS CursorSetPos(U16 xPos, U16 yPos) Description Sets the top left corner position of the hardware cursor to be at (xPos, yPos) 20-10 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Name cursorWidth cursorHeight Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Sets the top left cor current task must ha panning screen. Ho exceeds the panning Return Value Name Description PPSM_ERR_PAN_INIT Error when the current task has no panning screen PPSM_ERR_CURSOR_INIT No more memory to create the hardware cursor information record PPSM_ERR_WIDTH If cursorWidth is larger than 31 PPSM_ERR_HEIGHT If cursorHeight is larger than 31 PPSM_OK Successful operation Parameter Name xPos Freescale Semiconductor, Inc... yPos Hint Return Value If the cursor is large, programmer may use InvRec() to implement a soft cursor. 20.9 Name PPSM_ERR_PAN_IN CursorOff PPSM_ERR_CURSO Syntax PPSM_ERR_LCD_X STATUS CursorOff(void) PPSM_ERR_LCD_Y Description PPSM_OK Turns off the hardware cursor permanently. Parameter 20.11 Name Description CursorSetBlink Syntax None STATUS CursorSetB Description Return Value Name PPSM_ERR_CURSOR_INIT Description Error if cursor is never set or CursorOff() is just called. This will set the hardw number of blinks per cursor is set on by ca Parameter PPSM_OK Successful operation Name 20.10 frequency CursorSet Syntax Return Value STATUS CursorSet(U16 xPos, U16 yPos) Description Name PPSM_ERR_PAN_IN 20-8 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter , STATUS DrawCircle(U16 greyLevel, U16 xCenter, U16 yCenter, U16 radius U16 style) Name Description xPos Draws a circle centered at (xCenter, yCenter) with radius and style as specified. yPos If dot width is greater than 1, a thick circle will be drawn. If both fill pattern mode and border mode are set, those area inside the circle Return Value which is not covered by border will be filled. If fill pattern mode is set and border mode is off, the area inside and on the circle border will be filled. Name Freescale Semiconductor, Inc... PPSM_ERR_PAN_IN Parameter PPSM_ERR_CURSO Name Description PPSM_ERR_LCD_X greyLevel Grey level of the circle xCenter X-coordinate of the center of circle yCenter Y-coordinate of the center of circle radius radius of the circle in number of pixels style Output Style (AND_STYLE, OR_STYLE, EXOR_STYLE or REPLACE_STYLE) PPSM_ERR_LCD_Y 20.14 PPSM_OK CursorSetStatus Syntax STATUS CursorSetS Return Value Name 20.18 Description PPSM_OK Successful operation PPSM_ERR_LCD_GREY Invalid grey level value PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_LCD_RADIUS Invalid radius PPSM_ERR_LCD_STYLE Invalid style Description This will set the hard video mode, or temp function is PPSM_CURSOR_R Parameter DrawDot Syntax STATUS DrawDot(U16 greyLevel, U16 xPos, U16 yPos, U16 style) Description Outputs a dot with grey level greyLevel onto the screen at position (xPos, yPos) with indicated style. 20-14 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Name status Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 20.16 Return Value Name Description DrawArc Syntax STATUS DrawArc(U style) PPSM_ERR_PAN_INIT Current task has no panning screen PPSM_ERR_CURSOR_INIT No more memory to create the hardware cursor information record Description PPSM_OK Successful operation Draws an arc from (x The arc is actually a (x1, y1) and (x2, y2) Hint Freescale Semiconductor, Inc... CursorInit() is called to set the hardware cursor width and height which ranges from 0 to 31 in pixels. CursorSetPos() is called to set the co-ordinate of the topIf dot width is greater left corner of the hardware cursor. Then finally, CursorSetStatus is called to turn the hardware cursor on. After CursorSetStatus() is called and hardwareIf both fill pattern mo cursor is on, CursorSetPos() and CursorInit() may be called to change theis not covered by the hardware cursor position or size with immediate effect without calling If fill pattern is set and CursorSetStatus() again. be filled. 20.15 Parameter DisplayMove Name Syntax greyLevel STATUS DisplayMove(U16 xPos, U16 yPos) x1 Description y1 This function is to replace the calling of LCDScreenMove() and CursorSetOrigin(). Whenever the user wants to display a region of panning x2 screen with top left corner of the display at (xPos, yPos) of the panning screen, y2 DisplayMove(xPos, yPos) should be called. style Parameter Name Description xPos X coordinate yPos Y coordinate Return Value Name PPSM_OK PPSM_ERR_LCD_G Return Value PPSM_ERR_LCD_X Name Description PPSM_ERR_LCD_Y PPSM_OK Successful operation PPSM_ERR_PAN_INIT Error when the current task has no panning screen PPSM_ERR_COORDINATE 20.17 Error when any part of LCD is going to DrawCircle display the region outside panning screen PPSM_ERR_LCD_ST Syntax 20-12 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual If dot width is 2, a squ is (xPos, yPos). If do yPos) will be drawn. Parameter Name Parameter greyLevel Grey level of the line xSrc X-coordinate of the source point ySrc Y-coordinate of the source point xDest X-coordinate of the destination point yDest Y-coordinate of the destination point Name greyLevel xPos yPos Dotted line drawing. This argument style accepts a number which represents an equal number of solid dots and skipped dots during line drawing. A value of 0 represents a solid line. Return Value dotLine Freescale Semiconductor, Inc... Description style Output Style (AND_STYLE, OR_STYLE, EXOR_STYLE, or REPLACE_STYLE). Name PPSM_OK Return Value PPSM_ERR_LCD_G Name Description PPSM_ERR_LCD_X PPSM_OK Successful operation PPSM_ERR_LCD_Y PPSM_ERR_LCD_GREY Invalid grey level value PPSM_ERR_LCD_ST PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_LCD_STYLE Invalid style 20.19 DrawEllipse Syntax 20.22 STATUS DrawEllips xLength, DrawRec Syntax Description STATUS DrawRec(U16 greyLevel, U16 xSrc, U16 ySrc, U16 xDest, U16 yDest, U16 dotLine, U16 style) Description Draws an ellipse cen in the x-axis, and yLe If dot width is greater Draws a rectangular outline with the top-left corner at (xSrc, ySrc) and bottom-If both fill pattern mo right corner at (xDest, yDest). which is not covered If dot width is greater than 1, a thick rectangle will be drawn. If both fill pattern mode and border mode are set, those area inside the rectangle which is not covered by the border will be filled. If fill pattern mode is set and border mode is off, the area inside and on the rectangle border will be filled. 20-18 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com If fill pattern mode is ellipse border will be Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name Name xSrc Description greyLevel Grey level of the ellipse xCenter X-coordinate of the center of ellipse yCenter Y-coordinate of the center of ellipse width xLength The length of the ellipse in x-axis in pixels dotLine yLength The length of the ellipse in y-axis in pixels style Output Style (AND_STYLE, OR_STYLE, EXOR_STYLE or REPLACE_STYLE) ySrc Freescale Semiconductor, Inc... style Return Value Name Description Return Value PPSM_OK Successful operation PPSM_ERR_LCD_GREY Invalid grey level value PPSM_OK PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_G PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_LCD_X PPSM_ERR_LCD_STYLE Invalid style PPSM_ERR_LCD_Y Name PPSM_ERR_LCD_ST 20.20 DrawHorz 20.21 Syntax DrawLine STATUS DrawHorz(U16 greyLevel, U16 xSrc, U16 ySrc, U16 width, U16 Syntax dotLine, U16 style) STATUS DrawLine(U Description yDest, U Draws a horizontal line from (xSrc, ySrc) to the right for width dots. Description If dot width is greater than 1, a thick horizontal line will be drawn. If dot width is Draws a line from (xS greater than 1 and the width of the horizontal line is 1, a square dot of size If dot width is greate indicated by dot width will be drawn. than 1 and (xSrc, yS If dotLine is non-zero, dotLine number of dots will be drawn with the specifiedby dot width will be d grey level; then, the dotLine number of dots will be skipped; then, the dotLine If dotLine is non-zero number of dots will be drawn; and so on. grey level; then, the Parameter number of dots will b Name greyLevel 20-16 Description Grey level of the line Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Parameter Freescale Semiconductor, Inc... Name Description xSrc Top left x-coordinate of the rectangular image to be stored ySrc Top left y-coordinate of the rectangular image to be stored width Width of the rectangular image to be stored in pixels height Height of the rectangular image to be stored in pixels bitmap Bitmap image to be displayed Name greyLevel xSrc ySrc xDest yDest dotLine Return Value style Name Description PPSM_OK Successful operation PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_WIDTH Invalid width PPSM_ERR_HEIGHT Invalid height Return Value Name PPSM_OK PPSM_ERR_LCD_G PPSM_ERR_LCD_X PPSM_ERR_LCD_Y 20.26 GetDisplayX PPSM_ERR_LCD_ST Syntax U16 GetDisplayX(void) 20.23 Description DrawVector Syntax Returns the LCD display screen width in number of pixels. STATUS DrawVecto pPoints, Parameter Description Name Description Draws lines to conn input. No connection specified by mode or None Return Value DrawVector() does n Name N/A Description The display screen width in pixels Hint 20-22 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual If dotLine is non-zero grey level; then, the number of dots will b Parameter Freescale Semiconductor, Inc... Name Description Parameter greyLevel Grey level of the lines numberOfPoints Number of points in the list pPoints Pointer to the list of points to be connected style Output style can be: * EXOR_STYLE * OR_STYLE * AND_STYLE * REPLACE_STYLE mode Name greyLevel xSrc ySrc height Mode should be set to TRUE if the first and last points need to be connected; otherwise, it should be FALSE dotLine Return Value Name style Description PPSM_OK Successful operation PPSM_ERROR numberOfPoints is 0 PPSM_ERR_LCD_GREY Invalid grey level PPSM_ERR_LCD_STYLE Invalid style PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate Return Value Name PPSM_OK PPSM_ERR_LCD_G PPSM_ERR_LCD_X Hint PPSM_ERR_LCD_Y If the output style is EXOR_STYLE, special care should be taken regarding PPSM_ERR_LCD_ST overlapped points. 20.24 DrawVert 20.25 ExchangeRec Syntax Syntax STATUS DrawVert(U16 greyLevel, U16 xSrc, U16 ySrc, U16 height, U16 dotLine, U16 style) STATUS ExchangeR bitm Description Description Swaps the image in specified location of now be displayed wh If dot width is greater than 1, a thick vertical line will be drawn. If dot width isstored at bitmap. greater than 1 and the height of the vertical line is 1, a square dot of size Note that the image indicated by dot width will be drawn. rectangle in the argu Draws a vertical line from (xSrc, ySrc) down for height dots. 20-20 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 20.32 LCDContrast Application program applications size inde Syntax STATUS LCDContrast(U8 contrast) 20.27 Description GetDisplayY Syntax This tool will pass the value of contrast to the contrast control PWM register. U16 GetDisplayY(vo The user needs to set or reset the contrast control PWM enable bit. Description Parameter Returns the display s Freescale Semiconductor, Inc... Name contrast Description Parameter An 8 bit values to pass to PWM Name Return Value None Name PPSM_OK Description Return Value Successful operation Name N/A Hint Application program applications size inde 20.28 GetLogicalX Syntax U16 GetLogicalX(vo Description Returns the current p the size that an app display screen (i.e. th screen). Parameter Name None 20-26 Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Return Value Return Value Name N/A 20.29 Description Name The panning screen width in pixels GetLogicalY 20.31 N/A InvRec Syntax Syntax U16 GetLogicalY(void) STATUS InvRec(U16 Description Freescale Semiconductor, Inc... Description Returns the current panning screen height in number of pixels. This value gives the size that an application can write to, which may be larger than theInverts the grey level LCD display screen (i.e. the whole image might not be displayed on the LCD Parameter display screen). Parameter Name Name xSrc Description None ySrc Return Value width Name N/A 20.30 height Description The panning screen height in pixels Return Value Name GetScreenMem PPSM_OK Syntax PPSM_ERR_LCD_X P_VOID GetScreenMem(U16 width, U16 height) PPSM_ERR_LCD_Y Description PPSM_ERR_WIDTH This tool will allocate appropriate memory for a panning screen of size width PPSM_ERR_HEIGHT and height. Parameter Name 20-24 Description width Panning screen width in pixels height Panning screen height in pixels Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 20.33 Name reserved Description LCDRefreshRate Syntax Reserved for future use STATUS LCDRefres Return Value Description Freescale Semiconductor, Inc... Name Description PPSM_OK Successful operation PPSM_ERR_LCD_X Invalid x-coordinate PPSM_ERR_LCD_Y Invalid y-coordinate PPSM_ERR_WIDTH Invalid width PPSM_ERR_HEIGHT Invalid height PPSM_ERR_LCD_STYLE Invalid style This tool will set the second. As the fram Refresh Rate Adjus Register and PLL Co closest possible val refreshRateSet will b the calling of LCDR called once more refreshRateSet. Parameter 20.37 SaveRec Name refreshRate Syntax refreshRateSet STATUS SaveRec(P_U8 bitmap, U16 xSrc, U16 ySrc, U16 width, U16 height, U16 reserved) Return Value Description Saves a rectangular bitmap image from the specified location on the panning screen to memory. PPSM_OK Name Parameter Name 20.34 Description LCDScreenMove Pointer to address where bitmap imageSyntax is to be saved bitmap STATUS LCDScreen xSrc Top left x-coordinate of the rectangular Description image area ySrc Top left y-coordinate of the rectangular image area width Width of the image in pixels height Height of the image in pixels Maps the LCD displa panning screen with screen. reserved Reserved for future use It is assumed that (x, Return Value Name PPSM_OK 20-30 Description Successful operation Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com This function is repla Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name Name style Description x New x-coordinate of the origin of the LCD Return Value display screen y New y-coordinate of the origin of the LCD display screen Name PPSM_OK Return Value PPSM_ERR_PAN_IN Name Freescale Semiconductor, Inc... PPSM_OK PPSM_ERR_GREY Description PPSM_ERR_LCD_X Successful operation PPSM_ERR_LCD_Y Hint This must be used with CursorSetOrigin(). PPSM_ERR_LCD_FO PPSM_ERR_LCD_ST 20.35 PutChar PPSM_ERROR Syntax PutRec STATUS PutChar(U16 greyLevel, P_U8 character, U16 xPos,20.36 U16 yPos, U16 font, U16 width, U16 height, U16 style) Syntax Description STATUS PutRec(P_ U16 styl This tool will put a 1 bit/pixel font image on 1 bit/pixel or 2 bit/pixel display depending on whether ppsm1.a or ppsm2.a is linked. Description Parameter Puts a rectangular bi panning screen. Name 20-28 Description Parameter greyLevel Grey Level of the character to put on panning screen character Pointer to the character bitmap xPos x coordinate of the top left corner where font is going to put yPos y coordinate of the top left corner where font is going to put font SMALL_ITALIC_FONT and LARGE_ITALIC_FONT font will be handled differently to generate the italic effect from a rectangular font bitmap. width Width of the character in number of pixels height Height of the character in number of pixels Graphics Tools Graphics Tools For More Information On This Product, Go to: www.freescale.com Name bitmap xSrc ySrc width height style Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name Name dbId Identifier of the database PPSM_ERR_LCD_Y recId Returns the identifier of the record added PPSM_ERR_WIDTH numFmt Number of additional formatted data fields in the record PPSM_ERR_HEIGHT 20.38 Return Value Name Freescale Semiconductor, Inc... PPSM_ERR_LCD_X Description Description SetDotWidth Syntax STATUS SetDotWid PPSM_OK Successful operation PPSM_ERR_DB_DBID Invalid database identifier Description PPSM_ERR_NUM_FMT Invalid user format field number This tool sets the width fo drawn by DrawDot(), a th Hint This dot width is applied For DBAddRecord() to work, the reference database ID must have been DrawEllipse(), DrawArc() created by calling DBAdd() prior to the calling of DBAddRecord(). If oldWidth is non-zero, th 21.3 Parameter DBAddRecToTop Syntax Name STATUS DBAddRecToTop(U32 dbId, S32 numFmt, P_U32 outRecId) newWidth oldWidth Description Adds a blank record at the beginning of the record list of a given database. Return Value User has the option to specify additional formatted data fields to be allocated. The valid range of numFmt is from 0 to 5. This tool is meant to complement the action of DBAddRecord(). PPSM_OK Parameter PPSM_ERR_DOT_W Name Description 20.39 SetPatternFill dbId Identifier of the database numFmt Number of additional formatted data fields Syntax in the record outRecId Returns the identifier of the added record STATUS SetPattern fillSpace Description 21-2 Name Database Tools Graphics Management Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 21 Database Ma This tool sets the pattern fill mode to be applied to DrawRec(), DrawCircle(), DrawEllipse() and DrawArc(). The fill pattern modes are: 1 2 4 3 21.1 DBAdd Syntax 5 6 STATUS DBAdd(P_ 8 7 Description Freescale Semiconductor, Inc... The pattern fill mode 0 will turn off the pattern fill feature. Adds a new database called whenever a database. Parameter Name mode Description Parameter There are 8 modes of pattern fill (see description above) backGrey The grey level used for the background space borderMode Border on-off flag * TRUE - a border will be drawn around the shape * FALSE - no border will be drawn around the shape fillSpace Name dbId Return Value Name The gap between the pattern lines. The larger this value is, the more space the pattern will appear. Return Value PPSM_OK PPSM_ERR_DB_AD Hint Name Description PPSM_OK Successful operation PPSM_ERR_FILL_PATTERN Invalid fill pattern mode PPSM_ERR_LCD_GREY Invalid background grey level PPSM_ERR_FILL_SPACE Invalid space gap in fill pattern 21.2 The returned dbId mu the database. DBAddRecord Syntax STATUS DBAddRec Description Appends a blank rec User has the option t The valid range of nu 20-32 Graphics Tools Database Management Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name PPSM_ERR_DB_TYPE Description Return value Invalid data type Name PPSM_OK Hint PPSM_ERROR The record and database referred to must be valid objects in the PPSM environment. PPSM_ERR_DB_DB PPSM_ERR_NUM_F Observes the unformatted data type specification for interchangeability. Hint 21.7 DBDelete This tool is meant to ordered record list. Freescale Semiconductor, Inc... Syntax For DBAddRecToTop created by calling DB recID passed must b STATUS DBDelete(U32 dbId) Description Removes a database from PPSM, and frees up all associated memory. 21.4 Parameter DBAppendRecor Syntax Name dbId Description Identifier of the database to be removed STATUS DBAppend outRecId Description Return Value Name Appends a blank rec the record identifier, option to specify ad range of numFmt is f Description PPSM_OK Successful operation PPSM_ERR_DB_DBID Invalid database identifier Parameter Hint Name The database referred to must be a valid object in the PPSM environment. dbId recId 21.8 DBDeleteRecord numFmt Syntax STATUS DBDeleteRecord(U32 dbId, U32 recId) outRecId Description value Removes a particular record from the specified database, and frees upReturn all associated memory. Name PPSM_OK 21-6 Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Description Return Value PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_OK PPSM_ERR_DB_RECID Invalid record identifier PPSM_ERROR PPSM_ERR_NUM_FMT Invalid user format field number PPSM_ERR_DB_DB Name PPSM_ERR_DB_RE Hint PPSM_ERR_DB_FD Freescale Semiconductor, Inc... This tool is meant to facilitate the implementation of insertion operation for an ordered record list. Hint For DBAppendRecord() to work, the reference database ID must have been created by calling DBAdd() prior to the calling of DBAppendRecord(). Also, theAdheres to the size l recID passed must be a valid record ID in the database to be operated on. The record and dat environment. 21.5 DBChangeStdData 21.6 Syntax DBChangeUnfDa Syntax ) STATUS DBChangeStdData(U32 dbId, U32 recId, S32 fieldId, P_TEXT data STATUS DBChange S32 size Description Changes the data in a predefined standard field of a record in the specified Description database. Changes the data in Parameter Parameter Name Description Name dbId Identifier of the database recId Identifier of the record dbId fieldId Identifier of the field: * DB_LAST Last Name * DB_FIRST First Name * DB_HOME Home Phone * DB_OFFICE Office Phone * DB_ADDRESS Address * DB_FAX Fax * DB_COMPANY Company * 1, 2, 3, 4, 5 Additional fields recId type data size Return Value Name PPSM_OK data Data to be put into the field PPSM_ERROR PPSM_ERR_DB_DB PPSM_ERR_DB_RE 21-4 Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Parameter Name Description Name dbId Identifier of the database dbId recId Identifier of the record recId fieldId Identifier of the field data Returns the pointer to the starting address of the data Return Value Name Return Value PPSM_OK Freescale Semiconductor, Inc... PPSM_ERR_DB_DB Name Description PPSM_ERR_DB_RE PPSM_OK Successful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_RECID Invalid record identifier PPSM_ERR_DB_FDID Invalid field identifier Hint Hint The database and environment. 21.9 DBGetFirstRecID The database and record referred to must be valid objects in the PPSM Syntax environment. If a user defined field is to be read, it is the user's responsibility to check the return status for PPSM_OK, to ensure that the user defined fieldSTATUS DBGetFirs does exist before using the returned data for subsequent processing. Description 21.13 DBReadTotalNumber Gets the record ID of Parameter Syntax STATUS DBReadTotalNumber (P_S32 numDB) Name Description dbId recId Reads the total number of databases in the PPSM environment. Parameter Return Value Name numDB Description Name Returns the total number of databases PPSM_OK Return Value PPSM_ERROR Name PPSM_OK 21-10 PPSM_ERR_DB_DB Description Successful operation Hint Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual STATUS DBGetPrev topListFl This tool is useful for implementing searching on the record list. The database referred to must be a valid object in the PPSM environment. Description 21.10 Gets the identifier o specified record is t recId, and the topLis DBGetNextRecID Syntax STATUS DBGetNextRecID(U32 dbId, U32 recId, P_U32 nextID, P_U16 botListFlag) Parameter Name Description dbId Freescale Semiconductor, Inc... Gets the identifier of the record following the specified record. If the specified record is the last record, nextID returned will be the same as recId, and the recId botListFlag will be set. prevID Parameter topListFlag Name Description Return Value dbId Identifier of the database recId Identifier of specified record nextID Returns the identifier of the next record botListFlag TRUE if the record identified by recId is the last record Name PPSM_OK PPSM_ERROR PPSM_ERR_DB_DB Return Value PPSM_ERR_DB_RE Name Description Hint PPSM_OK Successful operation PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_RECID Invalid record identifier This tool is useful for The database and environment. 21.12 Hint This tool is for implementing searching on the record list. DBReadData Syntax The database and record referred to must be valid objects in the PPSM STATUS DBReadDa environment Description 21.11 DBGetPrevRecID Reads the formatted Syntax 21-8 Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Description PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_RECID Invalid record identifier PPSM_ERR_DB_FDID Invalid field identifier PPSM_NO_MATCH No match of data Name PPSM_ERR_DB_RE 21.14 DBReadTotalNum Syntax Hint STATUS DBReadTo Freescale Semiconductor, Inc... Current implementation of tool stop searching once an exact match is found. Description There is no provision for the case where multiple matches exist. Reads the total numb For good programming practice, user must check the status returned to ensure a valid search is found before using the record identifier returned. Parameter 21.18 Name DBSecretFlag dbId Syntax numRec STATUS DBSecretFlag(U32 dbId, P_S32 sFlag) Description Return Value Checks if the secret flag of a particular database is set or not. Name Parameter PPSM_OK Name Description PPSM_ERR_DB_DB dbId Identifier of the database sFlag Returns the secret flag of the database. It can take either of the following two values: The database referre * 0 Secret flag is cleared * 1 Secret flag is set Hint 21.15 Return Value DBReadUnfData Syntax Name Description PPSM_OK Successful operation PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier STATUS DBReadUn P_S32 s Description Hint Reads the data in the pointer to the unform also pass back the ty The database referred to must be a valid object in the PPSM environment. 21-14 Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name Name sFlag Description dbId Identifier of the database recId Identifier of the record type Returns type of the data data Returns pointer to the starting address of the data size Return Value Name Returns size of the data (in bytes) PPSM_OK PPSM_ERROR Freescale Semiconductor, Inc... Return Value PPSM_ERR_DB_DB Name Description PPSM_OK Successful operation PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_RECID Invalid record identifier Hint The database and environment. 21.17 Hint PPSM_ERR_DB_RE DBSearchData The database and record referred to must be valid objects in the PPSM Syntax environment. STATUS DBSearchD It is good practice for user to check that the return status is PPSM_OK before Description using the data. 21.16 Searches though the that matches the s operation. If PPSM_ identifier of the recor DBRecordSecret Syntax STATUS DBRecordSecret(U32 dbId, U32 recId, P_S32 sFlag) Parameter Description Name Checks if the secret flag of a particular record in a given database is set or not. dbId fieldId Parameter data Name Description dbId Identifier of the database recId Identifier of the record recId Return Value Name PPSM_OK 21-12 Database DatabaseManagement ManagementTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 21.19 Return Value Name Description DBSetRecordSec Syntax STATUS DBSetReco PPSM_OK Successful operation PPSM_ERR_TEXT_ID Invalid text template identifier Description Sets the secret flag o 22.3 TextMap Parameter Syntax Name Freescale Semiconductor, Inc... STATUS TextMap(U32 templateId, P_TEXT buffer, U16 numChar) dbId Description recId Displays the given text onto the panning screen with properties specified in the sFlag text template identified by templateId. The text will be displayed starting at the current character cursor position. The font type, output style and grey level of the text are specified by the text template. Text that extends beyond the size of the text display area specified Return Value by the text template will be truncated. The current character cursor position is automatically updated by the system. Name Parameter PPSM_OK Name Description PPSM_ERROR templateId Identifier of the text template with current text properties buffer Pointer to text string to be displayed numChar Number of characters to be displayed PPSM_ERR_DB_DB PPSM_ERR_DB_RE PPSM_ERR_DB_SFL Hint Return Value Name 22.4 Description PPSM_OK Successful operation PPSM_ERR_TEXT_ID Invalid text template identifier PPSM_ERR_TEXT_CUR Invalid character cursor position TextReadCursor 21.20 The database and r environment. Note that when a new the secret flag of the in the database to be after DBAdd() is calle DBSetSecretFlag Syntax Syntax STATUS DBSetSecr STATUS TextReadCursor(U32 templateId, P_U16 cursor) Description Description 22-2 Text Tools Database Management Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 22 Text Tools Sets the secret flag of a database. If it is set, all new records created subsequently in the specified database will be set to secret. Parameter Name Description 22.1 TextCreate dbId Identifier of the database sFlag Secret flag of the database. It can take Syntax either of the following two values: STATUS TextCreate * 0 Clears the secret flag * 1 Sets the secret flag Description Creates and initialize for the created text te Freescale Semiconductor, Inc... Return Value Name Description PPSM_OK Successful operation PPSM_ERROR Unsuccessful operation PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_SFLAG Invalid secret flag value This is the first text displayed on the pa further references to Parameter Name templateId Hint The database referred to must be a valid object in the PPSM environment. User can use this flag to implement data security mechanism at a higher level. Return Value Note that the secret flag is set to 0 when the database is created. If a user wants all records in the database to be set secret, it should call DBSetSecretFlag() immediately after DBAdd() is called. Name PPSM_OK PPSM_ERR_TEXT_C 22.2 TextDelete Syntax STATUS TextDelete Description Deletes a text templa text template is not n Parameter Name templateId 21-16 Database Management Tools Text Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Freescale Semiconductor, Inc... pFontAttr Pointer to a text font attributes data structure. Supported font types are: * SMALL_NORMAL_FONT Small Normal (English) * SMALL_ITALIC_FONT Small Italic (English) * LARGE_NORMAL_FONT Large Normal (English) * LARGE_ITALIC_FONT Large Italic (English) * GB_NORMAL_FONT GB Normal * CHINESE_NORMAL_FONT same as GB Normal * BIG5_NORMAL_FONT BIG5 Normal * BIG5_VARIABLE_FONT BIG5 Variable 22.5 Return Value Name 22.8 Reads the current ch templateId. The char text display area. Description Description PPSM_OK Successful operation PPSM_ERR_TEXT_ID Invalid text template identifier PPSM_ERR_TEXT_FONT Invalid font type PPSM_ERR_NO_MEMORY Not enough memory TextSetOutlook Parameter Name templateId cursor Return Value Name PPSM_OK PPSM_ERR_TEXT_I TextSetCursor Syntax STATUS TextSetCur Description Sets the current cha templateId to the new positions to set to characters - 1). Parameter Syntax Name STATUS TextSetOutlook(U32 templateId, U16 outputStyle, U16 greyLevel) templateId cursor Description Sets up the output style and grey level of the given text template with the given Return Value values. Subsequent text mapped using this text template will be displayed with these new settings. Name The output style is defined as the arithmetic operation between the text character bitmap and the image on the panning screen where the character PPSM_OK bitmap will be displayed. Five output styles are supported. The text bitmap can PPSM_ERR_TEXT_I replace, OR with, AND with, exclusive OR with, or be inverted and replace the PPSM_ERR_TEXT_C existing image. Up to four grey levels are currently supported. For a 1 bit per pixel system, the grey levels supported are white and black. For a 2 bits per pixel system, the grey levels supported are white, light grey, dark grey and black. 22-6 Text Tools For More Information On This Product, Go to: www.freescale.com Text Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 22.6 TextSetDisplay Name Syntax PPSM_ERR_TEXT_H STATUS TextSetDisplay(U32 templateId, U16 xPos, U16 yPos, U16 width, U16 height, U16 cursor) PPSM_ERR_TEXT_C Description 22.7 TextSetFont Sets up the text display layout of the given text template with the corresponding given values. The text display layout comprises of the location and size of a Syntax text template. Subsequent text mapped using this text template will be displayed with the new layout. STATUS TextSetFon Freescale Semiconductor, Inc... The text display layout specified must reside within the boundary of the Description panning screen. The size of the text display area in number of pixels varies with the size of the font type specified in the text template. The range of validSets up the font attrib character cursor positions to set to is zero through (text display area size inusing this text templa number of characters - 1). Eight font types are c Parameter 8 pixels English fonts fonts. GB Normal is 1 is the same as GB N Name Description 16 Chinese font in B templateId Identifier of text template to be modified BIG5 code format. Asian fonts a X-coordinate of top left corner of text display area yPos Y-coordinate of top left corner of text display area The specified font wid type is specified. The font libraries being p width Width of text display area in number of columns of characters The attribute field is height Height of text display area in number ofParameter rows of characters cursor Character cursor position within the text display area where text will be displayed next Return Value Name 22-4 Note: xPos Description PPSM_OK Successful operation PPSM_ERR_TEXT_ID Invalid text template identifier PPSM_ERR_TEXT_X Text template x-coordinate out of range PPSM_ERR_TEXT_Y Text template y-coordinate out of range PPSM_ERR_TEXT_WIDTH Given width extends text display area beyond the panning screen Text Tools For More Information On This Product, Go to: www.freescale.com Text Tools Name templateId Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Name templateId Freescale Semiconductor, Inc... outputStyle greyLevel Return Value Name PPSM_OK PPSM_ERR_TEXT_I PPSM_ERR_TEXT_S PPSM_ERR_TEXT_G 22.9 TextSetup Syntax STATUS TextSetup( greyLeve Description Sets up the font type, template with the g template will be displ 22-10 Text Tools For More Information On This Product, Go to: www.freescale.com Text Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual This tool does not support the variable size of BIG5_VARIABLE_FONT font Name type and is provided for backward compatibility. If BIG5_VARIABLE_FONT is used, default font size of 16 x 16 is used. PPSM_ERR_TEXT_F Please refer to TextSetDisplay() (Section 22.6 - TextSetDisplay), TextSetFont() PPSM_ERR_TEXT_S (Section 22.7 - TextSetFont), and TextSetOutlook() (Section 22.8 PPSM_ERR_TEXT_G TextSetOutlook) for detailed descriptions of the corresponding parameters. PPSM_ERR_TEXT_X Parameter PPSM_ERR_TEXT_Y Freescale Semiconductor, Inc... Name Description PPSM_ERR_TEXT_W templateId Identifier of text template to be modified fontType Font type of text to be displayed: * SMALL_NORMAL_FONT * SMALL_ITALIC_FONT * LARGE_NORMAL_FONT 22.10 * LARGE_ITALIC_FONT * CHINESE_NORMAL_FONT * BIG5_NORMAL_FONT * BIG5_VARIABLE_FONT outputStyle Output style of text to be displayed: * REPLACE_STYLE * OR_STYLE * AND_STYLE * EXOR_STYLE * INVERSE_STYLE PPSM_ERR_TEXT_H TextUnmap Syntax STATUS TextUnmap Description Clears the entire text Parameter Name greyLevel Grey level value of the characters: * WHITE * LIGHT_GREY * DARK_GREY * BLACK templateId Return Value xPos x-coordinate of top left corner of text display area yPos y-coordinate of top left corner of text display area width Width of text display area in number of columns of characters height Height of text display area in number of rows of characters Return Value Name 22-8 Description PPSM_OK Successful operation PPSM_ERR_TEXT_ID Invalid text template identifier Text Tools For More Information On This Product, Go to: www.freescale.com Text Tools Name PPSM_OK PPSM_ERR_TEXT_I Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 23 Timer Tools Return Value Freescale Semiconductor, Inc... Name Description PPSM_OK Successful operation PPSM_ERR_YEAR Invalid year value PPSM_ERR_MONTH Invalid month value PPSM_ERR_DAY Invalid day value PPSM_ERR_HOUR Invalid hour value PPSM_ERR_MINUTE Invalid minute value PPSM_ERR_SECOND Invalid second value 23.1 AlarmClear Syntax void AlarmClear(voi Description Clear all alarms set other tasks. Parameter 23.6 AlarmSetId Name Syntax None STATUS AlarmSetId(P_U32 alarmId, U16 year, U16 month, U16 date, U16 Return Value hour, U16 minute, U16 second) Description Name Set alarm at specific time and return the alarm id. When the time reaches the None alarm time, a message with the alarm id, will be passed to the task. Even if the task is swapped out or the system goes to sleep, the alarm task will still be swapped in and the system will wake up. However, if more than one alarm AlarmClearId tasks happen, the earlier the alarm is set, the earlier the task 23.2 will be swapped in. If alarmId is 0, no alarm id will be given but the alarm will still be set. So if Syntax several alarms are set at the same time, the task will first swap to the alarm task which set the alarm first, then the second, etc. However, this version thevoid AlarmClearId(U alarm will stop in the task which set the alarm first only, although the alarm messages are sent to other tasks also. Description Parameter This function will cle alarm set can be of a Name Parameter alarmId The pointer to the alarm id set with specific time year Alarm year which must be greater than or equal to 1900 month Alarm month from 1 to 12 date Alarm date from 1 to 28, 30 or 31 depending on the month and year values. hour 23-4 Description Name Return Value Alarm hour from 0 to 23 Timer Tools For More Information On This Product, Go to: www.freescale.com alarmId Name None Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 23.3 AlarmRead Name Syntax day STATUS AlarmRead(P_U16 year, P_U16 month, P_U16 day, P_U16 hour, P_U16 minute, P_U16 second) Description hour minute second Reads the up coming alarm set for the current task in alarm list. Return Value Parameter Name Freescale Semiconductor, Inc... Name Description PPSM_OK year Pointer to the year value of the alarm month Pointer to the month value of the alarm day Pointer to the day value of the alarm hour Pointer to the hour value of the alarm minute Pointer to the minute value of the alarm second Pointer to the second value of the alarm 23.5 PPSM_ERROR PPSM_ERR_NO_AL AlarmSet Syntax Return Value Name 23.4 STATUS AlarmSet(U second) Description PPSM_OK Successful operation PPSM_ERR_NO_ALARM No alarm is set Description Sets the year, month set, the application w when the specified ti AlarmReadId Parameter Syntax Name STATUS AlarmReadId(U32 alarmId, P_U16 year, P_U16 month, P_U16 day, year P_U16 hour, P_U16 minute, P_U16 second) month Description day This function will read the alarm time set in alarmId. hour Parameter minute Name 23-2 Description alarmId The identifier of the alarm to be read year Pointer to the year of the alarm month Pointer to the month of the alarm Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools second Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual For DragonBall not DragonBall-EZ, the InputTimeout() is also limited by the pen input sampling rate. A higher sampling rate is more likely to give a more accurate result. minute Parameter Name second Name millisecond Return Value Description Time-out period in units of millisecond. If this value is zero, time-out is disabled. Name PPSM_OK Return Value PPSM_ERR_YEAR Freescale Semiconductor, Inc... Name PPSM_ERR_MONTH Description PPSM_OK Successful operation PPSM_ERR_TMOUT_VALUE Invalid time-out period PPSM_ERR_DAY PPSM_ERR_HOUR PPSM_ERR_MINUTE 23.11 PPSM_ERR_SECON RefFineTimeAlarm Syntax 23.7 DateTimeRead STATUS RefFineTimeAlarm(U32 alarmTime) Syntax Description STATUS DateTimeR Sets up an alarm time with respect to the current reference timer in unit of 100 P_U16 m microseconds. Maximum period between alarm time and current time is Description 0x7FFFFFFF/10 millisecond. Gets the system date Parameter Name alarmTime Description Parameter The absolute value of the alarm time with respect to the current reference timer value in unit of 100 microseconds. Maximum alarm time period is 0x7FFFFFFF/10 milliseconds from the current reference time. Name year month day hour Return Value minute Name PPSM_OK Description second Successful operation Return Value 23.12 RefFineTimeAlarmId Name PPSM_OK Syntax 23-8 Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Freescale Semiconductor, Inc... 23.8 23.9 Description PPSM_ERR_YEAR Invalid year pointer PPSM_ERR_MONTH Invalid month pointer PPSM_ERR_DAY Invalid day pointer PPSM_ERR_HOUR Invalid hour pointer PPSM_ERR_MINUTE Invalid minute pointer PPSM_ERR_SECOND Invalid second pointer DeleteTimer Syntax STATUS DeleteTime Description Delete the timer in tim task as far as the tim Parameter Name DateTimeSet timerId Syntax STATUS DateTimeSet(U16 year, U16 month, U16 day, U16 hour, U16 minute, U16 second) Return Value Description Name Sets the system date and time. PPSM_OK Parameter PPSM_ERROR Name Description year Input year value, starts from 1900 23.10 InputTimeout month Input month value, in range 1 - 12 Syntax day Input day value, in range 1 - 31 hour Input hour value, in range 0 - 23 minute Input minute value, in range 0 - 59 second Input second value, in range 0 - 59 STATUS InputTimeo Description Return Value Name 23-6 Once this time-out r argument list is set a is detected. If the t occurred, PPSM wi otherwise, the time-o This is a repetitive tim each pen input strok Description PPSM_OK Successful operation PPSM_ERR_YEAR Invalid year value PPSM_ERR_MONTH Invalid month value PPSM_ERR_DAY Invalid day value PPSM_ERR_HOUR Invalid hour value PPSM_ERR_MINUTE Invalid minute value PPSM_ERR_SECOND Invalid second value Timer Tools For More Information On This Product, Go to: www.freescale.com Sets the repetitive ti time-out routine is a device. To disable the time-o value allowed is 100 In IrptGetData(), the timeout from normal Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual This routine takes in two reference times and return to the caller the difference STATUS RefFineTim between the two. This routine takes care of wrapped around condition of the 32-bit continuous reference value. All reference timer values in this routineDescription are in unit of milliseconds. Sets up an alarm tim microseconds. Maxi Parameter 0x7FFFFFFF/10 mill Name beginTime Description Parameter The begin reference time in unit of millisecond endTime Name The end reference time in unit of millisecond alarmId Freescale Semiconductor, Inc... alarmTime Return Value Name N/A Description Return Value The elapsed time between the two given reference times in unit of milliseconds Name PPSM_OK 23.18 RefTimeRead 23.13 Syntax RefFineTimeDiff Syntax U32 RefTimeRead(void) U32 RefFineTimeDi Description Returns the current 32-bit reference timer value to the caller in unitDescription of milliseconds. The calling of this function will occupy longer CPU time than This routine takes in RefFineTimeRead(). between the two time the 32-bit continuous Parameter are in unit of 100 mic Name void Description Parameter - Name Return Value beginTime Name N/A 23.19 Description endTime Returns a 32-bit reference timer value in unit of milliseconds SetPeriod Syntax 23-12 Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Return Value Name N/A 23.14 Description Name The elapsed time between the two given reference times in unit of 100 microseconds RefFineTimeRead alarmTime Return Value Syntax Name U32 RefFineTimeRead(void) Freescale Semiconductor, Inc... PPSM_OK Description Returns the current 32-bit reference timer value to the caller in unit of 100 23.16 timerRefTimeAlarmId microseconds. This is recommended to be used to read the reference as it doesn't involve much calculation and simply return the value. RefTimeRead() will need more CPU time to convert the reference timer to resolutionSyntax of millisecond. STATUS RefTimeAl Parameter Description Name Sets up an alarm tim milliseconds. Maxim 0x7FFFFFFF/10 mill Description void Parameter Return Value Name N/A 23.15 Name Description Returns a 32-bit reference timer value in unit of 100 microseconds alarmId alarmTime RefTimeAlarm Return Value Syntax Name STATUS RefTimeAlarm(U32 alarmTime) PPSM_OK Description Sets up an alarm time with respect to the current reference timer in unit of milliseconds. Maximum period between alarm time and 23.17 current timeRefTimeDiff is 0x7FFFFFFF/10 milliseconds. Syntax U32 RefTimeDiff(U3 Description 23-10 Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual STATUS SetPeriod( Description Sets the periodic inte send a periodic int messages, to the cal Parameter Name Freescale Semiconductor, Inc... period Return Value Name PPSM_OK PPSM_ERR_PERIOD 23.20 SetPeriodId Syntax STATUS SetPeriodI Description This function will se interrupt is available going to be killed w The returned value o Parameter Name alarmId 23-16 Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name period Description Parameter It can be: Name RTC_PERI_NONE - Kill all period millisecond interrupts in all tasks RTC_PERI_SECOND - Set second periodic interrupts for current task Return Value RTC_PERI_MINUTE - Set minute periodic interrupts for current task RTC_PERI_HOUR - Set hour periodic Name interrupts for current task which is only available for EZ328 PPSM_OK RTC_PERI_MIDNIGHT - Set midnight PPSM_ERR_TMOUT periodic interrupts for current task Freescale Semiconductor, Inc... RTC_PERI_NO_SECOND - Kill second periodic interrupt for current task RTC_PERI_NO_MINUTE - Kill minute 23.22 TimeoutId interrupt for current task RTC_PERI_NO_HOUR - Kill hour Syntax interrupt for current task which is only available for EZ328 STATUS TimeoutId( RTC_PERI_NO_MIDNIGHT - Kill midnight interrupt for current task Description General timer time-o Return Value Name The application that PPSM. A time interru expired with the time Description PPSM_OK Successful operation PPSM_ERR_PERIOD Invalid period flag PPSM_ERR_NO_MEMORY Out of memory Maximum allowed va Parameter Name 23.21 Timeout timerId Syntax millisecond STATUS Timeout(U32 millisecond) Description Return Value General timer time-out routine. This is a one-shot time-out. Name The application that calls this routine will register a time-out interval with PPSM_OK PPSM. A time interrupt is generated to the task when this time-out period is PPSM_ERR_TMOUT expired. Maximum allowed value for Timeout() is 1000. 23-14 Timer Tools For More Information On This Product, Go to: www.freescale.com Timer Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 24 Memory Man Return Value Name 24.6 Description PPSM_OK Successful operation PPSM_ERROR Invalid input arguments 24.1 Lcalloc Syntax TaskMemUsed void *Lcalloc(U32 si Syntax Description STATUS TaskMemUsed(U32 taskId, P_U32 pSizeUsed) Freescale Semiconductor, Inc... Dynamic allocation o caller a pointer to a the Linker Specifica Inquire memory usage of a task. This routine returns to the caller total numbermemory, in number of bytes of memory allocated to the given task through Lmalloc(), Lcalloc ormemory available in Lrealloc(). The memory pointed Parameter Parameter Description Name Description Name taskId Identifier of the task pSizeUsed Returns the total number of bytes of memory used by the task with the given taskId size Return Value Return Value Name Name Description PPSM_OK Successful operation PPSM_ERR_TASK_ID Invalid task identifier 24.2 24.7 N/A Lfree TaskStackAvail Syntax Syntax void Lfree(void *ptr) S32 TaskStackAvail(void) Description Description Returns the memory PPSM returns to the caller the total number of bytes of stack can still be used by supplied must be a current task when calling TaskStackAvail(). Positive returned value indicates stack allocation tools. has not been used up, negative value implies stack has already overflow. 24-4 Memory Memory Management Management Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 24.4 Parameter Name Description Lrealloc Syntax Pointer to a valid memory location. It must void *Lrealloc(void * be a pointer returned from one of the Description PPSM memory allocation tools. ptr Moving of memory. from one location to at the original locatio the heap. The purpos Return Value Name Description Parameter Freescale Semiconductor, Inc... None Name 24.3 Lmalloc ptr Syntax void *Lmalloc(U32 size) size Description Return Value Dynamic allocation of run-time memory to the caller. This routine returns to the caller a pointer to a region of free memory within the malloc size specified in the Linker Specification File (.SPC). PPSM returns at least the amount of memory, in number of bytes, that the caller asked for. If there is not enough N/A memory available in the system, a NULL pointer is returned. Name The memory pointed to by the pointer is un-initialized. PPSM returns the size of the largest continuous memory block can be used 24.5 MoveBlock when calling Lmalloc( LARGEST_MALLOC_SIZE ). Parameter Syntax Name STATUS MoveBlock Description Description size The size of memory required by the caller in number of bytes Copies a block of me or flag LARGEST_MALLOC_SIZE when inquiring the size of the largest continuous memory block destination location. Overlapping of mem Parameter Return Value Name Name Description srcAddr N/A zero - Not enough memory in the system non-zero - Pointer to an initialized free memory region or the size of the largest continuous memory block 24-2 Memory Memory Management Management Tools Tools For More Information On This Product, Go to: www.freescale.com destAddr size Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter Parameter Name milliSecond Description Name None Specifies the Doze mode time-out period in unit of milliseconds. The range is from 0 to 60000 milliseconds. The 0 default Return Value value means that PPSM enters Doze mode whenever there is no messages and no task swapping is needed. If it's PPSM_NO_DOZE, no automatically going to doze after doze timeout nor sleep N/A timeout will happen. Name Freescale Semiconductor, Inc... Return Value 24.8 Name TotalMemSize Description Syntax PPSM_OK Successful operation PPSM_ERR_DOZE_TIME Doze time-out period out of range U32 TotalMemSize( Description 25.3 This routine returns allocated through L returned by this func specified in the Linke SetDutyCycle Syntax U16 SetDutyCycle(U16 percentage) Parameter Description This tool allows the application to set its own duty cycle level. Applications within a system can have different duty cycle percentages. PPSM None automatically changes the PCM correspondingly when the application tasks become active. Return Value Name Parameter Name Name percentage Description N/A Specifies the percentage of duty cycle required from the processor core. Range from a minimum of 3% processor usage to a maximum of 100% usage in unit of 3% steps. Anything less than 3% will be set to 3; anything more than 100% will be set to 24.9 TotalMemUsed 100. By default, all applications start at 100% Syntax duty cycle U32 TotalMemUsed Description 25-2 Memory Power Management Management Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 25 Power Manag Inquire run-time memory usage of the system. This routine returns to the caller the total number of bytes of memory have been allocated to the whole system through Lmalloc(), Lcalloc() or Lrealloc(). Parameter Name Description 25.1 None SetDozeMode Syntax Return Value void SetDozeMode( Freescale Semiconductor, Inc... Name N/A Note: Description The total number of bytes of memory allocated to the whole system Value returned by TotalMemUsed() does not equal to the actual size of all memory resources used by the system. Global variables and strings memory usage are not counted by this function. For SDS user, the initial memory usage can be found by the symbol lister, SYM.EXE, provided in SDS command directory. Description Sets system to go in Parameter Name None Return Value Name None 25.2 SetDozePeriod Syntax STATUS SetDozePe Description Sets the countdown mode. A value of zer is no message to be equals PPSM_NO_D so no automatically g 24-6 Memory Management Tools Power Management Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Freescale Semiconductor, Inc... baudRate Description Baud rate flag * UART_300_BPS 300 bits per second * UART_600_BPS 600 bits per second * UART_1200_BPS 25.4 1200 bits per second * UART_2400_BPS 2400 bits per second * UART_4800_BPS 4800 bits per second * UART_9600_BPS 9600 bits per second * UART_14400_BPS 14400 bits per second * UART_19200_BPS 19200 bits per second * UART_28800_BPS 28800 bits per second * UART_38400_BPS 38400 bits per second * UART_57600_BPS 57600 bits per second * UART_115200_BPS 115200 bits per second parity Parity flag * NO_PARITY Disable parity * ODD_PARITY 25.5 Enable odd parity * EVEN_PARITY Enable even parity Return Value Name U16 SetSleepMode Syntax void SetSleepMode( Description Sets system to go in Parameter Name None Return Value Name None SetSleepPeriod Syntax STATUS SetSleepPe Stop bits flag * ONE_STOP_BIT Description One stop bit after a character * TWO_STOP_BIT Sets the countdown Two stop bits after a character mode. A value of zer stopBits charLen Character length flag * SEVEN_BIT_CHAR 7-bit character mode * EIGHT_BIT_CHAR 8-bit character mode Parameter Name second Return Value Name PPSM_OK 26-2 Description Successful operation UART Tools Power Communication Management Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 26 UART Comm Return Value Name Description PPSM_OK Successful operation PPSM_ERR_SLEEP_TIME Sleep time-out period out of range 26.1 UARTConfigure Syntax STATUS UARTConf charLen Freescale Semiconductor, Inc... Description Configures the UART of stopBits, and char The UART hardware course of this config aborted. Both the normal NRZ and maximum baud per second correspo Parameter Name mode 25-4 Power Management Tools UART Communication For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 26.5 UARTReadData Name Syntax PPSM_ERR_INVALID STATUS UARTReadData(P_U8 pData, U16 bufSize, P_U16 sizeRead) PPSM_ERR_MODE PPSM_ERR_BAUD Description PPSM_ERR_PARITY Reads data received from the UART. PPSM_ERR_STOPB Freescale Semiconductor, Inc... An application can initiate a receive request to start receiving data from the UART by calling UARTReceive() (Section 26.6 - UARTReceive). When PPSM PPSM_ERR_CHARL receives data from the UART, it will post an interrupt message to notify the calling application. The calling application can then read the data by calling UARTReadData(). The calling application needs to pass a buffer, with its size, to PPSM 26.2 for storing UARTFlowCtrl the received data. PPSM will pass back to the calling application the actual number of bytes of data read into the application buffer. Syntax An error condition will be returned if the calling application was not granted STATUS UARTFlow permission to use the UART, or no receive request has been initiated when Description UARTReadData() is called. Enable or disable ha If RTS/CTS is enabled, RTS pin is negated when PPSM running UARTReadcan handle data com Data() and asserted after data reading completed. hardware flow contro UARTFlowCtrl() with Parameter Parameter Name Name Description pData Pointer to buffer for storing received data bufSize Size of data buffer (in number of bytes) sizeRead Number of bytes of data read controlType Return Value Name Description PPSM_OK Successful operation PPSM_ERR_INVALID_ACCESS Invalid access of UART PPSM_ERR_NO_REQUEST Receive request was not initiated Return Value Name PPSM_OK PPSM_ERR_INVALID PPSM_ERROR 26.6 UARTReceive Syntax 26.3 STATUS UARTReceive(U8 receiveFlag) 26-6 UARTInquire Syntax UART Communication Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual void UARTInquire(P_U8 mode, P_U32 baudRate, P_U8 parity, P_U8 stopBits, P_U8 charLen) Parameter Name Description Returns the current operating mode, baudRate, parity, number of stopBits, and charLen settings of the UART to the calling application. controlType The returned values, except for baudRate, are flag values as described in UARTConfigure() (Section 26.1 - UARTConfigure). The baud rate value returned is in unit of bits per second. Parameter Return Value Freescale Semiconductor, Inc... Name Description Name mode Current operating mode flag baudRate Current baud rate (in units of bps) parity Current parity flag stopBits Current number of stop bits flag charLen Current character length flag Return Value Name Description None 26.4 UARTRcvCtrl Syntax STATUS UARTRcvCtrl(U8 controlType) Description Pause or continue receiving data through UART from another device. An application can pause or continue data reception through UART when hardware control is enabled. Error message is returned if RTS/CTS hardware flow control is not enabled. 26-4 UART Communication Tools For More Information On This Product, Go to: www.freescale.com PPSM_OK PPSM_ERR_INVALID PPSM_ERR_RCTS_ Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Description Return Value Name 26.10 Initiates or aborts a U Description PPSM_OK Successful operation PPSM_ERR_INVALID_ACCESS Invalid access of UART PPSM_ERR_RCTS_IDLE RTS/CTS hardware flow control is not enabled If receiveFlag is UA initiated, and PPSM If receiveFlag is UAR be aborted. When PPSM receive application notifying read the received UARTReadData). UARTSetDelay Freescale Semiconductor, Inc... Syntax Application task swa and re-enabled after STATUS UARTSetDelay(U8 type, U16 delay) Parameter Description In order to communicate with application in PC, such as HyperTerminal and Telix, transmitting data in a burst of pulses periodically would greatly increase the accureceiveFlag racy of transmission. This function allows user to set a delay, in unit of 100us, between each transmission of all data in transmit FIFO (between two hardware interrupts). Name The range of delay values supported is 1 to 60,000. Parameter Return Value Name type Description Name delay type * UART_TXHALF_DELAY Set a delay between each TXHALF interrupts * UART_TXDELAY_CLEAR Clear delay within transmission delay Transmission delay value in 100 microseconds 26.7 * 100 microseconds to 60,000 microseconds (6 seconds) PPSM_OK PPSM_ERR_INVALID PPSM_ERR_BUSY UARTSend Syntax STATUS UARTSend Return Value Description Name 26-10 Description PPSM_OK Successful operation PPSM_ERR_INVALID_ACCESS Invalid access of UART PPSM_ERR_INVALID_TXDELAY Delay value out of range Initiates or aborts a U If sendFlag is UART_ PPSM will start send If sendFlag is UAR aborted. UART Communication Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter The calling application needs to pass the data byte stream, with its size, to PPSM for sending out. When PPSM finishes sending the data, it will post an interrupt message to the calling application notifying it that all data has been sent. abortFlag Name Application task swapping is disabled while the send request is in progress, and re-enabled after the send request is terminated. Parameter Name Freescale Semiconductor, Inc... sendFlag Description Operation flag * UART_SEND_REQUEST Initiates a send request * UART_SEND_ABORT Aborts a send request pData Pointer to data byte stream dataLen Number of bytes of data to be sent pSendData sendSize Return Value Name PPSM_OK Return Value PPSM_ERR_INVALID Name Description 26.9 UARTSendCtrl PPSM_OK Successful operation PPSM_ERR_INVALID_ACCESS Invalid access of UART PPSM_ERR_BUSY There is already an on-going send request STATUS (when trying to initiate one) Syntax UARTSen Description 26.8 UARTSendAbort Syntax STATUS UARTSendAbort(U8 abortFlag, P_U8 *pSendData, P_U32 sendSize) Pause or continue application can pau hardware control is e flow control is not en Parameter Description Terminate the current UART transmission. The transmission abort process is controlType the same as calling UARTSend(UART_SEND_ABORT). Moreover, beside aborting the ongoing transmission, PPSM returns a pointer which points to the current position of internal transmission buffer and the number of bytes of data have been sent. Caller can get those information without abort UART transmission by calling UARTSendAbort() with UART_INQUIRE_SBYTE. 26-8 UART Communication Tools For More Information On This Product, Go to: www.freescale.com Name Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name 26.11 Description UARTTimeout newScreen Syntax Screen Flag * PPSM_SCREEN_NOSCREEN STATUS UARTTime No panning screen is needed * PPSM_SCREEN_NEW Description A panning screen of size screenWidth by screenHeight Sets the maximum is required screenWidth If newScreen == PPSM_SCREEN_NEW, this argument is the panning screen width This time-out functio data stream terminat in number of pixels. If this value is 0, the default screen width System do not initia and height are used screenHeight If newScreen == PPSM_SCREEN_NEW, this argument is the panning screen height in number of pixels. If this value is 0, the default screen height and width are used Freescale Semiconductor, Inc... interrupts. bitmap starts timeout with UARTReceive(), UAR The valid range of tim of milliseconds). A t function related to UA The bitmap for launch icon within LCD Parameter display Name Return Value tmout Name 27.2 Description PPSM_OK Successful operation PPSM_ERR_TASK_ID Invalid address for storing task identifier PPSM_ERR_TASK_FLAG Invalid screen flag PPSM_ERR_TASK_WIDTH Invalid screen width PPSM_ERR_TASK_HEIGHT Invalid screen height PPSM_ERR_COORDINATE Invalid coordinates PPSM_ERR_NO_MEMORY Not enough memory Return Value AppSwap Syntax void AppSwap(U16 flag) Description If flag is FALSE, no task swapping is allowed by any means such as pen down on application icon nor using SendMessage(), etc. If SendMessage() or AdvSendMessage() are called after this function with FALSE in flag, the message will still be sent to the target task but the task swapping action will be 27-2 Task Handling Tools UART Communication For More Information On This Product, Go to: www.freescale.com Name PPSM_OK PPSM_ERR_INVALID PPSM_ERR_INVALID Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 27 Task Handlin 27.1 AdvTaskCreate Syntax STATUS AdvTaskCr ySrc, S1 screenW Freescale Semiconductor, Inc... Description Creation of a new PP same manner as the It allows the caller to * * * The launch icon off screen. For ei to be created. The stack memo The panning scre associated scree The default screen LCDVIRTWIDTH and Parameter Name taskId procAddr xSrc ySrc xDest yDest stackSize 26-12 UART Communication Task Handling Tools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual ignored. Moreover, if of AppSwap(TRUE) Description To set the specific task to be in reinit mode so that each time the task is Parameter swapped in, it will start from beginning of the task again. This function is generally called once the task is created. Name Parameter flag Freescale Semiconductor, Inc... Name Description taskId The task identifier of the task to be set. flag TRUE or FALSE to indicate whether the task needs to be in reinit mode. Return Value Return Value Name None Name Description PPSM_OK Successful operation PPSM_ERR_TASK_ID Invalid task id. 27.3 SubTaskCreate Syntax STATUS SubTaskCr U16 num 27.7 TaskStart Description Syntax Creating a sub-task. task is itself a sub-tas STATUS TaskStart(U32 taskId) sub-task and the new Description sub-task has been c the head of the sub t Begin execution of the first application task. This routine will never returns. Ittask a parent task c launches the first PPSM application, and all other applications are started bychange in run-time. activating the application icons. This routine is used at the start to kick off the system. This routine accepts passed into the subParameter can accept input arg Name taskId Description Parameter The task identifier for the first application to be launched. Name taskId Return Value Name 27-6 Description PPSM_ERROR Invalid taskId PPSM_OK Task started successfully Task Handling Task Handling Tools Tools For More Information On This Product, Go to: www.freescale.com procAddr stackSize numArg Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name ... Description Name Variable arguments. These are passed to the sub task routine when the sub task begins execution PPSM_ERR_TASK_I PPSM_ERR_COORD PPSM_ERR_NO_ME Return Value Freescale Semiconductor, Inc... Name Description 27.5 PPSM_OK Successful operation PPSM_ERR_NO_MEMORY Not enough memory TaskHook Syntax STATUS TaskHook( Description 27.4 TaskCreate Set the entry and exi to be swapped in, en Syntax is going to be swapp STATUS TaskCreate(P_U32 taskId, P_VOID procAddr, S16 xSrc, S16 ySrc, and exitCallback sho function should not S16 xDest, S16 yDest, P_U8 bitmap) newApp) where oldA Description and newApp will be t PPSM needs to know the existence of each application during initialization Parameter stage. The main body of a PPSM system must call this routine once for each application. PPSM will create the necessary data structure and memory space required to run the application. taskId Parameter Name taskId entryCallback Description Returns a task identifier. This identifier is used by PPSM to refer to the task when it uses the system resources. exitCallback procAddr Address location of the application xSrc Top left x-coordinate of the task icon ySrc Top left y-coordinate of the task icon xDest Bottom right x-coordinate of the task icon yDest Bottom right y-coordinate of the task icon PPSM_OK bitmap Pointer to bitmap of the task icon * 0 - No on-screen icon is needed PPSM_ERR_TASK_I 27.6 Return Value Name PPSM_OK 27-4 Name Description Return Value Name TaskReInit Syntax Successful operation Task Handling Task Handling Tools Tools For More Information On This Product, Go to: www.freescale.com STATUS TaskReInit Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual All data that the sender wants to send must be stored in the form of MESSAGE 27.8 TaskTerminate structure. No protocol or data format is put on the message data. The sender and receiver must have a mutual understanding of the data representation of Syntax the message being sent. STATUS TaskTermin The data structure for the structure MESSAGE is: Description typedef struct _MESSAGE { U16 messageType; U16 message; U32 misc; P_VOID data; U16 size; U16 reserved; } PPSM_MESSAGE, *P_MESSAGE; /* /* /* /* /* /* Termination of a tas system memory, suc the task and its subta message type */ message */ short data (32bit) */ associated data, if any */ size of data in bytes */ for future (broadcast, etc) */ Freescale Semiconductor, Inc... A task cannot term TaskTerminate() will If AppSwap(FALSE) is called before calling this function, the message will stillthe task with Lmalloc be sent but any form of task swapping action will be ignored. Parameter If the system is in doze mode, calling this function will wake up the system. Name Parameter taskId Name taskId The receiver task identifier msg The message to send. All data to send are stored in the PPSM_MESSAGE structure, with the following representation: * messageType - Must set to MESSAGE_IRPT. * message - The type of message being sent to the receiver. Normally set to IRPT_USER. * misc - 32-bit short data * data - data pointer to the buffer that is storing the message data * size - size of data buffer, in number of bytes * reserved - not used flag 28-2 Description Return Value It can be: SWAP_TASK_LATER - Task swapping will happen in IrptGetData() when all messages in current task are handled. SWAP_TASK_BACK_LATER - Task swapping will happen immediately if the pen is not touching the panel and the current task will be swapped back when all messages in the target task are handled. SWAP_TASK - Task swapping will happen immediately if the pen is not touching the panel. NO_SWAP_TASK - No task swapping will happen. Inter-Task Messaging Task Handling Tools Tools For More Information On This Product, Go to: www.freescale.com Name PPSM_OK PPSM_ERR_TASK_I Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 28 Inter-Task Me 28.1 AdvMessageDele Syntax STATUS AdvMessa Description Freescale Semiconductor, Inc... This function will de specific task, type a 0xFFFFFFFF in task that field. SO if task messages in all tasks Parameter Name task type shortData Return Value Name PPSM_ERR_TASK_I PPSM_OK 28.2 AdvSendMessag Syntax STATUS AdvSendM Description This tool is used whe task. If the receiver ta If msg is 0, no mes executed. 27-8 Inter-Task Messaging Task HandlingTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Return Value Name PPSM_OK PPSM_ERR_TASK_I PPSM_ERR_NO_ME Freescale Semiconductor, Inc... PPSM_ERROR 28.3 MessageDelete Syntax STATUS MessageD Description This function will dele specific type matched "don't care" in that fie Parameter Name type Return Value Name PPSM_ERR_TASK_I PPSM_OK 28.4 SendMessage Syntax STATUS SendMess Description This tool is used whe task. If the receiver ta 28-6 Inter-Task Inter-TaskMessaging MessagingTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual All data that the sender wants to sent must be stored in the form of MESSAGE SendMes structure. No protocol or data format is put on the message data. The sender and receiver must have a mutual understanding of the data representation of msg.data the message being sent. On the receiving side, IrptGetData() is where the msg.size message received. msg.reserved The data structure for the structure MESSAGE is: Freescale Semiconductor, Inc... typedef struct _MESSAGE { U16 messageType; U16 message; U32 misc; P_VOID data; U16 size; U16 reserved; } PPSM_MESSAGE, *P_MESSAGE; Return Value /* /* /* /* /* /* message type */ message */ short data (32bit) */ associated data, if any */ size of data in bytes */ for future (broadcast, etc) */ Name PPSM_OK PPSM_ERR_TASK_I If AppSwap(FALSE) is called before calling this function, the message will still PPSM_ERR_NO_ME be sent but any form of task swapping action will be ignored. PPSM_ERROR If the system is in doze mode, calling this function will wake up the system. Parameter Name Description taskId The receiver task's identifier msg The message to send. All data to send are stored in the PPSM_MESSAGE structure, with the following representation: * messageType - Must set to MESSAGE_IRPT. * message - The type of message being sent to the receiver. Normally set to IRPT_USER. * misc - 32-bit short data * data - data pointer pointing a buffer that is storing the message data * size - size of data buffer, in number of bytes * reserved - not used Corresponding values between SendMessage() and IrptGetData() SendMessage IrptGetData STATUS SendMessage(U32 taskId, P_MESSAGE msg) STATUS IrptGetData(P_U32 sData, P_U32 *data, P_U32 size) 28-4 msg.messageType must be MESSAGE_IRPT msg.message returned value msg.misc *sData Inter-Task Inter-TaskMessaging MessagingTools Tools For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 29 Interrupt Han Parameter Name Freescale Semiconductor, Inc... handlerFlag Description Flag to indicate which of the handler the caller is releasing. * IRPT_SPIM_FLAG 29.1 IrptGetData * IRPT_SPIS_FLAG(DragonBall Only) * IRPT_UART_FLAG Syntax * IRPT_IRQ1_FLAG STATUS IrptGetData * IRPT_IRQ2_FLAG * IRPT_IRQ3_FLAG Description * IRPT_IRQ6_FLAG * IRPT_INT_FLAG This tool reads the * IRPT_WDOG_FLAG message. The interr * IRPT_PWM_FLAG interrupt handler is buffer. * IRPT_USER_FLAG The data returned fro Different messages f data. The pre-define listed below. The size in the last argument Return Value Name 29.3 Description PPSM_OK Successful operation PPSM_ERR_RELEASE Unable to release handler IrptRequest PPSM does not imp from User Defined h integrator. Parameter Syntax Return Value U32 IrptRequest(U32 handlerFlag) IRPT_AUDIO N/ Description This tool is used by the application task to request the services of the interrupt IRPT_HWR handlers. Once requested and granted, all interrupt messages sent from the handlers are directed to the application with the appropriate interrupt identifiers. IRPT_ICON N/ U3 When calling this tool, the user must specify which of the handlers it wishes to request. The interrupt flags can be OR'ed together to request more than one handler with a single call. If the requested handlers are installed and available, PPSM system will hook the handlers to the application; if not, PPSM will do nothing. IRPT_INPUT_ The return value from this tool is a 16-bit word, returning the flags of the STATUS handlers that have been granted, if any. It uses the same format as the input handler flag parameter. For example, if a caller makes a request for a specific set of handlers, and if all are granted, then the return value from the tool will be the same as the input handler flag parameter. If any one of the requested handlers cannot be granted, the return value will be different from the input flag IRPT_KEY parameter. If none is granted, a zero is returned. 29-4 Interrupt Handling Tools Interrupt Handling Tools For More Information On This Product, Go to: www.freescale.com U3 N/ Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Freescale Semiconductor, Inc... Return Value *sData *(*data) IRPT_PEN U32 - AreaId S16, S16 - (x, y) 4 IRPT_SPIM IRPT_RTC U32 - TimerId N/A 0 IRPT_SPIS IRPT_TIMER U32 - TimerId N/A 0 IRPT_UART N/A U16, U16 UART_ERROR, UART_ERR_TMOUT or UART_ERR_FRAME or UART_ERR_PARITY or UART_ERR_OVERRUN or UART_ERR_NODATA 4 OR IRPT_USER User defined IRPT_TIMER IRPT_UART IRPT_USER IRPT_WDG 29.2 IrptRelease U16 UART_DATA_RECEIVED or UART_DATA_SENT 2 User defined User Description defined Syntax STATUS IrptRelease Return Value Name 29-2 Name *size Description IRPT_AUDIO Indicating audio stopped IRPT_ERROR Invalid function parameter IRPT_HWR Handwriting Recognition interrupt IRPT_ICON Pen input on icon active area interrupt IRPT_INPUT_STATUS Pen Action Status for pen input IRPT_INT INT0-INT7 User Defined Handler IRPT_IRQ1 IRQ1 User Defined Handler IRPT_IRQ2 IRQ2 User Defined Handler IRPT_IRQ3 IRQ3 User Defined Handler IRPT_IRQ6 IRQ6 User Defined Handler IRPT_KEY External and soft keyboard interrupt IRPT_NONE No application interrupt has occur IRPT_PEN Pen input on application active area interrupt IRPT_PWM PWM User Defined Handler IRPT_RTC Real Time Clock interrupt Interrupt Handling Tools Interrupt Handling Tools For More Information On This Product, Go to: www.freescale.com This tool is used by th has successfully req released must be a v the IrptRequest() too requested for release released, any data o out and removed. Once an interrupt ha other applications tha The application shou Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual A request is success granted to another ta Parameter Personal Portable System Manager Software Licensed by Motorola Semiconductor H.K. Ltd. 1995-1998 Motorola Inc. Name handlerFlag Freescale Semiconductor, Inc... Figure 29-1 Standard Motorola logo Figure 29-2 Small Motorola logo Parameter Return Value Name calibration Description Flag to indicate if touch panel calibration is required. N/A * TRUE - do pen calibration * FALSE - do not do pen calibration Return Value Name 30-2 Description PPSM_OK Successful operation PPSM_ERR_NO_MEMORY Not enough memory PPSM_ERROR Initialization failed System Interrupt Handling ToolsTools For More Information On This Product, Go to: www.freescale.com Name Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 29.4 IrptSendData Chapter 30 System Tools Syntax STATUS IrptSendData(U16 irptType, U32 sData, P_U32 data, U32 size) Description 30.1 PPSMInit Passes the user defined interrupt message from interrupt handler back to Syntax application level. This routine should be called from the user installed interrupt handler only. After this message is sent from the interrupt handler, the application that has requested the handler will be able to receive this messageSTATUS PPSMInit(U via the IrptGetData() tool. Description Freescale Semiconductor, Inc... Parameter PPSM initialization ro system file before an Name irptType Description Interrupt Identifier: * IRPT_SPIM * IRPT_SPIS(DragonBall only) * IRPT_IRQ1 * IRPT_IRQ2 * IRPT_IRQ3 * IRPT_IRQ6 * IRPT_INT * IRPT_WDOG * IRPT_PWM * IRPT_USER sData This field can be used to send 4 bytes or less data to the application data Data buffer for storing data to send to the application size The size of data being sent, in number of bytes The input argument required at this time. With the default calib screen, one near the The user must press the pen input calibra The default calculati pixels (physical sizes of 100 (in A/D outpu edge of the touch p changing CalibratePe If logo displaying is screen during the p dimensions, a differe screen, one for a sm or the LCD height is Width (pixe Return Value width => 28 Name 29-6 Description PPSM_OK Successful operation PPSM_ERR_IRPT_HANDLER Handler not requested by application PPSM_NO_MEMORY Not enough memory Interrupt System ToolsHandling Tools For More Information On This Product, Go to: www.freescale.com 150 <= width < width < 15 Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 31.2 AudioInUse 30.2 Syntax ReadSMVersion Syntax U8 AudioInUse(void) STATUS ReadSMVe Description Description It checks if PPSM audio tools are currently being used. Returns PPSM majo major number will be Parameter Parameter Name Description Name Freescale Semiconductor, Inc... None major Return Value minor Name Description Return Value AUDIO_OFF PPSM audio tools are not being used WAVE_IN_USE PPSM wave play back audio tool is being used Name TONE_IN_USE 31.3 PPSM tone play back audio tool is being used AudioPlayTone Syntax STATUS AudioPlayTone(P_U16 toneData, U32 toneSize, U16 toneDuration, U8 autoRepeat) Description PPSM plays a sequence of different tone frequencies with each tone frequency having a fixed duration. Parameter Name 31-2 Description toneData The pointer to the tone frequency sequence, with frequency between 31Hz and 4048Hz toneSize Total number of tone frequencies to play. System Tools For More Information On This Product, Go to: www.freescale.com Audio Tools PPSM_OK PPSM_ERR_NO_ME Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 31 Audio Tools 31.1 AdvAudioPlayWa Syntax STATUS AdvAudioP U8 repea Freescale Semiconductor, Inc... Description This tool is valid for wave signal. This is configuration details. * * * The value of pre The repeat rate o The clksel in the This tool assumes th module. For most ca Parameter Name waveData waveSize prescaler repeat clksel Return Value Name PPSM_OK PPSM_ERR_AUDIO_ PPSM_ERR_AUDIO_ 30-4 Audio Tools For More Information On This Product, Go to: www.freescale.com System Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name Freescale Semiconductor, Inc... toneDuration autoRepeat Return Value Name PPSM_OK PPSM_ERR_AUDIO_ PPSM_ERR_AUDIO_ 31.4 AudioPlayWave Syntax STATUS AudioPlayW sampling Description This tool is for Drag signal with requested Parameter Name waveData 31-6 Audio Tools For More Information On This Product, Go to: www.freescale.com Audio Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Name waveSize Description Description Total number of data bytes occupied by the audio signal Terminates the wave Parameter samplingRate The requested sampling rate * SAMPLING_32KHZ * SAMPLING_16KHZ * SAMPLING_11KHZ * SAMPLING_8KHZ * SAMPLING_4KHZ Name None Return Value Freescale Semiconductor, Inc... Return Value Name Name 31.5 PPSM_OK Description PPSM_ERR_AUDIO PPSM_OK Successful operation PPSM_ERR_AUDIO_INUSE The PWM module is being used by another task. AudioStopTone Syntax STATUS AudioStopTone(void) Description Terminates the tone playing. Parameter Name Description Name Description None Return Value 31.6 PPSM_OK Successful operation PPSM_ERR_AUDIO The audio tool is not playing tone AudioStopWave (DragonBall-EZ only) Syntax STATUS AudioStopWave(void) 31-4 Audio Tools For More Information On This Product, Go to: www.freescale.com Audio Tools Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 0x000 PC/Stack 0x008 Part IV System Integrat Guide rom_reset Vectors 0x400 Boot Strap Code Freescale Semiconductor, Inc... 0x1000 PPSM Application Tasks rom_code Figure 30-1 Memory map for boot strap code 32.1.1.1 ROM_RESET This is used to map the 68K first 256 locations. In the boot strap code, it is defined as: SECTION DC.L DC.L DCB.L rom_reset MON_STACKTOP rom_start-ROMADDR 254,0 ; ; ; ; section declaration stack address for boot code absolute address of boot code interrupt vector space The labels MON_STACKTOP and rom_start declared in this region are resolved with their absolute address only during link time. This implementation makes the values for these locations dynamic and system integration can be independent to the absolute location and size of the hardware system. ROMADDR is declared in the Linker Specification File. 32.1.1.2 ROM_CODE This regions is declared to store the boot strap code. Because this code is NOT part of PPSM library, they are declared and executed in the beginning of the memory map to avoid memory conflict. The first line of this region MUST declare the label rom_start. This is required by the region rom_reset to work out the PC start address. The last line of this region should be a " jmp START" instruction. This is used to start PPSM start-up code. The label START is pre-defined as the start location for the startup code. 32-2 How to make ROM? For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 32 How to make To make PPSM applicati different from running PP items are: * * Boot Strap code Linker Specificat Freescale Semiconductor, Inc... This chapter gives some PPSM applications. 32.1 Boot Strap Code The boot strap code perf * * * * Starts the 68K co Map the chip-sel platform Initialization of pe Jump into PPSM Depending on the size an boot.s need to be change 32.1.1 68K Start-up In 68K architecture, the f 0x400, are reserved for s random values. The first defined for the start prog reset. In order to make this ass than hard-coding the add and rom_code, are defin mapping. How to make ROM? For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 32.1.2 Chip Selects For the M68328ADS dev and Chip-Select group B Integrated Processor Use programming. 32.1.3 Peripheral Devices Freescale Semiconductor, Inc... Initialization of the periph controller. Please refer to MC68328UM/AD, for det 32.2 Linker Supplicat The Linker Supplications main difference being tha address, and some regio are Read-Only, such as c Read/Write regions, such The listing below shows Example 30-1 Linker partition { overlay { region {} rom_re region {} rom_co region {} code[a region {} const; region {} string DATA = $; LCDPHYSWIDTH = 3 LCDPHYSHEIGHT = LCDVIRTWIDTH = 6 LCDVIRTHEIGHT = UARTRCVBUF = 256 } area2; } ROM[addr=0x400000,si partition { overlay { region {} data[a region {} ram[ro region {} malloc region {} stack[ STKTOP = $; } area1; } RAM[addr=0x In this example, a system location 0x400000 and 1 0x0 has the following cha * * * 32-6 How to make ROM? How to make ROM? For More Information On This Product, Go to: www.freescale.com The ROM area s The region rom_ address, which is The region rom_ address, which is Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual * * * * Freescale Semiconductor, Inc... * * * * * * * * * 32.3 As much executable code space in ROM as required, round to 432.3.2 byte boundary starting from 0x401000 As much constant data space in ROM as required, round to 4-byte boundary As much constant strings space in ROM as required, round to 4byte boundary DATA symbol to point to the downloadable address of the initialized constants to pre-initialized variables A LCD physical display screen of 320 pixels wide by 240 pixels high A panning screen of 640 pixels wide by 480 pixels high A 256 byte internal UART receive buffer The RAM area starts at base address 0x0 As much initialized data space as required starting from an offset of 0x400, round to 4-byte boundary As much zeroed uninitialized data space as required, round to 4byte boundary 512 KByte of heap space for dynamic memory allocation 128 KByte of stack space for system context switching A STKTOP symbol to point to the address of the 128 KByte stack Loader Commands Convert .OUT file format down -d mot .o Example 30-2 Loade down -d mot sample.out This will convert the sam be burned into ROM add Example 30-3 Loade down -d mot sample.out This will convert the sam be burned into ROM add Generating S-Record File After the PPSM application has linked with the ROM spc file, the SDS tools generates an output file in a proprietary format that is not suitable to download to ROMs. SDS provides a tool, the loader tool, that allows the conversion from this output file into S-Record format. 32.3.1 Loader Options To convert .OUT file into S-Record file, the following options are used: Options 32-4 -d mot generate Motorola S-Record format output file -o \.dwn the full name of the output file -m data, DATA Copy the initial values of initialized data into ROM area -w
Generate S-Record with offset
which is the base address of ROM How to make ROM? How to make ROM? For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 33 Device Drive ADS version 33.2.1 Q3 Q4 Q5 Q6 CS M68328ADS PJ3 PJ1 PJ2 PJ0 PJ7 M68EZ328ADS PD3 PD1 PD2 PD0 PE3 PPSM supports device d vendor dependent. Thes * * * * * * Pen Initialization Syntax void PenDevInit(void) System configura Pen input driver LCD driver Handwriting reco Font driver UART driver Freescale Semiconductor, Inc... Description In compilation, PIXEL_1 This function initializes SPI master and all the ports that are used for corresponding pen device dri sampling. M68328ADS implementation: 33.1 System Configur Port J is used to control the transistor network connected to the touch panel. The default initialization values for port J are to set all pins to be output I/O pins. There are 2 system confi * * Table 31-2 Port J Assignment Port J address Boot Strap Drive Interrupt handler bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 Direction Register 0xFFF428 1 x x x 1 1 1 33.1.1 Select Register 0xFFF42B 1 x x x 1 1 1 1 Boot Strap Driver (b Description 1 For SPI Master, the control register, 0xFFF802, is set for the following: Table 31-3 SPIM Assignment Bit Position Default Value (binary) 15 - 13 010 SPIM Enable 9 1 Exchange Bit 8 SPIM Interrupt Enable 6 1 Phase Shift 5 0 Polarity 4 0 3-0 1111 SPIM Control Register, 0xFFF802 Data Rate Clock Count 0 33.1.2 The boot strap code devices and to map c at boot time. Differe different boot strap c device driver library selects for the M68 Specification File an hardware configurati For hardware charac MC68328 Integrated User Interrupt Hand Description This interrupt handle handlers for certain k Users can replace th driver to perform exce these user-defined h M68EZ328ADS implementation: 33-4 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual refer to Chapter 15 - Interrupt Handling and Chapter 29 - Interrupt 33.2 Handling Pen Tools for details on interrupt handling. Input Device Please refer to the MC68328 Integrated Processor User's Manual, A/D MC68328UM/AD, for details on the interrupt controller. Vcc AN1 A single argument is passed into the interrupt handler. This argument is supplied by PPSM system to specify the address of the stack pointer just before calling the user-defined interrupt handler. Table 31-1 shows thePJ0 locations of the registers relative to this stack address. AN0 Table 31-1 Interrupt Stack Layout Q6 Vcc Q5 D0 - D7 PJ2 Freescale Semiconductor, Inc... A0 - A6 A7 CS PJ7 PC SPIMRxD Q4 Dout SR (16-bit) Argument is the address that points to here -> The following functions are the user defined interrupt handlers: Figure 31-1 Transistor network for pe void _SPIMIrptHandler(P_U32 stackPtr) SPI Master void _SPISIrptHandler(P_U32 stackPtr) SPI Slave(not available in EZ) void _IRQ6IrptHandler(P_U32 stackPtr) IRQ6 void _UARTIrptHandler(P_U32 stackPtr) UART void _WatchdogIrptHandler(P_U32 stackPtr) Watch Dog Timer void _KeyboardIrptHandler(P_U32 stackPtr) Keyboard void _PWMIrptHandler(P_U32 stackPtr) Pulse Width Modulator void _INTIrptHandler(P_U32 stackPtr) INT0-INT7 void _IRQ3IrptHandler(P_U32 stackPtr) IRQ3 void _IRQ2IrptHandler(P_U32 stackPtr) IRQ2 void _IRQ1IrptHandler(P_U32 stackPtr) IRQ1 Figure 31-1 shows the co pen input device: * * * 4 I/O pins on por network. I/O pin 7 on port D convertor. The SPI Master R output for the sa Please refer to the M683 hardware configuration. There are 4 functions in t M68328ADS implementation: * Pen Initialization * Pen Interrupt En These interrupt handlers perform no operation and return to the interrupted * Pen Interrupt Dis application immediately. * Pen Read Devic In general, _UARTIrptHandler() will not be executed. For PPSM source For M68EZ328ADS, the licensee, a "-DNO_UART_HANDLER" option can be used in compiler option to indicate that the internal UART interrupt handler is not used and port this D and E instead of p _UARTIrptHandler() is used instead. 33-2 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual For X sampling, the transistors Q4 and Q6 needs to be ON while transistors Q3 Port D and E are use and Q5 are OFF, see Figure 31-1, i.e. set Port D Data register, to 0xF9. Whilepanel. The default ini the transistors are in this setting, Port E pin 3 is asserted to activate the A/D O pins. convertor for the sampling. The digital value returned from the A/D convertor is stored in the SPI Data register. Port D For Y sampling, the procedure is the same as X sampling except that the transistors Q3 and Q5 needs to be ON while transistors Q4 and Q6 are OFF, Direction see Figure 31-1, i.e. set Port D Data register, to 0xF6. ad 0xF Register Freescale Semiconductor, Inc... 33.3 The X and Y samples thus obtained are returned to the caller in the pointer Select Register arguments passed in by the caller. 0xF Pullup Register 0xF Select Register 0xF Polarity 0xF Pen Calibration(PenInit.c) User normally needs to do calibration once the system startup time, in order to do INT Enable a correct mapping between touch panel coordination and screen display coordination. The system needs to have at least the upper-left and bottom-right INT Edge corner of the touch panel coordinate in terms of the screen display coordinate to do this coordinate mapping. 0xF 0xF Port E3 is initialized initialized to SPM fun Syntax STATUS CalibratePen( U16 logoFlag) For SPI Master, the c Description When pen calibration is necessary, PPSM calls this routine. User can replace the SPIM Control Regis default pen calibration algorithm with their own. At the end of this device driver routine, the origin and maximum point of the touch panel (in terms of display screen coordinate) should be fed back to PPSM by calling PenSetInputMax(x, y) Data Rate and PenSetInputOrg(x, y). SPIM Enable By default, the Motorola logo is displayed and two cross-hair, at the upper right and the bottom left corners, are used for pen calibration. Exchange Bit SPIM Interrupt Enable 33.4 Phase Shift LCD Device Drivers (lcddev.s) Polarity Two functions are needed in this driver for LCD controller initialization to drive the Clock Count LCD panel being used in the system. Only one of the following initialization functions will be called according to the graphics mode desired. 33.4.1 1 bit/pixel Initialization 33.2.2 Pen Interrupt Enabl Syntax Syntax void PenIrptEnable( void _LCDDev1(void) Description Description This function enables This function initializes the LCD controller for 1 bit/pixel graphics mode. Application programmer may add whatever statement to initialize the LCD 33-8 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual * M68328ADS implementation: Port M pin 6 is assigned as the PENIRQ pin. To enable PENIRQ, the following* sequence is required: * * * * * Enable Port M pin 6 pull-up resistor Discharge the transistor network such that all Vcc are on, ground are off, i.e. set Port J Data register, 0xFFF439, to 0xF0 Charge up the transistor that is connected to PENIRQ, i.e. set Port J Data register, 0xFFF439, to 0x0D Switch Port M pin 6 to interrupt pin, i.e. set Port M Selector register, 0xFFF448, bit 6 to 0 Enable Interrupt Mask Register, 0xFFF304, bit 20 for interrupt Please refer to M68328A switching. M68EZ328ADS impleme IRQ5 is assigned a sequence is required Please refer to the M68328ADS User's Manual for details on transistor network switching. Freescale Semiconductor, Inc... Discharge the tra are off, i.e. set P Switch transistor 0xFFF439, to 0x M68EZ328ADS implementation: * * * Disable Interrupt Switch Port F pin to 1 Disable Port F pi interfere with A/D Discharge the tra are off, i.e. set P Switch transistor to 0x05 * IRQ5(port F1) is assigned as the PENIRQ pin. To enable PENIRQ, the following sequence is required: * * Enable Port F pin 1 pull-up resistor * Discharge the transistor network such that all Vcc are on, ground Please refer to M68EZ32 are off, i.e. set Port D Data register, to 0xF0 switching. * Charge up the transistor that is connected to PENIRQ, i.e. set Port D Data register, to 0x0D * Switch Port F pin 1 to interrupt pin, i.e. set Port F Selector33.2.4 register, Pen Read Device bit 1 to 0 Syntax * Enable Interrupt Mask Register, bit 20 for interrupt Please refer to the M68EZ328ADS User's Manual for details on transistor network void PenReadDevic switching. Description 33.2.3 This function returns transistor network ac Pen Interrupt Disable Syntax M68328ADS implement void PenIrptDisable(void) For X sampling, the tr and Q5 are OFF, see 0xF9. While the trans the A/D convertor fo convertor is stored in Description This function disables the Pen Interrupt, PENIRQ. M68328ADS implementation: For Y sampling, the Port M pin 6 is assigned as the PENIRQ pin. To disable PENIRQ, the followingtransistors Q3 and Q sequence is required: see Figure 31-1, i.e. * * * 33-6 Disable Interrupt Mask Register, 0xFFF304, bit 20 for interrupt Switch Port M pin 6 to I/O pin, i.e. set Port M Selector register, 0xFFF448, bit 6 to 1 Disable Port M pin 6 pull-up resistor. If not switched off, it will interfere with A/D sampling The X and Y sample arguments passed in M68EZ328ADS impleme Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 33.6.1 Font Library Information module. Generally, "move.b #$00,$21(a0 A data structure type FONTLIB is required to store information about the font libraries being used. 33.4.2 The FONTLIB type is defined as follow: typedef struct { P_U8 baseAddr; U16 fontType; U16 fontWidth; U16 fontHeight; U16 bitmapSize; } FONTLIB, *P_FONTLIB; 2 bits/pixel Initializa Syntax void _LCDDev2(void Description This function initializ Application program module. Generally, "move.b #$00,$21(a0 Freescale Semiconductor, Inc... where: 1) baseAddr is the base address of the font bitmap library 2) fontType is the font type to be used for font look-up or generation 3) fontWidth is the width of the font bitmap of a character in number of pixels 4) fontHeight is the height of the font bitmap of a character in number of pixels 5) bitmapSize is the amount of memory occupied by one character font bitmap in unit of bytes Please refer to the MC68 AD, for details on the LC M68328ADS implement _LCDDev1 initializes * Assuming there is font bitmap or font generation engine available for each font type, the default font library information data structure could be initialized as follow: FONTLIB fontLib[] = { {(P_U8)SMALL_ENG_FONT_ADDR, SMALL_NORMAL_FONT, 8, 10, 10}, {(P_U8)SMALL_ENG_FONT_ADDR, SMALL_ITALIC_FONT, 8, 10, 10}, {(P_U8)LARGE_ENG_FONT_ADDR, LARGE_NORMAL_FONT, 16, 20, 40}, {(P_U8)LARGE_ENG_FONT_ADDR, LARGE_ITALIC_FONT, 16, 20, 40}, {(P_U8)GB_FONT_ADDR, GB_NORMAL_FONT, 16, 16, 32}, {(P_U8)BITMAP_BIG5_FONT_ADDR, BIG5_NORMAL_FONT, 16, 16, 32}, {(P_U8)SCALABLE_BIG5_FONT_ADDR, DEFAULT_SCALABLE_FONT, 16, 16, 32} }; _LCDDev2 initializes * * * The fontLib data structure above are indexed into by the corresponding PPSM font types. 33.6.2 * * Panel Interface C bus size and no Pixel Clock Divid Polarity Configur the LCD panel u * Panel Interface C bus size with gra Pixel Clock Divid directly Gray Palette Ma 0x3075 Polarity Configur the LCD panel u Font Library or Font Generation Engine Initialization 33.5 Handwriting Rec Syntax This driver is required for handwriting input while s engines. The driver func handwriting recognition in void FontInit(void) Description This This function initializes the font libraries and font generation engines, if driver consists of fou applicable. This function will be called at PPSM initialization time. Note: 33-12 Font bitmaps libraries usually do not require any initialization, 33.5.1 whereas font generation engines do. Therefore, when applicable, this driver function should call an initialization Handwriting Recog Syntax Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Parameter void ResetRecEngine(void) Description Name This function resets the handwriting recognition engine to its default state. numPoints This function should call a reset function (if any) provided by the handwriting strokeData recognition engine. In some cases, ResetRecEngine() may perform the same functions as InitRecEngine() (Section 33.5.2 - Handwriting Recognition Engine inputAreaId Initialization). This function is called once when initializing the character input pad during the call of OpenInputPad(). Freescale Semiconductor, Inc... 33.5.2 Handwriting Recognition Engine Initialization 33.5.4 Initiate Character R Syntax Syntax void RecognizeInpu void InitRecEngine(void) Description Description This function perform This function initializes or installs the handwriting recognition engine. 33.5.3 This function should This function should call an initialization function (if any) provided by thehandwriting recognit handwriting recognition engine and set up data structures required by theprocessed stroke da engine for the recognition process. expected to return to being recognized, an This function is called once at PPSM initialization time. This function is calle an input time-out. Process One Stroke of Handwriting Input Data Return Value Syntax Name void ProcessStroke(U16 numPoints, P_POINT strokeData, U32 inputAreaId) numCandidates Description This function processes one stroke of handwriting input data collected by the system. candidates Based on the input parameters, this function should convert the handwritingNote: Since PPSM recognition e data for one stroke of input (if necessary) into the format being acceptable by default to pe the corresponding handwriting recognition engine. The reformatted stroke data should then be sent to the handwriting recognition engine (by calling a function provided in the handwriting recognition engine) for pre-processing or optimization before the actual handwriting recognition is initiated. 33.6 Font Driver (font This function is called for every stroke of data collected. This driver is required for supporting multiple font t vendors. The font driver consists o 33-10 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual routine provi Return Value Name Since PPSM does n function is default to Description None 33.6.3 Note: The driver function mentioned above is default to perform no operation. Font Accessing Syntax P_U8 FontGetCharA 33.8.4 Disabling I/O ports when going to sleep mode Description Syntax This function returns attributes and charac Freescale Semiconductor, Inc... void PortSleepDisable(void) Please refer to Sectio FONTATTR data stru Description Just before PPSM goes into sleep mode, it will call this routine to disable any user defined I/O ports that are not handled internally by PPSM. User must add Font lookup or gener supplier. This drive in the code to disable the I/O ports in this routine. corresponding font ty Return Value the font attributes. Name Since PPSM include method for mapping font types that use th Description None Note: * * * * The driver function mentioned above is default to perform no operation. SMALL_NORMA SMALL_ITALIC_ LARGE_NORMA LARGE_ITALIC_ Parameter Name pFont code Return Value Name N/A 33-16 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual 33.7 UART Device Driver (uartdev.c) 33.8.1 Enabling I/O ports w This UART device driver is a supplement to the PPSM Serial Communication Syntax Tools as described in Chapter 26 - UART Communication Tools. Currently this void PortDozeEnabl driver contains the UARTDevSendBreak() function which allows applications to send the BREAK character. This UARTDevSendBreak() function manipulates Description the MC68328 UART hardware registers. It is assumed that the saving, setting and restoring of appropriate system interrupt level is handled by the caller of this When PPSM wakes u device driver. user defined I/O port in their own I/O initia 33.7.1 Sending the BREAK Character Return Value Syntax Freescale Semiconductor, Inc... Name void UARTDevSendBreak(U8 sendBreak) None Description This function starts or stops the MC68328 UART hardware to send the BREAK character depending on the given flag. Note: The driver fu operation. If sendBreak flag is UART_SEND_BREAK, the UART hardware 33.8.2will start Disabling I/O ports sending the BREAK character. Syntax If sendBreak flag is UART_ABORT_BREAK, the UART hardware will stop sending the BREAK character. void PortDozeDisab It is assumed that sendBreak has to be one of the values stated. Any other Description value will be treated as UART_ABORT_BREAK. Just before PPSM go Parameter user defined I/O port in the code to disable Name sendBreak Description Return Value Operation flag * UART_SEND_BREAK Starts sending BREAK characters * UART_ABORT_BREAK Stops sending BREAK characters Name None Note: Return Value Name None Description 33.8.3 The driver fu operation. Enabling I/O ports w Syntax void PortSleepEnab 33.8 Power Management Driver (iodev.c) Description 4 functions are located in iodev.c for enabling or disabling I/O ports before going to When PPSM wakes u user defined I/O port doze or sleep mode or leaving doze or sleep mode. in their own I/O initia 33-14 Device DriversDevice Drivers For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 34 Linker Specif PPSM makes use of the development environmen defines the locations and symbols. It is written in a files, please refer to the S PPSM required a few use Table 32-1. Freescale Semiconductor, Inc... Table 32-1 Sym Symbol Name LCDPHYSWIDTH LCDPHYSHEIGHT LCDVIRTWIDTH LCDVIRTHEIGHT UARTRCVBUF System integrators inform hardware system using t PPSM maintains a stack The system integrator mu and heap. In general, the memory for application u For details on memory m PPSM also maintains an storage for data received is the optimal buffer size 34.1 .SPC File for a R Following is an example (for SDS use only) with 2 system has the following * * * * 34-4 Linker Specification Linker Specification File File For More Information On This Product, Go to: www.freescale.com The RAM system 4 KByte of reserv vectors and SDS As much executa boundary As much constan boundary Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual * * * Freescale Semiconductor, Inc... * * * * * * * * As much constant strings space as required, round to 4-byte boundary As much initialized data space as required upon reset, round to 4byte boundary As much zeroed memory space as required, round to 4-byte boundary 704 KByte of heap space for dynamic memory allocation 128 KByte of stack space for system context switching A STKTOP symbol to point to the top of the 128 KByte stack a DATA symbol to point to the downloadable address A LCD physical display screen of 320 pixels wide by 240 pixels high A panning screen of 640 pixels wide by 480 pixels high A 256 byte internal UART receive buffer 2 MByte of RAM Example 32-1 Linker Specification File Example partition { overlay { region {} reset[addr=0,size=0x1000];/* reset vector */ region {} code[roundsize=4];/* executable code */ region {} const[roundsize=4];/* constant data */ region {} string[roundsize=4];/* constant strings */ region {} data[roundsize=4];/* initialized on reset */ region {} ram[roundsize=4];/* zeroed on reset */ region {} malloc[size=0xB0000];/* malloc space */ region {} stack[size=0x20000];/* stack */ STKTOP = $;/* SP reset value */ DATA = $;/* "data" download addr */ LCDPHYSWIDTH = 320;/* LCD display width */ LCDPHYSHEIGHT = 240;/* LCD display height */ LCDVIRTWIDTH = 640;/* LCD virtual width */ LCDVIRTHEIGHT = 480;/* LCD virtual height */ UARTRCVBUF = 256; /* system UART receive buffer size(in #bytes) */ region {} malloc[s ...... } example; } RAM[addr= 2) Following error m LINKER: error: actual LINKER: error: overlay NMAKE : fatal error U1 Stop. 3) Then, we can ca exceeding bytes 0x2 4) Finally, we can w partition { overlay { region {} reset[ad ..... region {} malloc[s ...... } example; } RAM[addr= 5) This optimum ma source code by s found after debu } example; } RAM[addr=0x0, size=0x200000] 34.2 .SPC File for a ROM-RAM System The .SPC file for a ROM-RAM system consists of two partitions. One partition for the ROM layout and one partition for the RAM layout on the system. Please refer to Chapter 32 - How to make ROM? for a specific example of a .SPC file for such a system. 34.3 For SingleStep Debugging System (SDS) user One of the methods to find out the optimum size specified in the malloc field in the .SPC file will be shown below. This method may not be applicable to other debugging system. 1) First of all, we set the RAM size to 2 M, so as the malloc size. For example, partition { overlay { region {} reset[addr=0x0]; ..... 34-2 /* reset vector */ Linker Specification Linker Specification File File For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Chapter 35 Trap Usage in PPSM tools access the P When an application mak is called with the correct calling the actual function On the 68K, there are 16 instruction mapping for th Freescale Semiconductor, Inc... Tabl TRAP Number T 1 2 3 4 5 6 7 35.1 PPSM Tools Call For the protection of the is introduced in the PPSM The first level is a stub lib application developers. T function body consists of The second level is the T in by the stub library and With this implementation PPSM system code can portability of the PPSM s 35.2 TRAP Implement Figure 34-1 shows a bloc application makes a syst sections are implemente 35-8 Trap in Usage in PPSM Trap Usage PPSM For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual the caller's argument list the PPSM tools function overhead induces during a system call. Application Stub Library TRAP Handler Actual Tool System Code System Call (+12) Written in `C' Stub Call TRAP Call Written in `C' and Assembly Written in Assembly Language (+8) Written in `C' (+4) Freescale Semiconductor, Inc... A6 ROM RAM (-4) Figure 34-1 PPSM Tools Calling Structure 35.2.1 Figure 34-2 Application Applications are written in ANSI C. All PPSM system tools use ANSI C procedure calling convention. Because SingleStep C compiler allows assembly languageTRAP in 35.2.3 C source code, it is also allowed in PPSM applications. 35.2.2 The TRAP Service Hand There are 7 jump tables, Stub Library The jump table consists o are used as the PPSM sy The Stub Library provides an interface between application code and system handler when it receives routines. Its main function is for parameter passing and calling TRAP instruction general code layout for a with the correct arguments. It is written in a ANSI C with 68K assembly language .FREF _Func_1,2 embedded format. Each function in the stub library has the general layout as .FREF _Func_2,8 shown below: int JMPTABLE: DC.L _Func_1, simplification( int a, int b) #define NO_OF_ARGUMENT2 #define FUNC_NUMBER5 #define TRAP_NUMBER3 int asm( rv; /* return value */ " " " " " LEA 8(A6),A0", MOVE.W #NO_OF_ARGUMENT,D1", MOVE.W #FUNC_NUMBER,D0", TRAP #TRAP_NUMBER", MOVE.L D0,{rv}", ); return (rv); } The first instruction that SingleStep C compiler generates for the start of a `C' procedure is a "LINK" instruction. This instruction sets the frame pointer, A6, to points to the stack that is used by the procedure caller. To access the first argument, an offset of 8 is added to A6, see Figure 34-2. The Stub Library passes 35-6 Service Hand Trap in Usage in PPSM Trap Usage PPSM For More Information On This Product, Go to: www.freescale.com Trap_1: LSL.W #2,D1 ; M ADD.L D1,A0 ; M LSR.W #2,D1 ; M loop_1: TST.W D1 ; A BEQ loop_2 ; I MOVE.L -(A0),-(A SUBQ.W #1,D1 ; D BRA loop_1 ; loop_2: LEA JMPTABLE, LSL #2,D0 ; G ADD.L D0,A0 ; F MOVEA.L(A0),A1; JSR (A1) ; J RTE Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual Append Table A-1 Error Code Definition Freescale Semiconductor, Inc... Error Code Definition PPSM_ERR_DB_ADD Unable to add database PPSM_ERR_DB_DBID Invalid database identifier PPSM_ERR_DB_FDID Invalid field identifier PPSM_ERR_DB_READNO Invalid number found PPSM_ERR_DB_RECID Invalid record identifier PPSM_ERR_DB_SFLAG Invalid secret flag value PPSM_ERR_DB_TYPE Invalid data type PPSM_ERR_DOT_WIDTH newWidth is 0 PPSM_ERR_DOZE_TIME Doze time-out period out of range PPSM_ERR_DRAW_INIT Invalid draw pointer PPSM_ERR_FILL_PATTERN Invalid fill pattern mode PPSM_ERR_FILL_SPACE Invalid space gap in fill pattern PPSM_ERR_GREY Invalid grey level value PPSM_ERR_HEIGHT Invalid graphics output area height Invalid height PPSM_ERR_HOUR Personal Porta Program Invalid hour pointer Invalid hour value PPSM_ERR_ICON_TYPE Invalid predefined icon type for control icon PPSM_ERR_INPUT_PAD_CLOSED Input pad is not opened PPSM_ERR_INPUT_PAD_HEIGHT Input pad height out of range PPSM_ERR_INPUT_PAD_NOSCREEN No panning screen for input pad PPSM_ERR_INPUT_PAD_OPENED Input pad already opened PPSM_ERR_INPUT_PAD_WIDTH Input pad width out of range PPSM_ERR_INPUT_PAD_X_POS Input pad x-coordinate out of range PPSM_ERR_INPUT_PAD_Y_POS Input pad y-coordinate out of range PPSM_ERR_INVALID_ACCESS Invalid access of UART PPSM_ERR_INVALID_TMOUT Time-out value out of range PPSM_ERR_IRPT_HDLER Handler not requested by application PPSM_ERR_LCD_FONT Invalid font type PPSM_ERR_LCD_GREY Invalid background grey level Invalid grey level value A-2 Error Code Definition For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Programmer's Manual Personal Porta Program Appendix A Error Code D The following are the def T Error Cod Freescale Semiconductor, Inc... PPSM_OK PPSM_ERROR PPSM_ERR_ACTIVE_PO PPSM_ERR_ACTIVE_PU PPSM_ERR_AREA_COD PPSM_ERR_AREA_ID PPSM_ERR_AUDIO_INU PPSM_ERR_AUDIO_REG PPSM_ERR_AUDIO_SAM PPSM_ERR_AUDIO_TON PPSM_ERR_BAUD PPSM_ERR_BUSY PPSM_ERR_CHARLEN PPSM_ERR_COLOUR PPSM_ERR_COORDINA PPSM_ERR_CURSOR_IN PPSM_ERR_DAY Error Code Definition For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual T Error Cod PPSM_ERR_LCD_RADIU PPSM_ERR_LCD_STYLE PPSM_ERR_LCD_X PPSM_ERR_LCD_Y PPSM_ERR_MINUTE Freescale Semiconductor, Inc... PPSM_ERR_MODE PPSM_ERR_MONTH PPSM_ERR_NO_ALARM PPSM_ERR_NO_MEMOR PPSM_ERR_NO_REQUE PPSM_ERR_NUM_FMT PPSM_ERR_PAN_ADDR PPSM_ERR_PAN_HEIGH PPSM_ERR_PAN_INIT PPSM_ERR_PAN_WIDTH PPSM_ERR_PARITY PPSM_ERR_PEN_GET PPSM_ERR_PEN_INIT PPSM_ERR_PEN_RATE PPSM_ERR_PERIOD PPSM_ERR_RCTS_IDLE PPSM_ERR_REF_MAX PPSM_ERR_RELEASE PPSM_ERR_SECOND PPSM_ERR_SKBD_USE PPSM_ERR_SKBD_XSIZ PPSM_ERR_SKBD_X_PO PPSM_ERR_SKBD_YSIZ B-2 Error CodeList Definition of References For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Appendix B List of Refere Table A-1 Error Code Definition Error Code Definition PPSM_ERR_SKBD_Y_POS Soft keyboard y-coordinate out of range PPSM_ERR_SLEEP_TIME Sleep timeout period out of range PPSM_ERR_STOPBIT Invalid number of stop bits flag PPSM_ERR_TASK_FLAG Invalid screen flag PPSM_ERR_TASK_HEIGHT Invalid screen height PPSM_ERR_TASK_ID Invalid address for storing task identifier Freescale Semiconductor, Inc... Invalid task identifier PPSM_ERR_TASK_WIDTH Invalid screen width PPSM_ERR_TEXT_CR Error while creating text template PPSM_ERR_TEXT_CUR Invalid character cursor position PPSM_ERR_TEXT_FONT Invalid font type PPSM_ERR_TEXT_GREY Invalid text grey level value PPSM_ERR_TEXT_HEIGHT Given height extends text display area beyond the panning screen PPSM_ERR_TEXT_ID Invalid text template identifier PPSM_ERR_TEXT_STYLE Invalid output style type PPSM_ERR_TEXT_WIDTH Given width extends text display area beyond the panning screen PPSM_ERR_TEXT_X Text template x-coordinate out of range PPSM_ERR_TEXT_Y Text template y-coordinate out of range PPSM_ERR_TMOUT_VALUE Invalid time-out period PPSM_ERR_WIDTH Invalid graphics output area width 1) Addendum and E Microprocessor U 2) Computer Graph Feiner and Huge 3) CrossCode C Development Sy 4) MC68328ADS A 5) MC68328 Integra AD.Motorola, Inc 6) SingleStepTM De Software Develo 7) M68EZ328ADS Motorola, Inc. 8) MC68EZ328 Inte Invalid width PPSM_ERR_X_POS Invalid dot x position PPSM_ERR_YEAR Invalid year pointer Invalid year value A-4 PPSM_ERR_Y_POS Invalid dot y position PPSM_NO_MATCH No match of data Error Code Definition List of References For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Appendix C23-10 Index of PPS 23-11 RefTimeAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RefTimeAlarmId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RefTimeDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RefTimeRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S 23-11 23-12 A Freescale Semiconductor, Inc... SaveRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-30 ActiveAreaDisable . . . . . ScanningOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-14 ActiveAreaEnable . . . . . ScanningOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-14 ActiveAreaPosition . . . . SendMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28-3 ActiveAreaRead . . . . . . SetDotWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-31 ActiveAreaSuspend . . . SetDozeMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25-1 ActiveAreaToFront . . . . SetDozePeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25-1 ActiveListPop . . . . . . . . SetDutyCycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25-2 ActiveListPush . . . . . . . SetPatternFill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-31 AdvAudioPlayWave . . . SetPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-12 AdvMessageDelete . . . . SetPeriodId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-13 AdvOpenInputPad . . . . . SetSleepMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25-3 AdvOpenSoftKey . . . . . SetSleepPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25-3 AdvSendMessage . . . . . SubTaskCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-3 AdvTaskCreate . . . . . . . T AlarmClear . . . . . . . . . . AlarmClearId . . . . . . . . . AlarmRead . . . . . . . . . . AlarmReadId . . . . . . . . . TaskCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-4 AlarmSet . . . . . . . . . . . . TaskHook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-5 AlarmSetId . . . . . . . . . . TaskMemUsed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24-4 AppSwap . . . . . . . . . . . . TaskReInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-5 AreaEchoDisable . . . . . TaskStackAvail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24-4 AreaEchoEnable . . . . . . TaskStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-6 AudioInUse . . . . . . . . . . TaskTerminate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-7 AudioPlayTone . . . . . . . TextCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-1 AudioPlayWave . . . . . . . TextDelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-1 AudioStopWave . . . . . . TextMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-2 TextReadCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-2 . . . . . . . . . 22-3 TextSetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C TextSetDisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-4 TextSetFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-5 ChangePanning . . . . . . TextSetOutlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-6 ChangeWindow . . . . . . . TextSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-7 ClearRec . . . . . . . . . . . . TextUnmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-9 ClearScreen . . . . . . . . . Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23-12, 23-14 CloseInputPad . . . . . . . TimeoutId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-15 CloseSoftKey . . . . . . . . TotalMemSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24-5 CtrlIconDisable . . . . . . . TotalMemUsed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24-5 CtrlIconEnable . . . . . . . U UARTConfigure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UARTFlowCtrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UARTInquire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UARTRcvCtrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-4 CursorGetOrigin . . . . . . CursorGetPos . . . . . . . . CursorGetStatus . . . . . . CursorInit . . . . . . . . . . . 26-1 CursorOff . . . . . . . . . . . 26-3 CursorSet . . . . . . . . . . . 26-3 CursorSetBlink . . . . . . . 26-4 of Tools PPSM Tools Index ofIndex PPSM For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Freescale Semiconductor, Inc... D E G CursorSetOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I. . . . . . . . 20-10 CursorSetPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-10 CursorSetStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-11 IconScanOff . . . . . . . . . IconScanOn . . . . . . . . . InputTimeout . . . . . . . . . InvRec . . . . . . . . . . . . . . IrptGetData . . . . . . . . . . DateTimeRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-5 IrptRelease . . . . . . . . . . DateTimeSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-6 IrptRequest . . . . . . . . . . DBAdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-1 IrptSendData . . . . . . . . . DBAddRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-1 DBAddRecToTop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2 . . . . . . . . . 21-3 DBAppendRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . L DBChangeStdData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-4 DBChangeUnfData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-5 Lcalloc . . . . . . . . . . . . . . DBDelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-6 LCDContrast . . . . . . . . . DBDeleteRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-6 LCDRefreshRate . . . . . . DBGetFirstRecID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-7 LCDScreenMove . . . . . . DBGetNextRecID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-8 Lfree . . . . . . . . . . . . . . . DBGetPrevRecID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-8 Lmalloc . . . . . . . . . . . . . DBReadData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-9 Lrealloc . . . . . . . . . . . . . DBReadTotalNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-10 DBReadTotalNumberRecords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-11 . . . . . . . . 21-11 DBReadUnfData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M DBRecordSecret . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-12 MessageDelete . . . . . . . DBSearchData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-13 MoveBlock . . . . . . . . . . DBSecretFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-14 DBSetRecordSecretFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-15 DBSetSecretFlag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-15 O DeleteTimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-7 DisplayMove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-12 OpenInputPad . . . . . . . . DrawArc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-13 OpenSoftKey . . . . . . . . . DrawCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-13 DrawDot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-14 . . . . . . . . 20-15 DrawEllipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P DrawHorz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-16 DrawLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-17 PenCalibration . . . . . . . DrawRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-18 PenEchoParam . . . . . . . DrawVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-19 PenGetInput . . . . . . . . . DrawVert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-20 PenSetInputMax . . . . . . PenSetInputOrg . . . . . . PenSetRate . . . . . . . . . . PPSMInit . . . . . . . . . . . . PutChar . . . . . . . . . . . . . ExchangeRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-21 PutRec . . . . . . . . . . . . . R GetDisplayX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GetDisplayY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GetLogicalX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GetLogicalY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GetScreenMem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2 20-22 ReadSMVersion . . . . . . 20-23 RefFineTimeAlarm . . . . 20-23 RefFineTimeAlarmId . . . 20-24 RefFineTimeDiff . . . . . . 20-24 RefFineTimeRead . . . . . of Tools PPSM Tools Index ofIndex PPSM For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Personal Portable System Manager Personal Porta Program Programmer's Manual Freescale Semiconductor, Inc... UARTReadData . . . . . . UARTReceive . . . . . . . . UARTSend . . . . . . . . . . UARTSendAbort . . . . . . UARTSendCtrl . . . . . . . UARTSetDelay . . . . . . . UARTTimeout . . . . . . . . C-6 of Tools PPSM Tools Index ofIndex PPSM For More Information On This Product, Go to: www.freescale.com