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 void Schedule_Event(ulong event, ulong interval, ulong start, ulong stop)
Type Function Input Parameters event_xcfa A 32 bit number that refers to the event procedure to be scheduled. interval A 32 bit number that specifies the interval that the event is to be executed in timeslice counts. start A 32 bit number that specifies the absolute start time of the event in timeslice counts. stop A 32 bit number that specifies the absolute stop time of the event in timeslice counts. Description A method that adds the specified event procedure to the GUI Toolkit’s endless execution loop so that it will be repeatedly executed. The interval paramter specifies the how often the event procedure will be called. The start parameter specifies when the event procedure will first be called; 0 indicates that the event procedure will start to be called immediately. The stop parameter specifies when the event will no longer be called; 0 indicates that the event procedure will be called forever. The units for the interval, start, and stop parameters are in timeslice counts or 5 millisecond units. No error checking is performed. If the event procedure reads, writes, or modifies any object or property of the GUI Toolkit, the first line of the event procedure must disable the servicing of events and the last line of the event procedure must re-enable the servicing of events to prevent data corruption. Schedule Event should be used for non-critical event scheduling because events may be delayed by interrupt service routines and other tasks. For critical event timing, use an interrupt service routine. Usage \\ Schedule an event to be repetitively called once every 5 seconds. Schedule_Event ( battery_monitor_ptr, 1000, 0, 0);
Library library.c
See Also Remove_Event SCREEN
Type Constant Return Value Integer Description The name of an object type used to create new screen objects whose data resides in the GUI heap as opposed to GUI Screens whose data resides in the RAM in the display controller. Only GUI Screens can be made visible (using the VISIBLE property) and shown on the display. Screens that reside in the heap are useful for applications with many screens; heap screens can be loaded at initialization and quickly copied to a GUI Screen in the display when needed using the Copy_Screen method. Usage screenHeap = New_Object ( SCREEN );
Library library.c
See Also Copy_Screen, VISIBLE SCREEN_ADDRESS
Type Constant Return Value Integer Description The name of a screen property that contains the extended address of the screen’s data buffer where images are drawn into. This property is read only. Usage longAddress = Get_Property(GUI_SCREEN0, SCREEN_ADDRESS);
Library library.c
SERVICE_EVENTS
Type Constant Return Value Integer Description The name of a GUI Toolkit property that determines if keypad or timer events are serviced and event procedures are called. Possible contents of this property are the booleans GUI_TRUE and GUI_FALSE. SERVICE_EVENTS is set to GUI_TRUE by Initialize_GUI. Usage Set_Property(GUI_TOOLKIT, SERVICE_EVENTS, GUI_FALSE);
Library library.c
void Service_GUI_Events ( void )
Type Function Description A method that executes the user defined event procedures of action keys or the timer object. In a typical application, this method must be included in a task, separate from the GUI Toolkit’s task, as part of the tasks infinite loop to service events generated from the keypad or the timer. Usage Service_GUI_Events();
Library library.c
SET
Type Constant Return Value Long Description The name of a value of the PEN_TYPE property of the GUI_PEN object. When the PEN_TYPE property of the GUI_PEN object is SET, the Draw method draws (as opposed to erases) a point or a line. Usage Set_Property(GUI_PEN, PEN_TYPE, SET);
Library library.c
See Also UNSET void Set_Property ( uint object_reference, uint property, ulong value )
Type Function Input Parameters object_reference A 16 bit variable that refers to the object whose property is being set. property A 16 bit number that specifies the property to be set. value A 32 bit number that specifies the value of the property. All property values are 32 bits. Description A method used to set the value of a property of an object. Possible errors include: INVALID_HEADER, INVALID_OBJECT, INVALID_PROPERTY, INVALID_GRAPHIC, INVALID_FONT, INVALID_TEXTBOX, HEIGHT_OUT_OF_RANGE, WIDTH_OUT_OF_RANGE. Usage Set_Property(GUI_PEN, PEN_TYPE, SET);
Library library.c
See Also Get_Property SHAPE
Type Constant Return Value Integer Description The name of a pen property that specifies the current shape drawn or erased by the Draw method. Possible contents of this property are POINT and LINE. SHAPE is initialized to POINT by Initialize_GUI. Usage Set_Property(GUI_PEN, SHAPE, LINE);
Library library.c
SHIFT_DOWN
Type Constant Return Value Long Description The name of a value of the SHIFT_STATE property of a keypad or the SHIFT_TYPE property of a shift key. When a keypad is in the SHIFT_DOWN state, a pressed data entry key inserts the KEY_CODE stored in one of its SHIFT_DOWN_VALUE properties into the DATA_ENTRY_TEXTBOX. Usage If ( Get_Property ( GUI_KEYPAD0, SHIFT_STATE ) == SHIFT_DOWN ) { printf(“The shift state is down.\n”); }
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, SHIFT_DOWN_VALUE, SHIFT_UP, SHIFT_NEUTRAL SHIFT_DOWN_VALUE0
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_DOWN, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_DOWN_VALUES equals to 0. SHIFT_DOWN_VALUE0 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_DOWN_VALUE0, (long) ‘w’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_DOWN_VALUES, PRESS_NUMBER, SHIFT_DOWN SHIFT_DOWN_VALUE1
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_DOWN, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_DOWN_VALUES equals to 1. SHIFT_DOWN_VALUE1 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_DOWN_VALUE1, (long) ‘x’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_DOWN_VALUES, PRESS_NUMBER, SHIFT_DOWN SHIFT_DOWN_VALUE2
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_DOWN, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_DOWN_VALUES equals to 2. SHIFT_DOWN_VALUE2 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_DOWN_VALUE2, (long) ‘y’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_DOWN_VALUES, PRESS_NUMBER, SHIFT_DOWN SHIFT_DOWN_VALUE3
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_DOWN, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_DOWN_VALUES equals to 3. SHIFT_DOWN_VALUE3 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_DOWN_VALUE3, (long) ‘z’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_DOWN_VALUES, PRESS_NUMBER, SHIFT_DOWN SHIFT_DOWN_VALUE4
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_DOWN, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_DOWN_VALUES equals to 4. SHIFT_DOWN_VALUE4 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_DOWN_VALUE4, (long) ‘w’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_DOWN_VALUES, PRESS_NUMBER, SHIFT_DOWN SHIFT_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 shift key is pressed. The event procedure can not take or return any parameters, but it can modify variables. The SHIFT_EVENT_PROCEDURE property is unitialized when Initialize_GUI is called. Usage Set_Property ( GUI_KEYPAD0, SHIFT_EVENT_PROCEDURE, (long) delete_event_procedure_ptr );
Library library.c
SHIFT_KEY
Type Constant Return Value Integer Description The name of an object type used to create a new shift key object. Shift keys are used to set the shift state of a keypad. Once a shift key is instantiated, it’s SHIFT_TYPE property must be set using the Set_Property method. Valid values of the shift type are SHIFT_DOWN, SHIFT_NEUTRAL, and SHIFT_UP. Usage shiftkey = New_Object( SHIFT_KEY ); Set_Property ( shiftkey, SHIFT_TYPE, SHIFT_UP );
Library library.c
See Also DATA_ENTRY_KEY, SHIFT_TYPE SHIFT_NEUTRAL
Type Constant Return Value Long Description The name of a value of the SHIFT_STATE property of a keypad or SHIFT_TYPE property of a shift key. When a keypad is in the SHIFT_NEUTRAL state, a pressed data entry key inserts the KEY_CODE stored in its SHIFT_NEUTRAL_VALUE property into the DATA_ENTRY_TEXTBOX. Usage If ( Get_Property ( GUI_KEYPAD0, SHIFT_STATE ) == SHIFT_NEUTRAL ) { printf(“The shift state is neutral.\n”); }
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, SHIFT_NEUTRAL_VALUE, SHIFT_UP, SHIFT_DOWN SHIFT_NEUTRAL_VALUE
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed and the shift state equals SHIFT_NEUTRAL. SHIFT_NEUTRAL_VALUE is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_NEUTRAL_VALUE, (long) ‘9’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE SHIFT_STATE
Type Constant Return Value Integer Description The name of a keypad property that contains the current shift state. The valid shift states are SHIFT_UP, SHIFT_DOWN, and SHIFT_NEUTRAL. Usage Set_Property(GUI_KEYPAD0, SHIFT_STATE, SHIFT_NEUTRAL);
Library library.c
See Also SHIFT_UP, SHIFT_NEUTRAL, SHIFT_DOWN SHIFT_STATE_TEXTBOX
Type Constant Return Value Integer Description The name of a keypad property that contains the object reference to a textbox that contains a shift string depending on the SHIFT_STATE. The default shift strings are “Shift Up”, “Shift Neutral”, or “Shift Down”. Once a textbox is associated with a keypad, the textbox is loaded on to the VISIBLE screen, and a SHIFT_KEY is pressed, the appropriate shift string is written into the textbox and the string is shown on the display (the textbox on the screen is automatically refreshed). The SHIFT_STATE_TEXTBOX property of a keypad is unitialized when Initialize_GUI is called. Usage Set_Property ( GUI_KEYPAD0, SHIFT_STATE_TEXTBOX, (long) textboxShift );
Library library.c
See Also SHIFT_KEY, SHIFT_STATE, VISIBLE SHIFT_TOGGLE
Type Constant Return Value Integer Description The name of a shift key property that controls whether or not the shift key toggles between SHIFT_NEUTRAL and the SHIFT_STATE stored in the object’s SHIFT_TYPE property. SHIFT_TOGGLE is set to GUI_FALSE when a shift key is instantiated. Usage Set_Property ( shiftkeyUp, SHIFT_TOGGLE, GUI_TRUE );
Library library.c
See Also SHIFT_NEUTRAL, SHIFT_STATE, SHIFT_TYPE SHIFT_TYPE
Type Constant Return Value Integer Description The name of a shift key property that specifies the shift type for the key. Valid value are: SHIFT_UP, SHIFT_NEUTRAL, and SHIFT_DOWN. SHIFT_TYPE is initialized to SHIFT_NEUTRAL when a shift key is instantiated. Usage Set_Property ( shiftkeyUp, SHIFT_TYPE, SHIFT_UP );
Library library.c
See Also SHIFT_UP, SHIFT_NEUTRAL, SHIFT_DOWN SHIFT_UP
Type Constant Return Value Long Description The name of a value of the SHIFT_STATE property of a keypad or the SHIFT_TYPE property of a shift key. When a keypad is in the SHIFT_UP state, a pressed data entry key inserts the KEY_CODE stored in one of its SHIFT_UP_VALUE properties into the DATA_ENTRY_TEXTBOX. Usage If ( Get_Property ( GUI_KEYPAD0, SHIFT_STATE ) == SHIFT_UP ) { printf(“The shift state is up.\n”); }
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, SHIFT_UP_VALUE, SHIFT_DOWN, SHIFT_NEUTRAL SHIFT_UP_VALUE0
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_UP, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_UP_VALUES equals to 0. SHIFT_UP_VALUE0 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_UP_VALUE0, (long) ‘W’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_UP_VALUES, PRESS_NUMBER, SHIFT_UP SHIFT_UP_VALUE1
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_UP, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_UP_VALUES equals to 1. SHIFT_UP_VALUE1 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_UP_VALUE0, (long) ‘X’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_UP_VALUES, PRESS_NUMBER, SHIFT_UP SHIFT_UP_VALUE2
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_UP, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_UP_VALUES equals to 2. SHIFT_UP_VALUE2 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_UP_VALUE2, (long) ‘Y’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_UP_VALUES, PRESS_NUMBER, SHIFT_UP SHIFT_UP_VALUE3
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_UP, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_UP_VALUES equals to 3. SHIFT_UP_VALUE3 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_UP_VALUE3, (long) ‘Z’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_UP_VALUES, PRESS_NUMBER, SHIFT_UP SHIFT_UP_VALUE4
Type Constant Return Value Integer Description The name of a data entry key property that contains a key code that is added to the DATA_ENTRY_TEXTBOX when the data entry key is pressed, the shift state equals SHIFT_UP, and the remainder of the division of PRESS_NUMBER and NUM_SHIFT_UP_VALUES equals to 4. SHIFT_UP_VALUE4 is uninitialized when a data entry key is instantiated. Usage Set_Property ( dataentrykey9, SHIFT_UP_VALUE4, (long) ‘W’ );
Library library.c
See Also DATA_ENTRY_KEY, DATA_ENTRY_TEXTBOX, KEY_CODE, NUM_SHIFT_UP_VALUES, PRESS_NUMBER, SHIFT_UP STANDARD_FONT
Type Constant Return Value Integer Description The name of a GUI Toolkit property that contains the object reference for the font used to render the string in a textbox. When Initialize_GUI is called, STANDARD_FONT is set GUI_FONT which is a proportional font (i.e. the widths of each character vary depending on the character) with a height of 10 pixels. By changing the value of STANDARD_FONT, all subsequently created textboxes will use the new font to render text (the value of the TEXTBOX_FONT property will be set to use the new font). Usage Set_Property(GUI_TOOLKIT, STANDARD_FONT, (ulong) fontCustom);
Library library.c
See Also GUI_FONT, TEXTBOX_FONT STRING_LENGTH
Type Constant Return Value Integer Description The name of a read only textbox property that contains the number of characters contained in the string in the textbox. Usage len = Get_Property ( textboxString, STRING_LENGTH );
Library library.c
STRING_LINES
Type Constant Return Value Integer Description The name of a read only textbox property that contains the number of lines the string in the textbox occupies when rendered. Based on the number of characters in the string and the width of the textbox. Usage num_lines = Get_Property ( textboxString, STRING_LINES );
Library library.c
void STRING_TO_TEXTBOX ( uint textbox_reference, char *string )
Type Macro
Input Parameters textbox_reference A 16 bit value referring to the textbox that the string is written to. string Pointer to a character string that is to be written into the textbox.
Description A method that writes a string into a textbox. STRING_TO_TEXTBOX overwrites any previous string data. To add or delete characters to the end of the string, use the Add_Character and Delete_Character methods. Errors include: HEAP_FULL, HEIGHT_OUT_OF_RANGE, INVALID_TEXTBOX, WIDTH_OUT_OF_RANGE. Usage STRING_TO_TEXTBOX(textboxInfo,”Hello World”);
Library library.c
See Also Add_Character, Delete_Character, Textbox_To_String |
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