manufacturer of I/O-rich SBCs, operator interfaces, handheld instruments, and development tools for embedded control low cost single board computers, embedded controllers, and operator interfaces for scientific instruments & industrial control development tools for embedded control order our low cost I/O-rich embedded control products embedded controller manufacturer profile single board computers & embedded controllers development tools & starter kits for your embedded design operator interfaces with touchscreens and graphical user interface plug-in expansion modules for digital & analog I/O C language & Forth language integrated development tools, IDE single board and embedded computer accessories embedded controller enclosures, bezels, environmental gaskets

The C Programmer’s Guide to the Mosaic Handheld

Table of Contents

PART 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 3: Your First Program

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 10: Data Acquisition

Chapter 11: Serial Communications

Chapter 12: The Battery-Backed Real Time Clock

Chapter 13: Customizing the Handheld's I/O

PART 4: REFERENCE DATA

Appendix A: GUI Function Reference

Appendix B: Handheld Schematics

Glossary

<< Previous | Next >>

A     B     C     DF    G     H     I     K     LM    N     P     R     S    T    UVWXY   

DATA_ENTRY_EVENT_PROCEDURE

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 );

GUI_KEYPAD0 DATA_ENTRY_EVENT_PROCEDURE cfa.for Delete_Event_Procedure

    Set_Property

Library

library.c

library.4th

See Also

INT_DATA_ENTRY_EVENT_PROCEDURE

DATA_ENTRY_KEY

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 );

DATA_ENTRY_KEY New_Object dataentrykey0 !

dataentrykey0 @ SHIFT_NEUTRAL_VALUE Ascii 0 Set_Property

GUI_KEYPAD0 dataentrykey0 8 Insert_Key

Library

library.c

library.4th

See Also

SHIFT_UP_VALUE, SHIFT_NEUTRAL_VALUE, SHIFT_DOWN_VALUE, ACTION_KEY, SHIFT_KEY, Insert_Key

 

DATA_ENTRY_TEXTBOX

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 );

GUI_KEYPAD0 DATA_ENTRY_TEXTBOX textboxString Set_Property

Library

library.c

library.4th

See Also

KEY_CODE, PRESS_NUMBER, SHIFT_STATE, VISIBLE

 

DATA_OUT_OF_RANGE

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();

}

plotVoltage @ 300 Add_Data

Read_Error DATA_OUT_OF_RANGE =

if

  cr .” Data value is out of range of the plot.”

  Clear_Error

endif

Library

library.c

library.4th

void Delete_Character ( uint textbox_reference )

Delete_Character( u -- | u = 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.

textboxString @ Delete_Character

GUI_SCREEN0 Refresh        \ Refresh screen to update textbox.

Library

library.c

library.4th

See Also

Add_Character

 

DISPLAY_INITIALIZATION_FAILURE

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();

}

START_GUI_HEAP END_GUI_HEAP Initialize_GUI

Read_Error DISPLAY_INITIALIZATION_FAILURE =

if

  cr .” Display initialization failure.”

  Clear_Error

endif

Library

library.c

library.4th

void Draw ( uint x_coordinate, uint y_coordinate )

Draw ( u1 \ u2 -- | u1 = x coordinate, u2 = 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);

45 63 Draw

Library

library.c

library.4th

FIRST_VISIBLE_LINE

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 );

}

: Scroll_Up_Event_Procedure ( -- )

locals{ | &line }

  textboxString @ FIRST_VISIBLE_LINE Get_Property d>s dup to &line

  0> \ Make sure we don’t go past 0

  if

    textboxString @ FIST_VISIBLE_LINE &line 1- u>d Set_Property

    GUI_SCREEN0 Refresh \ Be sure to refresh screen, show change.

  endif

  \ Re-enable the servicing of events.  The key was set to disable

  \ events on press.

  GUI_TOOLKIT SERVICE_EVENTS GUI_TRUE Set_Property

;

Library

library.c

library.4th

FONT

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 );

FONT New_Object fontTimes !

Library

library.c

library.4th

See Also

FONT_WIDTH_DATA

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);

FONT New_Object fontComicSans !

fontComicSans @ IMAGE COMIC_SANS_8_BMP Set_Property

fontComicSans @ FONT_WIDTH_DATA COMIC_SANS_8_DAT Set_Property

Library

library.c

library.4th

FULL_BATTERY

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”);

}

GUI_BATTERY BATTERY_STATE Get_Property FULL_BATTERY d=

if

  cr .” The batteries are fully charged.”

endif

Library

library.c

library.4th

See Also

BATTERY_STATE, GUI_BATTERY, LOW_BATTERY, MEDIUM_BATTERY, NO_BATTERY

<< Previous | Next >>


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