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   

void Read_Battery ( void )

Read_Battery ( -- )

Type

Function

Description

A method that reads the battery voltage and charger state and stores the results into the BATTERY_CHARGER, BATTERY_STATE, and BATTERY_VOLTAGE properties of the GUI_BATTERY.

Usage

Read_Battery();

longState = Get_Property(GUI_BATTERY, BATTERY_STATE);

Read_Battery

GUI_BATTERY BATTERY_STATE Get_Property longState 2!

Library

library.c

library.4th

See Also

BATTERY_CHARGER, BATTERY_STATE, BATTERY_VOLTAGE, Initialize_Battery

uint Read_Error ( void )

Read_Error ( -- u | u = error code )

Type

Function

Return Value

A 16 bit number that represents the last reported error.

Description

A method that returns the last reported error.  Clear_Error should be called after this method to prevent servicing the same error more than once.

Usage

graphicStop = New_Object( GRAPHIC );

If(Read_Error() == HEAP_FULL)

{

  printf(“Can’t create new object, heap is full.\n”);

  Clear_Error();

}

GRAPHIC New_Object graphicStop !

Read_Error HEAP_FULL =

if

  cr .” Can’t create new object, heap is full.”

  Clear_Error

endif

Library

library.c

library.4th

void Remove_Event ( ulong event_xcfa )

Remove_Event ( event xcfa -- )

Type

Function

Input Parameters

event_xcfa                 A 32 bit number that refers to the event procedure to be removed.

Description

A method that removes the specified event procedure from the GUI Toolkit’s endless execution loop, removing it from being repetitively called.  No error checking is performed.

Usage

Remove_Event ( (long) battery_monitor_ptr );

cfa.for Battery_Monitor Remove_Event

Library

library.c

library.4th

See Also

Schedule_Event

void Redraw ( uint screen_reference )

Redraw( u -- | u = screen reference )

Type

Function

Input Parameters

screen_reference                    A 16 bit number that refers to the screen object to be redrawn.

Description

A method that redraws each object currently loaded into a screen.  Does not read or modify the refresh flag of graphics, textboxes or plots.  Errors include: INVALID_SCREEN.

Usage

Redraw( GUI_SCREEN0 );

GUI_SCREEN0 Redraw

Library

library.c

library.4th

void Refresh ( uint screen_reference )

Refresh ( u -- | u = screen reference )

Type

Function

Input Parameters

screen_reference                    A 16 bit number that refers to the screen object to be refreshed.

Description

A method that redraws only graphics, textboxes, or plots loaded into the specified screen which have their refresh property set to true.  The refresh property of a graphic object set to true when a graphic’s image is set or changed.  The refresh property of a textbox is set to true when the textbox’s string has changed.  The refresh property of a plot is set to true when data is added to the plot, the plot is resized, or when the plot is cleared.  Refresh sets the refresh flag of the graphic, textbox, or plot to false once the objects have been redrawn.  Errors include: INVALID_SCREEN.

Usage

Refresh( GUI_SCREEN0 );

GUI_SCREEN0 Refresh

Library

library.c

library.4th

RELEASE_EVENT

RELEASE_EVENT

Type

Constant

Return Value

Long

Description

The name of a value of a keypad property KEY_EVENT and PRIOR_KEY_EVENT that indicates a user has just removed their finger from a key.

Usage

If(Get_Property(GUI_KEYPAD0,KEY_EVENT)==RELEASE_EVENT)

{

  printf(“The last event was a release event.\n”);

}

GUI_KEYPAD0 KEY_EVENT Get_Property RELEASE_EVENT d=

if

  cr .” The last event was a release event.”

endif

Library

library.c

library.4th

See Also

HOLD_EVENT, PRESS_EVENT

RELEASE_EVENT_PROCEDURE

RELEASE_EVENT_PROCEDURE

Type

Constant

Return Value

Integer

Description

The name of an action key property that contains the xcfa (extended code field address) of a user defined release event procedure. The release event procedure is called each time the key is released.  Release event procedures can not take or return any parameters, but they can modify variables.  The RELEASE_EVENT_PROCEUDRE property is uninitialized when an action key is instantiated.

Usage

Set_Property( actionkeyRun, RELEASE_EVENT_PROCEDURE, (long) run_process_ptr )

actionkeyRun @ RELEASE_EVENT_PROCEDURE cfa.for Run_Process Set_Property

Library

library.c

library.4th

See Also

HOLD_EVENT_PROCEDURE, PRESS_EVENT_PROCEDURE

RENDER

RENDER

Type

Constant

Return Value

Integer

Description

The name of a textbox property that enables or disables the rendering of the string in textbox.  Setting the RENDER property to GUI_FALSE is useful when the textbox string needs to be changed but the changes do not need to be shown on the display.  The RENDER property of a textbox is set to GUI_TRUE when the textbox is instantiated.

Usage

// Turn off the rendering of text in the textbox.

Set_Property(textboxString, RENDER, GUI_FALSE);

// Quickly add characters into the textbox.

Add_Character(textboxString, ‘a’);

Add_Character(textboxString, ‘b’);

Add_Character(textboxString, ‘c’);

// Turn on the rendering of text in the textbox, render added chars.

Set_Property(textboxString, RENDER, GUI_TRUE);

\ Turn off the rendering of text in the textbox

textboxString @ RENDER GUI_FALSE Set_Property

\ Quickly add characters into the textbox

textboxString @ Ascii a Add_Character

textboxString @ Ascii b Add_Character

textboxString @ Ascii c Add_Character

\ Turn on the rendering of text in the textbox, render added chars.

textboxString @ RENDER GUI_TRUE Set_Property

Library

library.c

library.4th

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