LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lmstypes.h
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef LMSTYPES_H_
23 #define LMSTYPES_H_
24 
25 // BASIC DATA TYPES
26 
27 #ifndef LEGO_SIMULATION
28 
29 typedef unsigned char UBYTE;
30 typedef unsigned short UWORD;
31 typedef unsigned int ULONG;
32 
33 typedef signed char SBYTE;
34 typedef signed short SWORD;
35 typedef signed int SLONG;
36 
37 typedef float FLOAT;
38 
39 #define LFILE FILE
40 
41 #else
42 
43 #include <Base/BasicTypes.h>
44 #include <VMCalls.h>
45 
46 typedef LEGO::UInt8 UBYTE;
47 typedef LEGO::UInt16 UWORD;
48 typedef unsigned long ULONG;
49 
50 
51 typedef LEGO::Int8 SBYTE;
52 typedef LEGO::Int16 SWORD;
53 typedef LEGO::Int32 SLONG;
54 
55 typedef LEGO::Real32 FLOAT;
56 
57 #endif
58 
59 // VM DATA TYPES
60 
61 typedef SBYTE DATA8;
62 typedef SWORD DATA16;
63 typedef SLONG DATA32;
64 typedef FLOAT DATAF;
65 
66 // VM VARIABLE TYPES
67 
68 typedef UBYTE VARDATA;
69 typedef UBYTE IMGDATA;
70 
71 typedef UWORD PRGID;
72 
73 typedef UWORD OBJID;
74 typedef IMGDATA* IP;
75 typedef VARDATA* LP;
76 typedef VARDATA* GP;
77 
78 typedef ULONG IMINDEX;
79 typedef ULONG GBINDEX;
80 typedef ULONG LBINDEX;
81 typedef UWORD TRIGGER;
82 typedef UBYTE PARS;
83 typedef SLONG IMOFFS;
84 
85 typedef DATA16 HANDLER;
86 
87 
88 
144 typedef struct
145 {
146  UBYTE Sign[4];
151 }
152 IMGHEAD;
153 
167 typedef struct // Object header
168 {
173 }
174 OBJHEAD;
175 
176 
180 typedef struct
181 {
183 }
184 LABEL;
185 
186 
187 #endif /* LMSTYPES_H_ */
UBYTE PARS
NoOfParameters type.
Definition: lmstypes.h:82
ULONG IMINDEX
ImageData index type.
Definition: lmstypes.h:78
signed char SBYTE
Basic Type used to symbolise 8 bit signed values.
Definition: lmstypes.h:33
UBYTE VARDATA
Variable base type.
Definition: lmstypes.h:68
SWORD DATA16
VM Type for 2 byte signed value.
Definition: lmstypes.h:62
float FLOAT
Basic Type used to symbolise 32 bit floating point values.
Definition: lmstypes.h:37
SLONG DATA32
VM Type for 4 byte signed value.
Definition: lmstypes.h:63
UWORD OBJID
Object id type.
Definition: lmstypes.h:73
DATA16 HANDLER
Memory list index.
Definition: lmstypes.h:85
UWORD TRIGGER
TriggerCount type.
Definition: lmstypes.h:81
IMGDATA * IP
Instruction pointer type.
Definition: lmstypes.h:74
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
ULONG GBINDEX
GlobalBytes index type.
Definition: lmstypes.h:79
LBINDEX LocalBytes
Number of bytes to allocate for local variables.
Definition: lmstypes.h:172
TRIGGER TriggerCount
Used to determine how many triggers needed before the BLOCK object is activated.
Definition: lmstypes.h:171
OBJID OwnerObjectId
Used by BLOCK's to hold the owner id.
Definition: lmstypes.h:170
IMINDEX ImageSize
Image size.
Definition: lmstypes.h:147
SLONG IMOFFS
ImageData offset type.
Definition: lmstypes.h:83
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
Definition: lmstypes.h:29
FLOAT DATAF
VM Type for 4 byte floating point value.
Definition: lmstypes.h:64
VARDATA * LP
Local variable pointer type.
Definition: lmstypes.h:75
unsigned short UWORD
Basic Type used to symbolise 16 bit unsigned values.
Definition: lmstypes.h:30
UBYTE IMGDATA
Image base type.
Definition: lmstypes.h:69
IMINDEX Addr
Offset to breakpoint address from image start.
Definition: lmstypes.h:182
ULONG LBINDEX
LocalBytes index type.
Definition: lmstypes.h:80
OBJID NumberOfObjects
Total number of objects in image.
Definition: lmstypes.h:149
signed short SWORD
Basic Type used to symbolise 16 bit signed values.
Definition: lmstypes.h:34
UWORD PRGID
Program id type.
Definition: lmstypes.h:71
SBYTE DATA8
VM Type for 1 byte signed value.
Definition: lmstypes.h:61
VARDATA * GP
global variable pointer type
Definition: lmstypes.h:76
GBINDEX GlobalBytes
Number of bytes to allocate for global variables.
Definition: lmstypes.h:150
UWORD VersionInfo
Version identifier.
Definition: lmstypes.h:148
IP OffsetToInstructions
Offset to instructions from image start.
Definition: lmstypes.h:169
signed int SLONG
Basic Type used to symbolise 32 bit signed values.
Definition: lmstypes.h:35