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   

BACKLIGHT_ON

BACKLIGHT_ON

Type

Constant

Return Value

Integer

Description

The name of a display property that controls the backlight on the monochrome display.  Possible contents of this property are the booleans GUI_TRUE and GUI_FALSE. BACKLIGHT_ON is initialized to GUI_TRUE by Initialize_GUI.

Usage

Set_Property(GUI_DISPLAY,BACKLIGHT_ON,GUI_FALSE);

GUI_DISPLAY BACKLIGHT_ON GUI_FALSE Set_Property

Library

library.c

library.4th

BATTERY_CURRENT

BATTERY_CURRENT

Type

Constant

Return Value

Integer

Description

The name of a read-only battery property that contains the current draw from the battery in milliamps. Read_Battery must be called before reading this property to get the latest battery information.

Usage

Read_Battery(); // Get the latest battery information.

Get_Property(GUI_BATTERY,BATTERY_CURRENT);

Read_Battery \ Get the latest battery information.

GUI_BATTERY BATTERY_CURRENT Get_Property

Library

library.c

library.4th

See Also

Read_Battery

 

BATTERY_STATE

BATTERY_STATE

Type

Constant

Return Value

Integer

Description

The name of a read-only battery property that contains the state of the battery.  Possible contents of this property are NO_BATTERY, LOW_BATTERY, MEDIUM_BATTERY, and FULL_BATTERY. Read_Battery must be called before reading this property to get the latest battery information.

Usage

Read_Battery(); // Get the latest battery information.

Get_Property(GUI_BATTERY,BATTERY_STATE);

Read_Battery \ Get the latest battery information.

GUI_BATTERY BATTERY_STATE Get_Property

Library

library.c

library.4th

See Also

FULL_BATTERY, MEDIUM_BATTERY, LOW_BATTERY, NO_BATTERY, Read_Battery

 

BATTERY_VOLTAGE

BATTERY_VOLTAGE

Type

Constant

Return Value

Integer

Description

The name of a read-only battery property that contains the voltage of the battery in millivolts. Read_Battery must be called before reading this property to get the latest battery information.

Usage

Read_Battery(); // Get the latest battery information.

Get_Property(GUI_BATTERY,BATTERY_VOLTAGE);

Read_Battery \ Get the latest battery information.

GUI_BATTERY BATTERY_VOLTAGE Get_Property

Library

library.c

library.4th

See Also

Read_Battery

 

BEEP_TIME

BEEP_TIME

Type

Constant

Return Value

Integer

Description

The name of a buzzer property that controls the length of time of a beep.  The length of the BEEP_TIME is measured using the 16-bit free running counter accessible via the register named TCNT.  The units of BEEP_TIME are in counts that are 2 microseconds long.  The default BEEP_TIME is 2 milliseconds or 1000 counts.  The range of BEEP_TIME is from 0 to 65535 or 0 to 131 milliseconds.  For longer duration beeps, manually turn the buzzer on and off using the BUZZER_ON property.

Usage

Set_Property(GUI_BUZZER, BEEP_TIME, (ulong) 2000);

GUI_BUZZER BEEP_TIME 2000 u>d Set_Property

Library

library.c

library.4th

See Also

BUZZER_ON

BLOCK_ON_HOLD

BLOCK_ON_HOLD

Type

Constant

Return Value

Integer

Description

The name of a key property that when set, disables the servicing of events when an action key is held down. Use this property for hold event procedurues that need to read, write, or modify GUI Toolkit properties.  The final line of the hold event procedure must re-enable the servicing of events by setting the GUI_TOOLKIT property SERVICE_EVENTS to GUI_TRUE. The BLOCK_ON_HOLD property is set to GUI_FALSE when the action key is instantiated.

Usage

void Delete_Event_Procedure ( void )

  {

    // The Delete Event Procedure code would go here.

    Delete_Character( textboxString );

 

    // Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing.

    // This should be the last thing done by the event procedure.

    Set_Property( GUI_TOOLKIT, SERVICE_EVENTS, GUI_TRUE);

  }

 

// We need to capture the addresses of the event procedures which are

// used in Set_Property to set the event procedures of action keys.

#include "begin_event_procedure_pointers.h"

 

xaddr (*delete_event_procedure_ptr)(void) = Delete_Event_Procedure;

 

#include "end_event_procedure_pointers.h"

 

// This is an example of a repeating action key.

actionkeyDelete = New_Object ( ACTION_KEY );

Set_Property ( actionkeyDelete, BLOCK_ON_PRESS, GUI_TRUE );

Set_Property ( actionkeyDelete, BLOCK_ON_HOLD,  GUI_TRUE );

Set_Property ( actionkeyDelete, PRESS_EVENT_PROCEDURE,  (long)

    delete_event_procedure_ptr );

Set_Property ( actionkeyDelete, HOLD_EVENT_PROCEDURE,   (long)

    delete_event_procedure_ptr );

// Assign the delete key to GUI_KEYPAD0, position 15

Insert_Key ( GUI_KEYPAD0, actionkeyDelete, 15);

 

: Delete_Event_Procedure ( -- )

    \ The Delete Event Procedure code would go here.

    textboxString @ Delete_Character

    … … … …

    \ Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing.

    \ This should be the last thing done by the event procedure.

    GUI_TOOLKIT SERVICE_EVENTS GUI_TRUE Set_Property

  ;

 

\ This is an example of a repeating action key.

ACTION_KEY new_object actionkeyDelete !

actionkeyDelete @  BLOCK_ON_PRESS GUI_TRUE                Set_Property

actionkeyDelete @  BLOCK_ON_HOLD GUI_TRUE                Set_Property

actionkeyDelete @  PRESS_EVENT_PROCEDURE cfa.for Delete_Event_Procedure

    Set_Property

actionkeyDelete @  HOLD_EVENT_PROCEDURE cfa.for Delete_Event_Procedure

    Set_Property

\ Assign the delete key to GUI_KEYPAD0, position 15.

GUI_KEYPAD0 actionkeyDelete @ 15 Insert_Key

Library

library.c

library.4th

See Also

BLOCK_ON_PRESS, BLOCK_ON_RELEASE, SERVICE_EVENTS

BLOCK_ON_PRESS

BLOCK_ON_PRESS

Type

Constant

Return Value

Integer

Description

The name of a key property that when set, disables the servicing of events when an action key is pressed.  Use this property for press event procedurues that need to read, write, or modify GUI Toolkit properties.  The final line of the press event procedure must re-enable the servicing of events by setting the GUI_TOOLKIT property SERVICE_EVENTS to GUI_TRUE. The BLOCK_ON_PRESS property is set to GUI_FALSE when the action key is instantiated.

Usage

void Delete_Event_Procedure ( void )

  {

    // The Delete Event Procedure code would go here.

    Delete_Character( textboxString );

 

    // Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing.

    // This should be the last thing done by the event procedure.

    Set_Property( GUI_TOOLKIT, SERVICE_EVENTS, GUI_TRUE);

  }

 

// We need to capture the addresses of the event procedures which are

// used in Set_Property to set the event procedures of action keys.

#include "begin_event_procedure_pointers.h"

 

xaddr (*delete_event_procedure_ptr)(void) = Delete_Event_Procedure;

 

#include "end_event_procedure_pointers.h"

 

// This is an example of a repeating action key.

actionkeyDelete = New_Object ( ACTION_KEY );

Set_Property ( actionkeyDelete, BLOCK_ON_PRESS, GUI_TRUE );

Set_Property ( actionkeyDelete, BLOCK_ON_HOLD,  GUI_TRUE );

Set_Property ( actionkeyDelete, PRESS_EVENT_PROCEDURE,  (long)

    delete_event_procedure_ptr );

Set_Property ( actionkeyDelete, HOLD_EVENT_PROCEDURE,   (long)

    delete_event_procedure_ptr );

// Assign the delete key to GUI_KEYPAD0, position 15

Insert_Key ( GUI_KEYPAD0, actionkeyDelete, 15);

 

: Delete_Event_Procedure ( -- )

    \ The Delete Event Procedure code would go here.

    textboxString @ Delete_Character

    … … … …

    \ Reset SERVICE_EVENTS to GUI_TRUE to re-enable event servicing.

    \ This should be the last thing done by the event procedure.

    GUI_TOOLKIT SERVICE_EVENTS GUI_TRUE Set_Property

  ;

 

\ This is an example of a repeating action key.

ACTION_KEY new_object actionkeyDelete !

actionkeyDelete @  BLOCK_ON_PRESS GUI_TRUE                Set_Property

actionkeyDelete @  BLOCK_ON_HOLD GUI_TRUE                Set_Property

actionkeyDelete @  PRESS_EVENT_PROCEDURE cfa.for Delete_Event_Procedure

    Set_Property

actionkeyDelete @  HOLD_EVENT_PROCEDURE cfa.for Delete_Event_Procedure

    Set_Property

\ Assign the delete key to GUI_KEYPAD0, position 15.

GUI_KEYPAD0 actionkeyDelete @ 15 Insert_Key

Library

library.c

library.4th

See Also

BLOCK_ON_HOLD, BLOCK_ON_RELEASE, SERVICE_EVENTS

BLOCK_ON_RELEASE

BLOCK_ON_RELEASE

Type

Constant

Return Value

Integer

Description

The name of a key property that when set, disables the servicing of events until when an action key is released.  Use this property for release event procedurues that need to read, write, or modify GUI Toolkit properties.  The final line of the release event procedure must re-enable the servicing of events by setting the GUI_TOOLKIT property SERVICE_EVENTS to GUI_TRUE. The BLOCK_ON_RELEASE property is set to GUI_FALSE when the action key is instantiated.

Usage

Set_Property ( actionkeyDelete, BLOCK_ON_RELEASE, GUI_TRUE );

actionkeyDelete @ BLOCK_ON_RELEASE GUI_TRUE Set_Property

Library

library.c

library.4th

See Also

BLOCK_ON_PRESS, BLOCK_ON_HOLD, SERVICE_EVENTS

BORDER

BORDER

Type

Constant

Return Value

Integer

Description

The name of a textbox or plot property that draws or erases a one pixel border around the object.  Possible contents of this property are the booleans GUI_TRUE and GUI_FALSE. BOARDER is initialized to GUI_FALSE when a plot or a textbox is instantiated.

Usage

Set_Property(textboxMessage, BORDER, GUI_TRUE);

textboxMessage @ BORDER GUI_TRUE Set_Property

Library

library.c

library.4th

BRIGHT_BACKLIGHT

BRIGHT_BACKLIGHT

Type

Constant

Return Value

Integer

Description

The name of a display property that controls the brightness of the backlight once it is on.  Possible contents of this property are the booleans GUI_TRUE and GUI_FALSE. BRIGHT_BACKLIGHT is initialized to GUI_FALSE by Initialize_GUI.

Usage

Set_Property(GUI_DISPLAY,BRIGHT_BACKLIGHT,GUI_TRUE);

GUI_DISPLAY BRIGHT_BACKLIGHT GUI_TRUE Set_Property

Library

library.c

library.4th

BUFFER_SIZE

BUFFER_SIZE

Type

Constant

Return Value

Integer

Description

The name of a plot property that contains the size of the plot’s circular data buffer in bytes.  The size of the buffer is limited by the amount of heap space of GUI Toolkit or 65,535, whatever is smaller.  The size of the buffer must also be larger than or equal to the pixel width of the plot object.  BUFFER_SIZE is initialized to 240 when a plot is instantiated.

Usage

Set_Property(plotVoltage, BUFFER_SIZE, (ulong) 300);

plotVoltage @ BUFFER_SIZE 300 u>d Set_Property

Library

library.c

library.4th

BUFFER_SIZE_OUT_OF_RANGE

BUFFER_SIZE_OUT_OF_RANGE

Type

Constant

Return Value

Integer

Description

The name of an error that indicates the size of a buffer for a plot object must be greater than or equal to the width of the plot in pixels.

Usage

Set_Property(plotVoltage, BUFFER_SIZE, (ulong) 200);

if(Read_Error() == BUFFER_SIZE_OUT_OF_RANGE)

{

  printf(“Buffer size must be >= plot width in pixels.\n”);

  Clear_Error();

}

plotVoltage @ BUFFER_SIZE 200 u>d Set_Property

Read_Error BUFFER_SIZE_OUT_OF_RANGE =

if

  cr .” Buffer size must be >= plot width in pixels.”

  Clear_Error

endif

Library

library.c

library.4th

void Buzz ( void )

Buzz ( -- )

Type

Function

Description

A method that turns on the piezo electric buzzer for a certain length of time as specified by the BEEP_TIME property of the buzzer object.  The default length is 2 milliseconds.

Usage

Buzz();

Buzz

Library

library.c

library.4th

See Also

BEEP_TIME

BUZZER_ON

BUZZER_ON

Type

Constant

Return Value

Integer

Description

The name of a buzzer property used to control the buzzer.  Possible contents of this property are the booleans GUI_TRUE and GUI_FALSE. BUZZER_ON is initialized to GUI_FALSE by Initialize_GUI.

Usage

Set_Property(GUI_BUZZER, BUZZER_ON, GUI_FALSE);

GUI_BUZZER BUZZER_ON GUI_FALSE 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