geniePi.h
Go to the documentation of this file.
00001 /*
00002  * geniePi.h:
00003  *      Library to utilise the 4D Systems Genie interface to displays
00004  *      that have been created using the Visi-Genie creator platform.
00005  *      Primarily aimed at the Raspberry Pi, however this may be used
00006  *      on most Linux platforms with a serial connection (USB on
00007  *      on-board) to the 4D Systems Intelligent displays.
00008  *
00009  *      Gordon Henderson, December 2012, <projects@drogon.net>
00010  *      Copyright (c) 2012 4D Systems PTY Ltd, Sydney, Australia
00011  ***********************************************************************
00012  * This file is part of geniePi:
00013  *    geniePi is free software: you can redistribute it and/or modify
00014  *    it under the terms of the GNU Lesser General Public License as
00015  *    published by the Free Software Foundation, either version 3 of the
00016  *    License, or (at your option) any later version.
00017  *
00018  *    geniePi is distributed in the hope that it will be useful,
00019  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *    GNU Lesser General Public License for more details.
00022  *
00023  *    You should have received a copy of the GNU Lesser General Public
00024  *    License along with geniePi.
00025  *    If not, see <http://www.gnu.org/licenses/>.
00026  ***********************************************************************
00027  */
00028 
00029 #undef  GENIE_DEBUG
00030 
00031 // Genie commands & replys:
00032 
00033 #define GENIE_ACK               0x06
00034 #define GENIE_NAK               0x15
00035 
00036 #define GENIE_READ_OBJ          0
00037 #define GENIE_WRITE_OBJ         1
00038 #define GENIE_WRITE_STR         2
00039 #define GENIE_WRITE_STRU        3
00040 #define GENIE_WRITE_CONTRAST    4
00041 #define GENIE_REPORT_OBJ        5
00042 #define GENIE_REPORT_EVENT      7
00043 
00044 // Objects
00045 //      the manual says:
00046 //              Note: Object IDs may change with future releases; it is not
00047 //              advisable to code their values as constants.
00048 
00049 #define GENIE_OBJ_DIPSW          0
00050 #define GENIE_OBJ_KNOB           1
00051 #define GENIE_OBJ_ROCKERSW       2
00052 #define GENIE_OBJ_ROTARYSW       3
00053 #define GENIE_OBJ_SLIDER         4
00054 #define GENIE_OBJ_TRACKBAR       5
00055 #define GENIE_OBJ_WINBUTTON      6
00056 #define GENIE_OBJ_ANGULAR_METER  7
00057 #define GENIE_OBJ_COOL_GAUGE     8
00058 #define GENIE_OBJ_CUSTOM_DIGITS  9
00059 #define GENIE_OBJ_FORM          10
00060 #define GENIE_OBJ_GAUGE         11
00061 #define GENIE_OBJ_IMAGE         12
00062 #define GENIE_OBJ_KEYBOARD      13
00063 #define GENIE_OBJ_LED           14
00064 #define GENIE_OBJ_LED_DIGITS    15
00065 #define GENIE_OBJ_METER         16
00066 #define GENIE_OBJ_STRINGS       17
00067 #define GENIE_OBJ_THERMOMETER   18
00068 #define GENIE_OBJ_USER_LED      19
00069 #define GENIE_OBJ_VIDEO         20
00070 #define GENIE_OBJ_STATIC_TEXT   21
00071 #define GENIE_OBJ_SOUND         22
00072 #define GENIE_OBJ_TIMER         23
00073 
00074 //June 20, 2014 TIME: 8:30AM PHTIME -->> Added New Objects for Visi-Genie Raspbery Pi Libraries
00075 #define GENIE_OBJ_SPECTRUM                      24
00076 #define GENIE_OBJ_SCOPE                         25
00077 #define GENIE_OBJ_TANK                          26
00078 #define GENIE_OBJ_USERIMAGES            27
00079 #define GENIE_OBJ_PINOUTPUT                     28
00080 #define GENIE_OBJ_PININPUT                      29
00081 #define GENIE_OBJ_4DBUTTON                      30
00082 #define GENIE_OBJ_ANIBUTTON                     31
00083 #define GENIE_OBJ_COLORPICKER           32
00084 #define GENIE_OBJ_USERBUTTON            33
00085 
00086 //Pin modes
00087 #define PIN_INP    0
00088 #define PIN_INP_HI 1
00089 #define PIN_INP_LO 2
00090 #define PIN_OUT    3
00091 #define PIN_OUT_OD 4
00092 #define PIN_AN     5
00093 #define PIN_ANVG   6
00094 
00095 // Structure to store replys returned from a display
00096 
00097 struct genieReplyStruct
00098 {
00099   int cmd ;
00100   int object ;
00101   int index ;
00102   unsigned int data ;
00103 } ;
00104 
00105 // Globals (for debugging, mostly)
00106 
00107 #ifdef  GENIE_DEBUG
00108 extern int genieChecksumErrors  ;
00109 extern int genieTimeouts ;
00110 extern int genieAck ;
00111 extern int genieNak ;
00112 #endif
00113 
00114 
00115 
00116 // Functions
00117 
00118 #ifdef __cplusplus
00119 extern "C" {
00120 #endif
00121 
00122 extern int  genieReplyAvail    (void) ;
00123 extern void genieGetReply      (struct genieReplyStruct *reply) ;
00124 
00125 extern int  genieReadObj       (int object, int index) ;
00126 extern int  genieWriteObj      (int object, int index, unsigned int data) ;
00127 extern int  genieWriteContrast (int value) ;
00128 extern int  genieWriteStr      (int index, char *string) ;
00129 extern int  genieSetPin        (int mode, int pin);
00130 
00131 extern int  genieSetup         (char *device, int baud) ;
00132 extern void genieClose         (void) ;
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif


mrp2_display
Author(s): Bolkar Altuntas
autogenerated on Thu Jun 6 2019 21:43:35