The C Programmer’s Guide to the Mosaic HandheldTable of ContentsPART 1 GETTING STARTED Introduction. How to Use This Manual Chapter 1: Getting to Know Your Handheld Instrument Chapter 2: Powering Your Handheld PART 2 PROGRAMMING THE MOSAIC HANDHELD Chapter 4: The IDE: Writing, Compiling, Downloading and Debugging Programs Chapter 5: Making Effective Use of Memory Chapter 6: Real Time Programming Chapter 7: Failure and Run-Time Error Recovery Chapter 8: Programming the Graphical User Interface PART 3 COMMUNICATIONS, MEASUREMENT, AND CONTROL Chapter 9: Digital and Timer-Controlled I/O Chapter 11: Serial Communications Chapter 12: The Battery-Backed Real Time Clock Chapter 13: Customizing the Handheld's I/O PART 4: REFERENCE DATA |
Glossary A B C DF G H I K LM N P R S T UVWXY DATA_ENTRY_EVENT_PROCEDURE
Type Constant Return Value Integer Description The name of a keypad property that contains the xcfa (extended code field address) of a user defined event procedure. The event procedure is called after a non-overloaded data entry key is pressed or after the timeout period of a pressed overloaded data entry key is reached. The event procedure can not take or return any parameters, but it can modify variables. The DATA_ENTRY_EVENT_PROCEDURE property is unitialized when Initialize_GUI is called. Usage Set_Property ( GUI_KEYPAD0, DATA_ENTRY_EVENT_PROCEDURE, (long) delete_event_procedure_ptr );
Library library.c
See Also INT_DATA_ENTRY_EVENT_PROCEDURE DATA_ENTRY_KEY
Type Constant Return Value Integer Description The name of an object type used to create a new data entry key object. Data entry keys are used to enter characters and symbols or glyphs into a textbox to be shown on the display. Data entry keys may be overloaded, that is the same key can have different meanings depending upon the key’s context (i.e. the shift state and the number of times the key has been pressed). Once a data entry key is instantiated, a KEY_CODE must be associated to one of the SHIFT_UP_VALUE, SHIFT_NEUTRAL_VALUE, or SHIFT_DOWN_VALUE properties and the key must be inserted into a keypad. Usage dataentrykey0 = New_Object ( DATA_ENTRY_KEY ); Set_Property ( dataentrykey0, SHIFT_NEUTRAL_VALUE, (long) ‘0’ ); Insert_Key ( GUI_KEYPAD0, datakentrykey0, 8 );
Library library.c
See Also SHIFT_UP_VALUE, SHIFT_NEUTRAL_VALUE, SHIFT_DOWN_VALUE, ACTION_KEY, SHIFT_KEY, Insert_Key
DATA_ENTRY_TEXTBOX
Type Constant Return Value Integer Description The name of a keypad property that contains the object reference to a textbox that contains the key codes of pressed data entry keys. Once a textbox is associated with a keypad, the textbox is loaded on to the VISIBLE screen, and a data entry key is pressed, the KEY_CODE (based on the SHIFT_STATE and PRESS_NUMBER) from the data entry key is added to the string in the textbox and the corresponding glyph is drawn to the display (the textbox is automatically refreshed). The DATA_ENTRY_TEXTBOX property is unitialized when Initialize_GUI is called. Usage Set_Property ( GUI_KEYPAD0, DATA_ENTRY_TEXTBOX, textboxString );
Library library.c
See Also KEY_CODE, PRESS_NUMBER, SHIFT_STATE, VISIBLE
DATA_OUT_OF_RANGE
Type Constant Return Value Integer Description The name of an error that indicates the data value added to a plot object is out of range. The valid data range of a plot is from 0 to the height of the plot object in pixels. If this error occurs, the Add_Data method recovers from the error by storing a value equal to the height of the plot object in pixels. Usage Add_Data(plotVoltage, 300); If(Read_Error() == DATA_OUT_OF_RANGE) { printf(“Data value is out of range of the plot.\n”); Clear_Error(); }
Library library.c
void Delete_Character ( uint textbox_reference )
Type Function Input Parameters textbox_reference A 16 bit reference to a textbox object. Description A method that deletes a character from the string in a textbox object. The character is deleted from the end the string in the textbox. A possible error is INVALID_TEXTBOX. Usage Delete_Character( textboxString ); Refresh ( GUI_SCREEN0 ); // Refresh screen to update textbox.
Library library.c
See Also Add_Character
DISPLAY_INITIALIZATION_FAILURE
Type Constant Return Value Integer Description The name of an error that indicates there was an error initializing the display controller. This error indicates there was a hardware failure. Please contact Mosaic Industries for a Return Material Authorization. Usage Initialize_GUI(START_GUI_HEAP, END_GUI_HEAP); If (Read_Error() == DISPLAY_INITIALIZATION_FAILURE) { printf(“Display initialization failure.\n“); Clear_Error(); }
Library library.c
void Draw ( uint x_coordinate, uint y_coordinate )
Type Function Input Parameters x-coordinate A 16 bit number that specifies the x-coordinate of the point to draw. y-coordinate A 16 bit number that specifies the y-coordinate of the point to draw. Description A method that draws a point or line onto a screen. The screen to draw to, the type of object to draw (point or line), and the option to draw or erase, a point or a line are properties of the GUI_PEN. To draw a line, set the LAST_COORDS property of the GUI_PEN as the first end point and use the coordinates passed to Draw as the second end point. Errors include: X_OUT_OF_RANGE and Y_OUT_OF_RANGE. Usage Draw(45, 63);
Library library.c
FIRST_VISIBLE_LINE
Type Constant Return Value Integer Description The name of a textbox property that sets the top line to be rendered in a textbox that contains a string with more lines than the textbox will show. Used to scroll text in a textbox. The FIRST_VISIBLE_LINE property is initialized to 0 when the textbox is instantiated. Usage void Scroll_Up_Event_Procedure ( void ) { long line;
line = Get_Property ( textboxString, FIRST_VISIBLE_LINE); if ( line > 0 ) { Set_Property ( textboxString, FIRST_VISIBLE_LINE, line - 1 ); Refresh( GUI_SCREEN0 ); // Be sure to refresh screen, show change. } // Re-enable the servicing of events. The key was set to disable // events on press. Set_Property( GUI_TOOLKIT, SERVICE_EVENTS, GUI_TRUE ); }
Library library.c
FONT
Type Constant Return Value Integer Description The name of an object type used to create a new font object. Before the font is associated with a textbox, its IMAGE and FONT_WIDTH_DATA must be set using the Set_Property method. Usage fontTimes = New_Object( FONT );
Library library.c
See Also FONT_WIDTH_DATA FONT_WIDTH_DATA
Type Constant Return Value Integer Description The name of a font property that contains the address of an array that contains the width in pixels of each character of a font. The width data and its address are generated by the Mosaic’s Image Conversion Program and stored in the Image Data File and Image Header File respectively. The FONT_WIDTH_DATA property is unitialized when the font is instantiated. Usage fontComicSans = New_Object( FONT ); Set_Property ( fontComicSans, IMAGE, COMIC_SANS_8_BMP); Set_Property ( fontComicSans, FONT_WIDTH_DATA, COMIC_SANS_8_DAT);
Library library.c
FULL_BATTERY
Type Constant Return Value Long Description The name of a value of the BATTERY_STATE property of the GUI_BATTERY object that indicates a full charge on the rechargeable batteries. Usage If ( Get_Property ( GUI_BATTERY, BATTERY_STATE ) == FULL_BATTERY ) { printf(“The batteries are fully charged.\n”); }
Library library.c
See Also BATTERY_STATE, GUI_BATTERY, LOW_BATTERY, MEDIUM_BATTERY, NO_BATTERY |
Home|Site Map|Products|Manuals|Resources|Order|About Us
Copyright (c) 2006 Mosaic Industries, Inc.
Your source for single board computers, embedded controllers, and operator interfaces for instruments and automation