Eric Wu / Mbed 2 deprecated WifiRobot

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers irobotOpcode.h Source File

irobotOpcode.h

Go to the documentation of this file.
00001 /** \file irobotOpcode.h
00002  *
00003  * iRobot Open Interface Operation Codes (opcodes)
00004  *
00005  * \author Jeff C. Jensen
00006  * \date 2013-12-09
00007  * \copyright Copyright (C) 2013, Jeff C. Jensen, Edward A. Lee, and Sanjit A. Seshia.
00008  *            This software accompanies An Introductory Lab in Embedded and Cyber-Physical Systems
00009  *            and is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0
00010  *            Unported License. See http://leeseshia.org/lab.
00011  */
00012 
00013 #ifndef _IROBOTOPCODE_H
00014 #define _IROBOTOPCODE_H
00015 
00016 /// OpCodes for iRobot open interface
00017 typedef enum{
00018     OP_START                = 128,  ///< Start mode
00019     OP_BAUD                 = 129,  ///< Change baud rate
00020     OP_CONTROL              = 130,  ///< Control mode
00021     OP_SAFE                 = 131,  ///< Safe mode
00022     OP_FULL                 = 132,  ///< Full mode
00023     OP_DEMO                 = 136,  ///< Demo mode
00024     OP_DEMO_COVER           = 135,  ///< Cover demo
00025     OP_DEMO_COVER_DOCK      = 143,  ///< Dock & cover demo
00026     OP_DEMO_SPOT            = 134,  ///< Spot demo
00027     OP_DRIVE                = 137,  ///< Drive a turn radius and speed
00028     OP_DRIVE_DIRECT         = 145,  ///< Directly drive left and right wheels
00029     OP_LEDS                 = 139,  ///< Control LEDs
00030     OP_DIGITAL_OUTPUTS      = 147,  ///< Write digital outputs
00031     OP_PWM_LOW_SIDE_DRIVERS = 144,  ///< Write PWM low-side drivers
00032     OP_LOW_SIDE_DRIVERS     = 138,  ///< Write analog low-side drivers
00033     OP_SEND_IR              = 151,  ///< Send IR signal
00034     OP_SONG                 = 140,  ///< Define song
00035     OP_PLAY_SONG            = 141,  ///< Play song
00036     OP_SENSORS              = 142,  ///< Query sensors
00037     OP_QUERY_LIST           = 149,  ///< Set list of sensors to query
00038     OP_STREAM               = 148,  ///< Sensor stream
00039     OP_PAUSE_RESUME_STREAM  = 150,  ///< Pause or resume sensor stream
00040     OP_SCRIPT               = 152,  ///< Define action script
00041     OP_PLAY_SCRIPT          = 153,  ///< Play action script
00042     OP_SHOW_SCRIPT          = 154,  ///< Read the current action script
00043     OP_WAIT_TIME            = 155,  ///< Script: instruct the robot to wait for a specified time
00044     OP_WAIT_DISTANCE        = 156,  ///< Script: instruct the robot to wait for a specified distance
00045     OP_WAIT_ANGLE           = 157,  ///< Script: instruct the robot to wait for a specified angle
00046     OP_WAIT_EVENT           = 158   ///< Script: instruct the robot to wait for an event
00047 } irobotOpcode_t;
00048 
00049 #define OP_START_SIZE                   1   ///< Size of the START opcode and payload
00050 #define OP_BAUD_SIZE                    2   ///< Size of the BAUD opcode and payload
00051 #define OP_CONTROL_SIZE                 1   ///< Size of the CONTROL opcode and payload
00052 #define OP_SAFE_SIZE                    1   ///< Size of the SAFE opcode and payload
00053 #define OP_FULL_SIZE                    1   ///< Size of the FULL opcode and payload
00054 #define OP_DEMO_SIZE                    2   ///< Size of the DEMO opcode and payload
00055 #define OP_DEMO_COVER_SIZE              1   ///< Size of the DEMO_COVER opcode and payload
00056 #define OP_DEMO_COVER_DOCK_SIZE         1   ///< Size of the DEMO_COVER_DOCK opcode and payload
00057 #define OP_DEMO_SPOT_SIZE               1   ///< Size of the DEMO_SPOT opcode and payload
00058 #define OP_DRIVE_SIZE                   5   ///< Size of the DRIVE opcode and payload
00059 #define OP_DRIVE_DIRECT_SIZE            5   ///< Size of the DRIVE_DIRECT opcode and payload
00060 #define OP_LEDS_SIZE                    4   ///< Size of the LEDs opcode and payload
00061 #define OP_DIGITAL_OUTPUTS_SIZE         2   ///< Size of the DIGITAL_OUTPUTS opcode and payload
00062 #define OP_PWM_LOW_SIDE_DRIVERS_SIZE    4   ///< Size of the PWM_LOW_SIDE_DRIVERS opcode and payload
00063 #define OP_LOW_SIDE_DRIVERS_SIZE        2   ///< Size of the LOW_SIDE_DRIVERS opcode and payload
00064 #define OP_SEND_IR_SIZE                 2   ///< Size of the SEND_IR opcode and payload
00065 // OP_SONG size is variable
00066 #define OP_PLAY_SONG_SIZE               2   ///< Size of the PLAY_SONG opcode and payload
00067 #define OP_SENSORS_SIZE                 2   ///< Size of the SENSORS opcode and payload
00068 // OP_QUERY_LIST size is variable
00069 // OP_STREAM size is variable
00070 #define OP_PAUSE_RESUME_STREAM_SIZE     2   ///< Size of the PAUSE_RESUME_STREAM opcode and payload
00071 // OP_SCRIPT size is variable
00072 #define OP_PLAY_SCRIPT_SIZE             1   ///< Size of the PLAY_SCRIPT opcode and payload
00073 #define OP_SHOW_SCRIPT_SIZE             1   ///< Size of the SHOW_SCRIPT opcode and payload
00074 #define OP_WAIT_TIME_SIZE               2   ///< Size of the WAIT_TIME opcode and payload
00075 #define OP_WAIT_DISTANCE_SIZE           3   ///< Size of the WAIT_DISTANCE opcode and payload
00076 #define OP_WAIT_ANGLE_SIZE              3   ///< Size of the WAIT_ANGLE opcode and payload
00077 #define OP_WAIT_EVENT_SIZE              2   ///< Size of the WAIT_EVENT opcode and payload
00078 
00079 #endif  // _IROBOTOPCODE_H