Go to the documentation of this file.
40 #ifndef ev3_constants_h
41 #define ev3_constants_h
56 #define LCD_HEIGHT 128
57 #define TOPLINE_HEIGHT 10
59 #define OWNER_NONE 0x0000
61 // daisy chain constants
62 #define LAYER_MASTER 0x00
63 #define LAYER_SLAVE1 0x10
64 #define LAYER_SLAVE2 0x20
65 #define LAYER_SLAVE3 0x40
66 #define LAYER_MASK 0x70 // end of MiscConstants group
96 #define OUT_MASK 0x0f // end of OutputPortConstants group
106 #define IN_4 0x3 // end of InputPortConstants group
116 #define OUT_FLOAT 0x00
127 #define OUT_TOGGLE 0x40
131 #define OUT_POWER_DEFAULT -127
141 #define OUT_REGMODE_IDLE 0
142 #define OUT_REGMODE_SPEED 1
143 #define OUT_REGMODE_SYNC 2 // end of OutRegModeConstants group
152 #define RESET_NONE 0x00
153 #define RESET_COUNT 0x08
154 #define RESET_BLOCK_COUNT 0x20
155 #define RESET_ROTATION_COUNT 0x40
156 #define RESET_BLOCKANDTACHO 0x28
157 #define RESET_ALL 0x68 // end of TachoResetConstants group
161 #define DEVICE_TYPE_NXT_TOUCH 1
162 #define DEVICE_TYPE_NXT_LIGHT 2
163 #define DEVICE_TYPE_NXT_SOUND 3
164 #define DEVICE_TYPE_NXT_COLOR 4
165 #define DEVICE_TYPE_TACHO 7
166 #define DEVICE_TYPE_MINITACHO 8
167 #define DEVICE_TYPE_NEWTACHO 9
168 #define DEVICE_TYPE_THIRD_PARTY_START 50
169 #define DEVICE_TYPE_THIRD_PARTY_END 99
170 #define DEVICE_TYPE_IIC_UNKNOWN 100
171 #define DEVICE_TYPE_NXT_TEST 101
172 #define DEVICE_TYPE_NXT_IIC 123
173 #define DEVICE_TYPE_TERMINAL 124
174 #define DEVICE_TYPE_UNKNOWN 125
175 #define DEVICE_TYPE_NONE 126
176 #define DEVICE_TYPE_ERROR 127
178 #define MAX_DEVICE_DATALENGTH 32
179 #define MAX_DEVICE_MODES 8
180 #define UART_DATA_LENGTH MAX_DEVICE_DATALENGTH
181 #define UART_BUFFER_SIZE 64
182 #define TYPE_NAME_LENGTH 11
183 #define SYMBOL_LENGTH 4
184 #define DEVICE_LOGBUF_SIZE 300
185 #define IIC_DATA_LENGTH MAX_DEVICE_DATALENGTH
186 #define IIC_NAME_LENGTH 8
202 #define BUTTON_ID_UP 0x01
203 #define BUTTON_ID_ENTER 0x02
204 #define BUTTON_ID_DOWN 0x04
205 #define BUTTON_ID_RIGHT 0x08
206 #define BUTTON_ID_LEFT 0x10
207 #define BUTTON_ID_ESCAPE 0x20
208 #define BUTTON_ID_ALL 0x3f
210 #define BTN1 BUTTON_ID_ESCAPE
211 #define BTN2 BUTTON_ID_RIGHT
212 #define BTN3 BUTTON_ID_LEFT
213 #define BTN4 BUTTON_ID_ENTER
214 #define BTN5 BUTTON_ID_UP
215 #define BTN6 BUTTON_ID_DOWN
218 #define BTNRIGHT BTN2
220 #define BTNCENTER BTN4
223 #define BTNANY BUTTON_ID_ALL
226 #define NUM_BUTTONS 6
236 #define BTNSTATE_PRESSED_EV 0x01
237 #define BTNSTATE_SHORT_RELEASED_EV 0x02
238 #define BTNSTATE_LONG_PRESSED_EV 0x04
239 #define BTNSTATE_LONG_RELEASED_EV 0x08
240 #define BTNSTATE_PRESSED_STATE 0x80
241 #define BTNSTATE_NONE 0x10 // end of ButtonStateConstants group
248 #define NXTCOLOR_IDX_RED 0
249 #define NXTCOLOR_IDX_GREEN 1
250 #define NXTCOLOR_IDX_BLUE 2
251 #define NXTCOLOR_IDX_BLANK 3
252 #define NUM_NXTCOLOR_IDX 4
254 #define NXTCOLOR_CAL_POINT_0 0
255 #define NXTCOLOR_CAL_POINT_1 1
256 #define NXTCOLOR_CAL_POINT_2 2
257 #define NUM_NXTCOLOR_CAL_POINTS 3
259 #define INPUT_BLACKCOLOR 1
260 #define INPUT_BLUECOLOR 2
261 #define INPUT_GREENCOLOR 3
262 #define INPUT_YELLOWCOLOR 4
263 #define INPUT_REDCOLOR 5
264 #define INPUT_WHITECOLOR 6
266 #define FILETYPE_UNKNOWN 0x00
267 #define FILETYPE_FOLDER 0x01
268 #define FILETYPE_SOUND 0x02
269 #define FILETYPE_BYTECODE 0x03
270 #define FILETYPE_GRAPHICS 0x04
271 #define FILETYPE_DATALOG 0x05
272 #define FILETYPE_PROGRAM 0x06
273 #define FILETYPE_TEXT 0x07
274 #define FILETYPE_SDCARD 0x10
275 #define FILETYPE_USBSTICK 0x20
276 #define NUM_FILETYPES 0x21
278 #define FONTTYPE_NORMAL 0
279 #define FONTTYPE_SMALL 1
280 #define FONTTYPE_LARGE 2
281 #define FONTTYPE_TINY 3
282 #define NUM_FONTTYPES 4
284 #define ICONTYPE_NORMAL 0
285 #define ICONTYPE_SMALL 1
286 #define ICONTYPE_LARGE 2
287 #define ICONTYPE_MENU 3
288 #define ICONTYPE_ARROW 4
289 #define NUM_ICONTYPES 5
291 #define NICON_NONE -1
293 #define NICON_FOLDER 1
294 #define NICON_FOLDER2 2
297 #define NICON_SOUND 5
298 #define NICON_IMAGE 6
299 #define NICON_SETTINGS 7
300 #define NICON_ONOFF 8
301 #define NICON_SEARCH 9
302 #define NICON_WIFI 10
303 #define NICON_CONNECTIONS 11
304 #define NICON_ADD_HIDDEN 12
305 #define NICON_TRASHBIN 13
306 #define NICON_VISIBILITY 14
308 #define NICON_CONNECT 16
309 #define NICON_DISCONNECT 17
311 #define NICON_DOWN 19
312 #define NICON_WAIT1 20
313 #define NICON_WAIT2 21
314 #define NICON_BLUETOOTH 22
315 #define NICON_INFO 23
316 #define NICON_TEXT 24
317 #define NICON_QUESTIONMARK 27
318 #define NICON_INFO_FILE 28
319 #define NICON_DISC 29
320 #define NICON_CONNECTED 30
323 #define NICON_OPENFOLDER 33
324 #define NICON_BRICK1 34
325 #define NUM_NICONS 35
330 #define FILENAME_SIZE 120
388 #define MIN_1 60000 // end of TimeConstants group
406 #define SOUND_STATE_IDLE 0
407 #define SOUND_STATE_SETUP_FILE 1
408 #define SOUND_STATE_FILE 2
409 #define SOUND_STATE_FILE_LOOPING 3
410 #define SOUND_STATE_TONE 4
411 #define SOUND_STATE_TONE_LOOPING 5
412 #define SOUND_STATE_STOP 6 // end of SoundStateConstants group
419 #define SOUND_CLICK 0
420 #define SOUND_DOUBLE_BEEP 1
423 #define SOUND_LOW_BEEP 4
424 #define SOUND_FAST_UP 5 // end of RCXSoundConstants group
481 #define TONE_CS6 1109
483 #define TONE_DS6 1245
486 #define TONE_FS6 1480
488 #define TONE_GS6 1661
490 #define TONE_AS6 1865
493 #define TONE_CS7 2217
495 #define TONE_DS7 2489
498 #define TONE_FS7 2960
500 #define TONE_GS7 3322
502 #define TONE_AS7 3729
505 #define NOTE_WHOLE 1000
506 #define NOTE_HALF (NOTE_WHOLE/2)
507 #define NOTE_QUARTER (NOTE_WHOLE/4)
508 #define NOTE_EIGHT (NOTE_WHOLE/8)
509 #define NOTE_SIXTEEN (NOTE_WHOLE/16) // end of ToneConstants group
525 #define LCD_LINE8 112 //*!< The 8th line of the LCD screen
526 #define LCD_LINE7 96 //*!< The 7th line of the LCD screen
527 #define LCD_LINE6 80 //*!< The 6th line of the LCD screen
528 #define LCD_LINE5 64 //*!< The 5th line of the LCD screen
529 #define LCD_LINE4 48 //*!< The 4th line of the LCD screen
530 #define LCD_LINE3 32 //*!< The 3rd line of the LCD screen
531 #define LCD_LINE2 16 //*!< The 2nd line of the LCD screen
532 #define LCD_LINE1 0 //*!< The 1st line of the LCD screen
548 #define DISPLAY_ERASE_ALL 0x00
549 #define DISPLAY_PIXEL 0x01
550 #define DISPLAY_HORIZONTAL_LINE 0x02
551 #define DISPLAY_VERTICAL_LINE 0x03
552 #define DISPLAY_CHAR 0x04
553 #define DISPLAY_ERASE_LINE 0x05
554 #define DISPLAY_FILL_REGION 0x06
555 #define DISPLAY_FRAME 0x07 // end of DisplayExecuteFunctionConstants group
578 #define DRAW_OPT_NORMAL (0x0000)
579 #define DRAW_OPT_CLEAR_WHOLE_SCREEN (0x0001)
580 #define DRAW_OPT_CLEAR_EXCEPT_STATUS_SCREEN (0x0002)
582 #define DRAW_OPT_CLEAR_PIXELS (0x0004)
583 #define DRAW_OPT_CLEAR (0x0004)
584 #define DRAW_OPT_INVERT (0x0004)
586 #define DRAW_OPT_LOGICAL_COPY (0x0000)
587 #define DRAW_OPT_LOGICAL_AND (0x0008)
588 #define DRAW_OPT_LOGICAL_OR (0x0010)
589 #define DRAW_OPT_LOGICAL_XOR (0x0018)
591 #define DRAW_OPT_FILL_SHAPE (0x0020)
593 #define DRAW_OPT_CLEAR_SCREEN_MODES (0x0003)
594 #define DRAW_OPT_LOGICAL_OPERATIONS (0x0018)
596 #define DRAW_OPT_POLYGON_POLYLINE (0x0400)
598 #define DRAW_OPT_CLEAR_LINE (0x0800)
599 #define DRAW_OPT_CLEAR_EOL (0x1000)
611 #define NUM_CS_TIMERS 4
617 #define NUM_MS_TIMERS 4
623 #define NUM_US_TIMERS 4
633 #define LMS_PWM_DEVICE "lms_pwm"
634 #define LMS_PWM_DEVICE_NAME "/dev/lms_pwm"
635 #define LMS_MOTOR_DEVICE "lms_motor"
636 #define LMS_MOTOR_DEVICE_NAME "/dev/lms_motor"
637 #define LMS_ANALOG_DEVICE "lms_analog"
638 #define LMS_ANALOG_DEVICE_NAME "/dev/lms_analog"
639 #define LMS_POWER_DEVICE "lms_power"
640 #define LMS_POWER_DEVICE_NAME "/dev/lms_power"
641 #define LMS_DCM_DEVICE "lms_dcm"
642 #define LMS_DCM_DEVICE_NAME "/dev/lms_dcm"
643 #define LMS_UI_DEVICE "lms_ui"
644 #define LMS_UI_DEVICE_NAME "/dev/lms_ui"
645 #define LMS_LCD_DEVICE "lms_display"
646 #define LMS_LCD_DEVICE_NAME "/dev/fb0"
647 #define LMS_UART_DEVICE "lms_uart"
648 #define LMS_UART_DEVICE_NAME "/dev/lms_uart"
649 #define LMS_USBDEV_DEVICE "lms_usbdev"
650 #define LMS_USBDEV_DEVICE_NAME "/dev/lms_usbdev"
651 #define LMS_USBHOST_DEVICE "lms_usbhost"
652 #define LMS_USBHOST_DEVICE_NAME "/dev/lms_usbhost"
653 #define LMS_SOUND_DEVICE "lms_sound"
654 #define LMS_SOUND_DEVICE_NAME "/dev/lms_sound"
655 #define LMS_IIC_DEVICE "lms_iic"
656 #define LMS_IIC_DEVICE_NAME "/dev/lms_iic"
657 #define LMS_BT_DEVICE "lms_bt"
658 #define LMS_BT_DEVICE_NAME "/dev/lms_bt"
659 #define LMS_UPDATE_DEVICE "lms_update"
660 #define LMS_UPDATE_DEVICE_NAME "/dev/lms_update"
661 #define LMS_TEST_PIN_DEVICE "lms_tst_pin"
662 #define LMS_TEST_PIN_DEVICE_NAME "/dev/lms_tst_pin"
663 #define LMS_TEST_UART_DEVICE "lms_tst_uart"
664 #define LMS_TEST_UART_DEVICE_NAME "/dev/lms_tst_uart" // end of DeviceNameConstants group
674 #define opProgramStop 0x02
675 #define opProgramStart 0x03
676 #define opObjectStop 0x04
677 #define opObjectStart 0x05
678 #define opObjectTrigger 0x06
679 #define opObjectWait 0x07
680 #define opReturn 0x08
682 #define opObjectEnd 0x0A
684 #define opProgramInfo 0x0C
716 #define opInitBytes 0x2F
717 #define opMove11 0x30
718 #define opMove12 0x31
719 #define opMove14 0x32
720 #define opMove1F 0x33
721 #define opMove21 0x34
722 #define opMove22 0x35
723 #define opMove24 0x36
724 #define opMove2F 0x37
725 #define opMove41 0x38
726 #define opMove42 0x39
727 #define opMove44 0x3A
728 #define opMove4F 0x3B
729 #define opMoveF1 0x3C
730 #define opMoveF2 0x3D
731 #define opMoveF4 0x3E
732 #define opMoveFF 0x3F
734 #define opJmpFalse 0x41
735 #define opJmpTrue 0x42
736 #define opJmpNan 0x43
737 #define opCmpLT1 0x44
738 #define opCmpLT2 0x45
739 #define opCmpLT4 0x46
740 #define opCmpLTF 0x47
741 #define opCmpGT1 0x48
742 #define opCmpGT2 0x49
743 #define opCmpGT4 0x4A
744 #define opCmpGTF 0x4B
745 #define opCmpEQ1 0x4C
746 #define opCmpEQ2 0x4D
747 #define opCmpEQ4 0x4E
748 #define opCmpEQF 0x4F
749 #define opCmpNEQ1 0x50
750 #define opCmpNEQ2 0x51
751 #define opCmpNEQ4 0x52
752 #define opCmpNEQF 0x53
753 #define opCmpLTEQ1 0x54
754 #define opCmpLTEQ2 0x55
755 #define opCmpLTEQ4 0x56
756 #define opCmpLTEQF 0x57
757 #define opCmpGTEQ1 0x58
758 #define opCmpGTEQ2 0x59
759 #define opCmpGTEQ4 0x5A
760 #define opCmpGTEQF 0x5B
761 #define opSelect1 0x5C
762 #define opSelect2 0x5D
763 #define opSelect4 0x5E
764 #define opSelectF 0x5F
765 #define opSystem 0x60
766 #define opPortConvertOutput 0x61
767 #define opPortConvertInput 0x62
768 #define opNote2Freq 0x63
769 #define opJmpLT1 0x64
770 #define opJmpLT2 0x65
771 #define opJmpLT4 0x66
772 #define opJmpLTF 0x67
773 #define opJmpGT1 0x68
774 #define opJmpGT2 0x69
775 #define opJmpGT4 0x6A
776 #define opJmpGTF 0x6B
777 #define opJmpEQ1 0x6C
778 #define opJmpEQ2 0x6D
779 #define opJmpEQ4 0x6E
780 #define opJmpEQF 0x6F
781 #define opJmpNEQ1 0x70
782 #define opJmpNEQ2 0x71
783 #define opJmpNEQ4 0x72
784 #define opJmpNEQF 0x73
785 #define opJmpLTEQ1 0x74
786 #define opJmpLTEQ2 0x75
787 #define opJmpLTEQ4 0x76
788 #define opJmpLTEQF 0x77
789 #define opJmpGTEQ1 0x78
790 #define opJmpGTEQ2 0x79
791 #define opJmpGTEQ4 0x7A
792 #define opJmpGTEQF 0x7B
794 #define opStrings 0x7D
795 #define opMemoryWrite 0x7E
796 #define opMemoryRead 0x7F
797 #define opUIFlush 0x80
798 #define opUIRead 0x81
799 #define opUIWrite 0x82
800 #define opUIButton 0x83
801 #define opUIDraw 0x84
802 #define opTimerWait 0x85
803 #define opTimerReady 0x86
804 #define opTimerRead 0x87
805 #define opBreakpoint0 0x88
806 #define opBreakpoint1 0x89
807 #define opBreakpoint2 0x8A
808 #define opBreakpoint3 0x8B
809 #define opBreakpointSet 0x8C
811 #define opRandom 0x8E
812 #define opTimerReadUS 0x8F
813 #define opKeepAlive 0x90
814 #define opComRead 0x91
815 #define opComWrite 0x92
817 #define opSoundTest 0x95
818 #define opSoundReady 0x96
819 #define opInputSample 0x97
820 #define opInputDeviceList 0x98
821 #define opInputDevice 0x99
822 #define opInputRead 0x9A
823 #define opInputTest 0x9B
824 #define opInputReady 0x9C
825 #define opInputReadSI 0x9D
826 #define opInputReadext 0x9E
827 #define opInputWrite 0x9F
828 #define opOutputGetType 0xA0
829 #define opOutputSetType 0xA1
830 #define opOutputReset 0xA2
831 #define opOutputStop 0xA3
832 #define opOutputPower 0xA4
833 #define opOutputSpeed 0xA5
834 #define opOutputStart 0xA6
835 #define opOutputPolarity 0xA7
836 #define opOutputRead 0xA8
837 #define opOutputTest 0xA9
838 #define opOutputReady 0xAA
839 #define opOutputPosition 0xAB
840 #define opOutputStepPower 0xAC
841 #define opOutputTimePower 0xAD
842 #define opOutputStepSpeed 0xAE
843 #define opOutputTimeSpeed 0xAF
844 #define opOutputStepSync 0xB0
845 #define opOutputTimeSync 0xB1
846 #define opOutputClearCount 0xB2
847 #define opOutputGetCount 0xB3
848 #define opOutputProgramStop 0xB4
851 #define opArrayWrite 0xC2
852 #define opArrayRead 0xC3
853 #define opArrayAppend 0xC4
854 #define opMemoryUsage 0xC5
855 #define opFilename 0xC6
860 #define opWrite1 0xCC
861 #define opWrite2 0xCD
862 #define opWrite4 0xCE
863 #define opWriteF 0xCF
864 #define opComReadY 0xD0
865 #define opComReadData 0xD1
866 #define opComWriteData 0xD2
867 #define opComGet 0xD3
868 #define opComSet 0xD4
869 #define opComTest 0xD5
870 #define opComRemove 0xD6
871 #define opComWriteFile 0xD7
872 #define opMailboxOpen 0xD8
873 #define opMailboxWrite 0xD9
874 #define opMailboxRead 0xDA
875 #define opMailboxTest 0xDB
876 #define opMailboxReady 0xDC
877 #define opMailboxClose 0xDD
878 #define opTest 0xFF // end of OpcodeConstants group
881 #endif // ev3_constants_h