forked from robotnav/robotnav
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bytecodes.h
1664 lines (1343 loc) · 50.5 KB
/
bytecodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* LEGO® MINDSTORMS EV3
*
* Copyright (C) 2010-2013 The LEGO Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef BYTECODES_H_
#define BYTECODES_H_
#define BYTECODE_VERSION 1.04
/*! \page system System Configuration
*
* <hr size="1"/>
*
* Following defines sets the system configuration and limitations.\n
* Defines with preceding "vm" is visible for the byte code assembler\n
*
* \verbatim
*/
// HARDWARE
#define vmOUTPUTS 4 //!< Number of output ports in the system
#define vmINPUTS 4 //!< Number of input ports in the system
#define vmBUTTONS 6 //!< Number of buttons in the system
#define vmLEDS 4 //!< Number of LEDs in the system
#define vmLCD_WIDTH 178 //!< LCD horizontal pixels
#define vmLCD_HEIGHT 128 //!< LCD vertical pixels
#define vmTOPLINE_HEIGHT 10 //!< Top line vertical pixels
#define vmLCD_STORE_LEVELS 3 //!< Store levels
#define vmDEFAULT_VOLUME 100
#define vmDEFAULT_SLEEPMINUTES 30
// SOFTWARE
#define vmFG_COLOR 1 //!< Forground color
#define vmBG_COLOR 0 //!< Background color
#define vmCHAIN_DEPT 4 //!< Number of bricks in the USB daisy chain (master + slaves)
#define FILEPERMISSIONS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#define DIRPERMISSIONS (S_IRWXU | S_IRWXG | S_IRWXO)
#define SYSPERMISSIONS (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
#define vmPATHSIZE 84 //!< Max path size excluding trailing forward slash including zero termination
#define vmNAMESIZE 32 //!< Max name size including zero termination (must be divideable by 4)
#define vmEXTSIZE 5 //!< Max extension size including dot and zero termination
#define vmFILENAMESIZE 120 //!< Max filename size including path, name, extension and termination (must be divideable by 4)
#define vmMACSIZE 18 //!< Max WIFI MAC size including zero termination
#define vmIPSIZE 16 //!< Max WIFI IP size including zero termination
#define vmBTADRSIZE 13 //!< Max bluetooth address size including zero termination
#define vmERR_STRING_SIZE 32 // Inclusive zero termination
#define vmEVENT_BT_PIN 1
#define vmEVENT_BT_REQ_CONF 2
#define vmMAX_VALID_TYPE 101 //!< Highest valid device type
// FOLDERS
#define vmMEMORY_FOLDER "/mnt/ramdisk" //!< Folder for non volatile user programs/data
#define vmPROGRAM_FOLDER "../prjs/BrkProg_SAVE" //!< Folder for On Brick Programming programs
#define vmDATALOG_FOLDER "../prjs/BrkDL_SAVE" //!< Folder for On Brick Data log files
#define vmSDCARD_FOLDER "../prjs/SD_Card" //!< Folder for SD card mount
#define vmUSBSTICK_FOLDER "../prjs/USB_Stick" //!< Folder for USB stick mount
#define vmPRJS_DIR "../prjs" //!< Project folder
#define vmAPPS_DIR "../apps" //!< Apps folder
#define vmTOOLS_DIR "../tools" //!< Tools folder
#define vmTMP_DIR "../tmp" //!< Temporary folder
#define vmSETTINGS_DIR "../sys/settings" //!< Folder for non volatile settings
#define vmDIR_DEEPT 127 //!< Max directory items allocated including "." and ".."
// FILES USED IN APPLICATION
#define vmLASTRUN_FILE_NAME "lastrun" //!< Last run filename
#define vmCALDATA_FILE_NAME "caldata" //!< Calibration data filename
// FILES USED IN APPS
#define vmSLEEP_FILE_NAME "Sleep" //!< File used in "Sleep" app to save status
#define vmVOLUME_FILE_NAME "Volume" //!< File used in "Volume" app to save status
#define vmWIFI_FILE_NAME "WiFi" //!< File used in "WiFi" app to save status
#define vmBLUETOOTH_FILE_NAME "Bluetooth" //!< File used in "Bluetooth" app to save status
// EXTENSIONS
#define vmEXT_SOUND ".rsf" //!< Robot Sound File
#define vmEXT_GRAPHICS ".rgf" //!< Robot Graphics File
#define vmEXT_BYTECODE ".rbf" //!< Robot Byte code File
#define vmEXT_TEXT ".rtf" //!< Robot Text File
#define vmEXT_DATALOG ".rdf" //!< Robot Datalog File
#define vmEXT_PROGRAM ".rpf" //!< Robot Program File
#define vmEXT_CONFIG ".rcf" //!< Robot Configuration File
#define vmEXT_ARCHIVE ".raf" //!< Robot Archive File
// NAME LENGTHs
#define vmBRICKNAMESIZE 120 //!< Brick name maximal size (including zero termination)
#define vmBTPASSKEYSIZE 7 //!< Bluetooth pass key size (including zero termination)
#define vmWIFIPASSKEYSIZE 33 //!< WiFi pass key size (including zero termination)
// VALID CHARACTERS
#define vmCHARSET_NAME 0x01 //!< Character set allowed in brick name and raw filenames
#define vmCHARSET_FILENAME 0x02 //!< Character set allowed in file names
#define vmCHARSET_BTPASSKEY 0x04 //!< Character set allowed in bluetooth pass key
#define vmCHARSET_WIFIPASSKEY 0x08 //!< Character set allowed in WiFi pass key
#define vmCHARSET_WIFISSID 0x10 //!< Character set allowed in WiFi ssid
/* \endverbatim */
/*! \page bytecodedef Byte Code Defines
*
* \verbatim
*/
typedef enum
{
// \endverbatim \ref VM \verbatim
// 0000....
opERROR = 0x00, // 0000
opNOP = 0x01, // 0001
opPROGRAM_STOP = 0x02, // 0010
opPROGRAM_START = 0x03, // 0011
opOBJECT_STOP = 0x04, // 0100
opOBJECT_START = 0x05, // 0101
opOBJECT_TRIG = 0x06, // 0110
opOBJECT_WAIT = 0x07, // 0111
opRETURN = 0x08, // 1000
opCALL = 0x09, // 1001
opOBJECT_END = 0x0A, // 1010
opSLEEP = 0x0B, // 1011
opPROGRAM_INFO = 0x0C, // 1100
opLABEL = 0x0D, // 1101
opPROBE = 0x0E, // 1110
opDO = 0x0F, // 1111
// \endverbatim \ref cMath "MATH" \verbatim
// 0001....
// ADD 00..
opADD8 = 0x10, // 00
opADD16 = 0x11, // 01
opADD32 = 0x12, // 10
opADDF = 0x13, // 11
// SUB 01..
opSUB8 = 0x14, // 00
opSUB16 = 0x15, // 01
opSUB32 = 0x16, // 10
opSUBF = 0x17, // 11
// MUL 10..
opMUL8 = 0x18, // 00
opMUL16 = 0x19, // 01
opMUL32 = 0x1A, // 10
opMULF = 0x1B, // 11
// DIV 11..
opDIV8 = 0x1C, // 00
opDIV16 = 0x1D, // 01
opDIV32 = 0x1E, // 10
opDIVF = 0x1F, // 11
// \endverbatim \ref Logic "LOGIC" \verbatim
// LOGIC 0010....
// OR 00..
opOR8 = 0x20, // 00
opOR16 = 0x21, // 01
opOR32 = 0x22, // 10
// AND 01..
opAND8 = 0x24, // 00
opAND16 = 0x25, // 01
opAND32 = 0x26, // 10
// XOR 10..
opXOR8 = 0x28, // 00
opXOR16 = 0x29, // 01
opXOR32 = 0x2A, // 10
// RL 11..
opRL8 = 0x2C, // 00
opRL16 = 0x2D, // 01
opRL32 = 0x2E, // 10
// \endverbatim \ref cMove "MOVE" \verbatim
opINIT_BYTES = 0x2F, // 1111
// MOVE 0011....
// MOVE8_ 00..
opMOVE8_8 = 0x30, // 00
opMOVE8_16 = 0x31, // 01
opMOVE8_32 = 0x32, // 10
opMOVE8_F = 0x33, // 11
// MOVE16_ 01..
opMOVE16_8 = 0x34, // 00
opMOVE16_16 = 0x35, // 01
opMOVE16_32 = 0x36, // 10
opMOVE16_F = 0x37, // 11
// MOVE32_ 10..
opMOVE32_8 = 0x38, // 00
opMOVE32_16 = 0x39, // 01
opMOVE32_32 = 0x3A, // 10
opMOVE32_F = 0x3B, // 11
// MOVEF_ 11..
opMOVEF_8 = 0x3C, // 00
opMOVEF_16 = 0x3D, // 01
opMOVEF_32 = 0x3E, // 10
opMOVEF_F = 0x3F, // 11
// \endverbatim \ref cBranch "BRANCH" \verbatim
// BRANCH 010000..
opJR = 0x40, // 00
opJR_FALSE = 0x41, // 01
opJR_TRUE = 0x42, // 10
opJR_NAN = 0x43, // 11
// \endverbatim \ref cCompare "COMPARE" \verbatim
// COMPARE 010.....
// CP_LT 001..
opCP_LT8 = 0x44, // 00
opCP_LT16 = 0x45, // 01
opCP_LT32 = 0x46, // 10
opCP_LTF = 0x47, // 11
// CP_GT 010..
opCP_GT8 = 0x48, // 00
opCP_GT16 = 0x49, // 01
opCP_GT32 = 0x4A, // 10
opCP_GTF = 0x4B, // 11
// CP_EQ 011..
opCP_EQ8 = 0x4C, // 00
opCP_EQ16 = 0x4D, // 01
opCP_EQ32 = 0x4E, // 10
opCP_EQF = 0x4F, // 11
// CP_NEQ 100..
opCP_NEQ8 = 0x50, // 00
opCP_NEQ16 = 0x51, // 01
opCP_NEQ32 = 0x52, // 10
opCP_NEQF = 0x53, // 11
// CP_LTEQ 101..
opCP_LTEQ8 = 0x54, // 00
opCP_LTEQ16 = 0x55, // 01
opCP_LTEQ32 = 0x56, // 10
opCP_LTEQF = 0x57, // 11
// CP_GTEQ 110..
opCP_GTEQ8 = 0x58, // 00
opCP_GTEQ16 = 0x59, // 01
opCP_GTEQ32 = 0x5A, // 10
opCP_GTEQF = 0x5B, // 11
// \endverbatim \ref Select "SELECT" \verbatim
// SELECT 010111..
opSELECT8 = 0x5C, // 00
opSELECT16 = 0x5D, // 01
opSELECT32 = 0x5E, // 10
opSELECTF = 0x5F, // 11
// \endverbatim \ref VM \verbatim
opSYSTEM = 0x60,
opPORT_CNV_OUTPUT = 0x61,
opPORT_CNV_INPUT = 0x62,
opNOTE_TO_FREQ = 0x63,
// \endverbatim \ref cBranch "BRANCH" \verbatim
// BRANCH 011000..
//? 00
//? 01
//? 10
//? 11
// JR_LT 001..
opJR_LT8 = 0x64, // 00
opJR_LT16 = 0x65, // 01
opJR_LT32 = 0x66, // 10
opJR_LTF = 0x67, // 11
// JR_GT 010..
opJR_GT8 = 0x68, // 00
opJR_GT16 = 0x69, // 01
opJR_GT32 = 0x6A, // 10
opJR_GTF = 0x6B, // 11
// JR_EQ 011..
opJR_EQ8 = 0x6C, // 00
opJR_EQ16 = 0x6D, // 01
opJR_EQ32 = 0x6E, // 10
opJR_EQF = 0x6F, // 11
// JR_NEQ 100..
opJR_NEQ8 = 0x70, // 00
opJR_NEQ16 = 0x71, // 01
opJR_NEQ32 = 0x72, // 10
opJR_NEQF = 0x73, // 11
// JR_LTEQ 101..
opJR_LTEQ8 = 0x74, // 00
opJR_LTEQ16 = 0x75, // 01
opJR_LTEQ32 = 0x76, // 10
opJR_LTEQF = 0x77, // 11
// JR_GTEQ 110..
opJR_GTEQ8 = 0x78, // 00
opJR_GTEQ16 = 0x79, // 01
opJR_GTEQ32 = 0x7A, // 10
opJR_GTEQF = 0x7B, // 11
// \endverbatim \ref VM \verbatim
opINFO = 0x7C, // 01111100
opSTRINGS = 0x7D, // 01111101
opMEMORY_WRITE = 0x7E, // 01111110
opMEMORY_READ = 0x7F, // 01111111
// SYSTEM 1.......
// \endverbatim \ref cUi "UI" \verbatim
// UI 100000..
opUI_FLUSH = 0x80, // 00
opUI_READ = 0x81, // 01
opUI_WRITE = 0x82, // 10
opUI_BUTTON = 0x83, // 11
opUI_DRAW = 0x84, // 10000100
// \endverbatim \ref cTimer "TIMER" \verbatim
opTIMER_WAIT = 0x85, // 10000101
opTIMER_READY = 0x86, // 10000110
opTIMER_READ = 0x87, // 10000111
// \endverbatim \ref VM \verbatim
// BREAKPOINT 10001...
opBP0 = 0x88, // 000
opBP1 = 0x89, // 001
opBP2 = 0x8A, // 010
opBP3 = 0x8B, // 011
opBP_SET = 0x8C, // 10001100
opMATH = 0x8D, // 10001101
opRANDOM = 0x8E, // 10001110
// \endverbatim \ref cTimer "TIMER" \verbatim
opTIMER_READ_US = 0x8F, // 10001111
// \endverbatim \ref cUi "UI" \verbatim
opKEEP_ALIVE = 0x90, // 10010000
// \endverbatim \ref cCom "COM" \verbatim
// 100100
opCOM_READ = 0x91, // 01
opCOM_WRITE = 0x92, // 10
// \endverbatim \ref cSound "SOUND" \verbatim
// 100101
opSOUND = 0x94, // 00
opSOUND_TEST = 0x95, // 01
opSOUND_READY = 0x96, // 10
// \endverbatim \ref cInput "INPUT" \verbatim
//
opINPUT_SAMPLE = 0x97, // 10010111
// 10011...
opINPUT_DEVICE_LIST = 0x98, // 000
opINPUT_DEVICE = 0x99, // 001
opINPUT_READ = 0x9A, // 010
opINPUT_TEST = 0x9B, // 011
opINPUT_READY = 0x9C, // 100
opINPUT_READSI = 0x9D, // 101
opINPUT_READEXT = 0x9E, // 110
opINPUT_WRITE = 0x9F, // 111
// \endverbatim \ref cOutput "OUTPUT" \verbatim
// 101.....
opOUTPUT_GET_TYPE = 0xA0, // 00000
opOUTPUT_SET_TYPE = 0xA1, // 00001
opOUTPUT_RESET = 0xA2, // 00010
opOUTPUT_STOP = 0xA3, // 00011
opOUTPUT_POWER = 0xA4, // 00100
opOUTPUT_SPEED = 0xA5, // 00101
opOUTPUT_START = 0xA6, // 00110
opOUTPUT_POLARITY = 0xA7, // 00111
opOUTPUT_READ = 0xA8, // 01000
opOUTPUT_TEST = 0xA9, // 01001
opOUTPUT_READY = 0xAA, // 01010
opOUTPUT_POSITION = 0xAB, // 01011
opOUTPUT_STEP_POWER = 0xAC, // 01100
opOUTPUT_TIME_POWER = 0xAD, // 01101
opOUTPUT_STEP_SPEED = 0xAE, // 01110
opOUTPUT_TIME_SPEED = 0xAF, // 01111
opOUTPUT_STEP_SYNC = 0xB0, // 10000
opOUTPUT_TIME_SYNC = 0xB1, // 10001
opOUTPUT_CLR_COUNT = 0xB2, // 10010
opOUTPUT_GET_COUNT = 0xB3, // 10011
opOUTPUT_PRG_STOP = 0xB4, // 10100
// \endverbatim \ref cMemory "MEMORY" \verbatim
// 11000...
opFILE = 0xC0, // 000
opARRAY = 0xC1, // 001
opARRAY_WRITE = 0xC2, // 010
opARRAY_READ = 0xC3, // 011
opARRAY_APPEND = 0xC4, // 100
opMEMORY_USAGE = 0xC5, // 101
opFILENAME = 0xC6, // 110
// \endverbatim \ref cMove "READ" \verbatim
// 110010..
opREAD8 = 0xC8, // 00
opREAD16 = 0xC9, // 01
opREAD32 = 0xCA, // 10
opREADF = 0xCB, // 11
// \endverbatim \ref cMove "WRITE" \verbatim
// 110011..
opWRITE8 = 0xCC, // 00
opWRITE16 = 0xCD, // 01
opWRITE32 = 0xCE, // 10
opWRITEF = 0xCF, // 11
// \endverbatim \ref cCom "COM" \verbatim
// 11010...
opCOM_READY = 0xD0, // 000
opCOM_READDATA = 0xD1, // 001
opCOM_WRITEDATA = 0xD2, // 010
opCOM_GET = 0xD3, // 011
opCOM_SET = 0xD4, // 100
opCOM_TEST = 0xD5, // 101
opCOM_REMOVE = 0xD6, // 110
opCOM_WRITEFILE = 0xD7, // 111
// 11011...
opMAILBOX_OPEN = 0xD8, // 000
opMAILBOX_WRITE = 0xD9, // 001
opMAILBOX_READ = 0xDA, // 010
opMAILBOX_TEST = 0xDB, // 011
opMAILBOX_READY = 0xDC, // 100
opMAILBOX_CLOSE = 0xDD, // 101
// SPARE 111.....
// \endverbatim \ref TST \verbatim
opTST = 0xFF // 11111111
}
OP;
/*
* \endverbatim
*/
//! \page uireadsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
GET_VBATT = 1,
GET_IBATT = 2,
GET_OS_VERS = 3,
GET_EVENT = 4,
GET_TBATT = 5,
GET_IINT = 6,
GET_IMOTOR = 7,
GET_STRING = 8,
GET_HW_VERS = 9,
GET_FW_VERS = 10,
GET_FW_BUILD = 11,
GET_OS_BUILD = 12,
GET_ADDRESS = 13,
GET_CODE = 14,
KEY = 15,
GET_SHUTDOWN = 16,
GET_WARNING = 17,
GET_LBATT = 18,
TEXTBOX_READ = 21,
GET_VERSION = 26,
GET_IP = 27,
GET_POWER = 29,
GET_SDCARD = 30,
GET_USBSTICK = 31,
UI_READ_SUBCODES
}
UI_READ_SUBCODE;
//! \endverbatim
//! \page uiwritesubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
WRITE_FLUSH = 1,
FLOATVALUE = 2,
STAMP = 3,
PUT_STRING = 8,
VALUE8 = 9,
VALUE16 = 10,
VALUE32 = 11,
VALUEF = 12,
ADDRESS = 13,
CODE = 14,
DOWNLOAD_END = 15,
SCREEN_BLOCK = 16,
TEXTBOX_APPEND = 21,
SET_BUSY = 22,
SET_TESTPIN = 24,
INIT_RUN = 25,
UPDATE_RUN = 26,
LED = 27,
POWER = 29,
GRAPH_SAMPLE = 30,
TERMINAL = 31,
UI_WRITE_SUBCODES
}
UI_WRITE_SUBCODE;
//! \endverbatim
//! \page uibuttonsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
SHORTPRESS = 1,
LONGPRESS = 2,
WAIT_FOR_PRESS = 3,
FLUSH = 4,
PRESS = 5,
RELEASE = 6,
GET_HORZ = 7,
GET_VERT = 8,
PRESSED = 9,
SET_BACK_BLOCK = 10,
GET_BACK_BLOCK = 11,
TESTSHORTPRESS = 12,
TESTLONGPRESS = 13,
GET_BUMBED = 14,
GET_CLICK = 15,
UI_BUTTON_SUBCODES
}
UI_BUTTON_SUBCODE;
//! \endverbatim
//! \page comreadsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
COMMAND = 14,
COM_READ_SUBCODES
}
COM_READ_SUBCODE;
//! \endverbatim
//! \page comwritesubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
REPLY = 14,
COM_WRITE_SUBCODES
}
COM_WRITE_SUBCODE;
//! \endverbatim
//! \page comgetsubcode Specific command parameter
//!
//! \verbatim
//!
typedef enum
{
GET_ON_OFF = 1, //!< Set, Get
GET_VISIBLE = 2, //!< Set, Get
GET_RESULT = 4, //!< Get
GET_PIN = 5, //!< Set, Get
SEARCH_ITEMS = 8, //!< Get
SEARCH_ITEM = 9, //!< Get
FAVOUR_ITEMS = 10, //!< Get
FAVOUR_ITEM = 11, //!< Get
GET_ID = 12,
GET_BRICKNAME = 13,
GET_NETWORK = 14,
GET_PRESENT = 15,
GET_ENCRYPT = 16,
CONNEC_ITEMS = 17,
CONNEC_ITEM = 18,
GET_INCOMING = 19,
GET_MODE2 = 20,
COM_GET_SUBCODES
}
COM_GET_SUBCODE;
//! \endverbatim
//! \page comsetsubcode Specific command parameter
//!
//! \verbatim
//!
typedef enum
{
SET_ON_OFF = 1, //!< Set, Get
SET_VISIBLE = 2, //!< Set, Get
SET_SEARCH = 3, //!< Set
SET_PIN = 5, //!< Set, Get
SET_PASSKEY = 6, //!< Set
SET_CONNECTION = 7, //!< Set
SET_BRICKNAME = 8,
SET_MOVEUP = 9,
SET_MOVEDOWN = 10,
SET_ENCRYPT = 11,
SET_SSID = 12,
SET_MODE2 = 13,
COM_SET_SUBCODES
}
COM_SET_SUBCODE;
//! \endverbatim
//! \page inputdevicesubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
GET_FORMAT = 2,
CAL_MINMAX = 3,
CAL_DEFAULT = 4,
GET_TYPEMODE = 5,
GET_SYMBOL = 6,
CAL_MIN = 7,
CAL_MAX = 8,
SETUP = 9,
CLR_ALL = 10,
GET_RAW = 11,
GET_CONNECTION = 12,
STOP_ALL = 13,
GET_NAME = 21,
GET_MODENAME = 22,
SET_RAW = 23,
GET_FIGURES = 24,
GET_CHANGES = 25,
CLR_CHANGES = 26,
READY_PCT = 27,
READY_RAW = 28,
READY_SI = 29,
GET_MINMAX = 30,
GET_BUMPS = 31,
INPUT_DEVICESUBCODES
}
INPUT_DEVICE_SUBCODE;
//! \endverbatim
//! \page programinfosubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
OBJ_STOP = 0, // VM
OBJ_START = 4, // VM
GET_STATUS = 22, // VM
GET_SPEED = 23, // VM
GET_PRGRESULT = 24, // VM
SET_INSTR = 25, // VM
PROGRAM_INFO_SUBCODES,
}
PROGRAM_INFO_SUBCODE;
//! \endverbatim
//! \page uidrawsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
UPDATE = 0,
CLEAN = 1,
PIXEL = 2,
LINE = 3,
CIRCLE = 4,
TEXT = 5,
ICON = 6,
PICTURE = 7,
VALUE = 8,
FILLRECT = 9,
RECT = 10,
NOTIFICATION = 11,
QUESTION = 12,
KEYBOARD = 13,
BROWSE = 14,
VERTBAR = 15,
INVERSERECT = 16,
SELECT_FONT = 17,
TOPLINE = 18,
FILLWINDOW = 19,
SCROLL = 20,
DOTLINE = 21,
VIEW_VALUE = 22,
VIEW_UNIT = 23,
FILLCIRCLE = 24,
STORE = 25,
RESTORE = 26,
ICON_QUESTION = 27,
BMPFILE = 28,
POPUP = 29,
GRAPH_SETUP = 30,
GRAPH_DRAW = 31,
TEXTBOX = 32,
UI_DRAW_SUBCODES
}
UI_DRAW_SUBCODE;
//! \endverbatim
//! \page memoryfilesubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
OPEN_APPEND = 0,
OPEN_READ = 1,
OPEN_WRITE = 2,
READ_VALUE = 3,
WRITE_VALUE = 4,
READ_TEXT = 5,
WRITE_TEXT = 6,
CLOSE = 7,
LOAD_IMAGE = 8,
GET_HANDLE = 9,
MAKE_FOLDER = 10,
GET_POOL = 11,
SET_LOG_SYNC_TIME = 12,
GET_FOLDERS = 13,
GET_LOG_SYNC_TIME = 14,
GET_SUBFOLDER_NAME = 15,
WRITE_LOG = 16,
CLOSE_LOG = 17,
GET_IMAGE = 18,
GET_ITEM = 19,
GET_CACHE_FILES = 20,
PUT_CACHE_FILE = 21,
GET_CACHE_FILE = 22,
DEL_CACHE_FILE = 23,
DEL_SUBFOLDER = 24,
GET_LOG_NAME = 25,
OPEN_LOG = 27,
READ_BYTES = 28,
WRITE_BYTES = 29,
REMOVE = 30,
MOVE = 31,
FILE_SUBCODES
}
FILE_SUBCODE;
//! \endverbatim
//! \page memoryarraysubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
DELETE = 0,
CREATE8 = 1,
CREATE16 = 2,
CREATE32 = 3,
CREATEF = 4,
RESIZE = 5,
FILL = 6,
COPY = 7,
INIT8 = 8,
INIT16 = 9,
INIT32 = 10,
INITF = 11,
SIZE = 12,
READ_CONTENT = 13,
WRITE_CONTENT = 14,
READ_SIZE = 15,
ARRAY_SUBCODES
}
ARRAY_SUBCODE;
//! \endverbatim
//! \page memoryfilenamesubcode Specific command parameter
//!
//! \verbatim
//!
typedef enum
{
EXIST = 16, //!< MUST BE GREATER OR EQUAL TO "ARRAY_SUBCODES"
TOTALSIZE = 17,
SPLIT = 18,
MERGE = 19,
CHECK = 20,
PACK = 21,
UNPACK = 22,
GET_FOLDERNAME = 23,
FILENAME_SUBCODES
}
FILENAME_SUBCODE;
//! \endverbatim
//! \page infosubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
SET_ERROR = 1,
GET_ERROR = 2,
ERRORTEXT = 3,
GET_VOLUME = 4,
SET_VOLUME = 5,
GET_MINUTES = 6,
SET_MINUTES = 7,
INFO_SUBCODES
}
INFO_SUBCODE;
//! \endverbatim
//! \page soundsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
BREAK = 0,
TONE = 1,
PLAY = 2,
REPEAT = 3,
SERVICE = 4,
SOUND_SUBCODES
}
SOUND_SUBCODE;
//! \endverbatim
//! \page stringsubcode Specific command parameter
//!
//!
//! \verbatim
//!
typedef enum
{
GET_SIZE = 1, // VM get string size
ADD = 2, // VM add two strings
COMPARE = 3, // VM compare two strings
DUPLICATE = 5, // VM duplicate one string to another
VALUE_TO_STRING = 6,
STRING_TO_VALUE = 7,
STRIP = 8,
NUMBER_TO_STRING = 9,
SUB = 10,
VALUE_FORMATTED = 11,
NUMBER_FORMATTED = 12,
STRING_SUBCODES
}
STRING_SUBCODE;
//! \endverbatim
/*! \page programid Program ID's (Slots)
\anchor prgid
\verbatim */
typedef enum
{
GUI_SLOT = 0, //!< Program slot reserved for executing the user interface
USER_SLOT = 1, //!< Program slot used to execute user projects, apps and tools
CMD_SLOT = 2, //!< Program slot used for direct commands coming from c_com
TERM_SLOT = 3, //!< Program slot used for direct commands coming from c_ui
DEBUG_SLOT = 4, //!< Program slot used to run the debug ui
SLOTS, //!< Maximum slots supported by the VM
// ONLY VALID IN opPROGRAM_STOP
CURRENT_SLOT = -1
}
SLOT;
/* \endverbatim */
/*! \page buttons Button
\verbatim */
typedef enum
{
NO_BUTTON = 0,
UP_BUTTON = 1,
ENTER_BUTTON = 2,
DOWN_BUTTON = 3,
RIGHT_BUTTON = 4,
LEFT_BUTTON = 5,
BACK_BUTTON = 6,
ANY_BUTTON = 7,
BUTTONTYPES = 8
}
BUTTONTYPE;
/* \endverbatim */
/*! \page mathsubcode Specific command parameter
\verbatim */
typedef enum
{
EXP = 1, //!< e^x r = expf(x)