rflex-info.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef RFLEX_INFO_H
00023 #define RFLEX_INFO_H
00024
00025 #ifndef TRUE
00026 #define TRUE 1
00027 #endif
00028
00029 #ifndef FALSE
00030 #define FALSE 0
00031 #endif
00032
00033 #define MAX_NAME_LENGTH 256
00034 #define MAX_COMMAND_LENGTH 256
00035 #define MAX_ACMD_SIZE 48
00036 #define MAX_NUM_LOOPS 30
00037 #define MAX_BUFFER_LENGTH 4096
00038
00039 #define EPSILON 0.0001
00040
00041 #define TIMEOUT -1
00042 #define WRONG 0
00043 #define OK 1
00044
00045 #define B_STX 0x02
00046 #define B_ETX 0x03
00047 #define B_ESC 0x1b
00048
00049 #define STD_TRANS_TORQUE 30000
00050 #define STD_ROT_ACC 100000
00051 #define STD_ROT_TORQUE 35000
00052
00053 #define SYS_PORT 1
00054 #define MOT_PORT 2
00055 #define JSTK_PORT 3
00056 #define SONAR_PORT 4
00057 #define DIO_PORT 5
00058 #define IR_PORT 6
00059
00060 #define SYS_LCD_DUMP 0
00061 #define SYS_STATUS 1
00062
00063 #define MOT_AXIS_GET_SYSTEM 0
00064 #define MOT_AXIS_GET_MODEL 1
00065 #define MOT_AXIS_GET_TARGET 2
00066 #define MOT_AXIS_SET_LIMITS 3
00067 #define MOT_AXIS_GET_LIMITS 4
00068 #define MOT_AXIS_SET_POS_LIMITS 5
00069 #define MOT_AXIS_GET_POS_LIMITS 6
00070 #define MOT_AXIS_SET_DIR 7
00071 #define MOT_AXIS_SET_POS 8
00072 #define MOT_AXIS_GET_MODE 9
00073 #define MOT_SET_DEFAULTS 10
00074 #define MOT_BRAKE_SET 11
00075 #define MOT_BRAKE_RELEASE 12
00076 #define MOT_SYSTEM_REPORT 33
00077 #define MOT_SYSTEM_REPORT_REQ 34
00078 #define MOT_GET_NAXES 65
00079 #define MOT_SET_GEARING 66
00080 #define MOT_GET_GEARING 67
00081 #define MOT_MOTOR_SET_MODE 68
00082 #define MOT_MOTOR_GET_MODE 69
00083 #define MOT_MOTOR_SET_PARMS 70
00084 #define MOT_MOTOR_GET_PARMS 71
00085 #define MOT_MOTOR_SET_LIMITS 72
00086 #define MOT_MOTOR_GET_LIMITS 73
00087 #define MOT_MOTOR_GET_DATA 74
00088 #define MOT_AXIS_SET_PARMS 75
00089 #define MOT_AXIS_GET_PARMS 76
00090 #define MOT_AXIS_SET_PWM_LIMIT 77
00091 #define MOT_AXIS_GET_PWM_LIMIT 78
00092 #define MOT_AXIS_SET_PWM 79
00093 #define MOT_AXIS_GET_PWM 80
00094
00095 #define SONAR_RUN 0
00096 #define SONAR_GET_UPDATE 1
00097 #define SONAR_REPORT 2
00098
00099 #define DIO_REPORTS_REQ 0
00100 #define DIO_REPORT 1
00101 #define DIO_GET_UPDATE 2
00102 #define DIO_UPDATE 3
00103 #define DIO_SET 4
00104
00105 #define IR_RUN 0
00106 #define IR_REPORT 1
00107
00108 #define JSTK_GET_STATE 0
00109
00110 enum PARITY_TYPE { N, E, O };
00111
00112 typedef struct {
00113 char ttyport[MAX_NAME_LENGTH];
00114 int baud;
00115 enum PARITY_TYPE parity;
00116 int fd;
00117 int databits;
00118 int stopbits;
00119 int hwf;
00120 int swf;
00121 } RFLEX_Device;
00122
00123 #endif