2018.07.26
Dependencies: EthernetInterface TextLCD USBDevice USBHost mbed
common.h@1:fdf87a1a724b, 2018-07-26 (annotated)
- Committer:
- sayzyas
- Date:
- Thu Jul 26 00:26:07 2018 +0000
- Revision:
- 1:fdf87a1a724b
- Parent:
- 0:19075177391c
2018.07.26
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sayzyas | 0:19075177391c | 1 | /* |
sayzyas | 0:19075177391c | 2 | DEBUG PRINT MACRO |
sayzyas | 0:19075177391c | 3 | http://qiita.com/saltheads/items/e1b0ab54d3d6029c9593 |
sayzyas | 0:19075177391c | 4 | http://tricky-code.net/nicecode/code10.php |
sayzyas | 0:19075177391c | 5 | */ |
sayzyas | 0:19075177391c | 6 | /* Information */ |
sayzyas | 0:19075177391c | 7 | #define LatestUpDate "2017.04.27" |
sayzyas | 0:19075177391c | 8 | #define ProgramRevision "Rev 1.00" |
sayzyas | 0:19075177391c | 9 | #define Author "zNSR" |
sayzyas | 0:19075177391c | 10 | #define Company "Revast Co.,Ltd." |
sayzyas | 0:19075177391c | 11 | |
sayzyas | 0:19075177391c | 12 | // ====================================================================== |
sayzyas | 0:19075177391c | 13 | // For Debugging |
sayzyas | 0:19075177391c | 14 | // ====================================================================== |
sayzyas | 0:19075177391c | 15 | //#define __DEBUG_PRINT_SW__ // Display SW Status to console |
sayzyas | 0:19075177391c | 16 | #define __DEBUG_L0__ |
sayzyas | 0:19075177391c | 17 | //#define __DEBUG_L1__ |
sayzyas | 0:19075177391c | 18 | //#define __DEBUG_L2__ |
sayzyas | 0:19075177391c | 19 | #define __DEBUG_L3__ |
sayzyas | 0:19075177391c | 20 | //#define __DEBUG_L4__ |
sayzyas | 0:19075177391c | 21 | //#define __DEBUG_L5__ |
sayzyas | 0:19075177391c | 22 | |
sayzyas | 0:19075177391c | 23 | #define __DEBUG_WINCH_DATA__ |
sayzyas | 0:19075177391c | 24 | |
sayzyas | 0:19075177391c | 25 | #ifdef __DEBUG_WINCH_DATA__ |
sayzyas | 0:19075177391c | 26 | #define DEBUG_PRINT_WINCH_DATA(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 27 | #else |
sayzyas | 0:19075177391c | 28 | #define DEBUG_PRINT_WINCH_DATA(...) |
sayzyas | 0:19075177391c | 29 | #endif |
sayzyas | 0:19075177391c | 30 | |
sayzyas | 0:19075177391c | 31 | #ifdef __DEBUG_PRINT_SW__ |
sayzyas | 0:19075177391c | 32 | #define DEBUG_PRINT_SW(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 33 | #else |
sayzyas | 0:19075177391c | 34 | #define DEBUG_PRINT_SW(...) |
sayzyas | 0:19075177391c | 35 | #endif |
sayzyas | 0:19075177391c | 36 | |
sayzyas | 0:19075177391c | 37 | #ifdef __DEBUG_L0__ |
sayzyas | 0:19075177391c | 38 | #define DEBUG_PRINT_L0(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 39 | #else |
sayzyas | 0:19075177391c | 40 | #define DEBUG_PRINT_L0(...) |
sayzyas | 0:19075177391c | 41 | #endif |
sayzyas | 0:19075177391c | 42 | #ifdef __DEBUG_L1__ |
sayzyas | 0:19075177391c | 43 | #define DEBUG_PRINT_L1(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 44 | #else |
sayzyas | 0:19075177391c | 45 | #define DEBUG_PRINT_L1(...) |
sayzyas | 0:19075177391c | 46 | #endif |
sayzyas | 0:19075177391c | 47 | #ifdef __DEBUG_L2__ |
sayzyas | 0:19075177391c | 48 | #define DEBUG_PRINT_L2(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 49 | #else |
sayzyas | 0:19075177391c | 50 | #define DEBUG_PRINT_L2(...) |
sayzyas | 0:19075177391c | 51 | #endif |
sayzyas | 0:19075177391c | 52 | #ifdef __DEBUG_L3__ |
sayzyas | 0:19075177391c | 53 | #define DEBUG_PRINT_L3(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 54 | #else |
sayzyas | 0:19075177391c | 55 | #define DEBUG_PRINT_L3(...) |
sayzyas | 0:19075177391c | 56 | #endif |
sayzyas | 0:19075177391c | 57 | #ifdef __DEBUG_L4__ |
sayzyas | 0:19075177391c | 58 | #define DEBUG_PRINT_L4(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 59 | #else |
sayzyas | 0:19075177391c | 60 | #define DEBUG_PRINT_L4(...) |
sayzyas | 0:19075177391c | 61 | #endif |
sayzyas | 0:19075177391c | 62 | #ifdef __DEBUG_L5__ |
sayzyas | 0:19075177391c | 63 | #define DEBUG_PRINT_L5(...) pc.printf(__VA_ARGS__) |
sayzyas | 0:19075177391c | 64 | #else |
sayzyas | 0:19075177391c | 65 | #define DEBUG_PRINT_L5(...) |
sayzyas | 0:19075177391c | 66 | #endif |
sayzyas | 0:19075177391c | 67 | |
sayzyas | 0:19075177391c | 68 | /* ********************************************* */ |
sayzyas | 0:19075177391c | 69 | /* Platform definition */ |
sayzyas | 0:19075177391c | 70 | /* ********************************************* */ |
sayzyas | 0:19075177391c | 71 | #define PLATFORM "B1Demo" |
sayzyas | 0:19075177391c | 72 | //#define PLATFORM "B2Demo" |
sayzyas | 0:19075177391c | 73 | |
sayzyas | 0:19075177391c | 74 | |
sayzyas | 0:19075177391c | 75 | /* ********************************************* */ |
sayzyas | 0:19075177391c | 76 | |
sayzyas | 0:19075177391c | 77 | // Motor Controller RoboCAN ID definition |
sayzyas | 0:19075177391c | 78 | // --> define at "mtrAccess.cpp" |
sayzyas | 0:19075177391c | 79 | |
sayzyas | 0:19075177391c | 80 | //#define NUMBER_OF_MCCMD 7 |
sayzyas | 0:19075177391c | 81 | #define WINCH_OFFSET_VALUE 20 |
sayzyas | 0:19075177391c | 82 | |
sayzyas | 0:19075177391c | 83 | |
sayzyas | 0:19075177391c | 84 | enum{ |
sayzyas | 0:19075177391c | 85 | MOTOR_NO0, |
sayzyas | 0:19075177391c | 86 | MOTOR_NO1, |
sayzyas | 0:19075177391c | 87 | MOTOR_NO2, |
sayzyas | 0:19075177391c | 88 | MOTOR_NO3 |
sayzyas | 0:19075177391c | 89 | }; |
sayzyas | 0:19075177391c | 90 | |
sayzyas | 0:19075177391c | 91 | enum{ |
sayzyas | 0:19075177391c | 92 | MOTOR_FORWARD, |
sayzyas | 0:19075177391c | 93 | MOTOR_REVERSE, |
sayzyas | 0:19075177391c | 94 | MOTOR_STOP |
sayzyas | 0:19075177391c | 95 | }; |
sayzyas | 0:19075177391c | 96 | |
sayzyas | 0:19075177391c | 97 | #define MC_LOCK_COUNT 5 |
sayzyas | 0:19075177391c | 98 | |
sayzyas | 0:19075177391c | 99 | |
sayzyas | 0:19075177391c | 100 | |
sayzyas | 0:19075177391c | 101 | /* ********************************************* */ |
sayzyas | 0:19075177391c | 102 | |
sayzyas | 0:19075177391c | 103 | #define MOTOR_1 '1' |
sayzyas | 0:19075177391c | 104 | #define MOTOR_2 '2' |
sayzyas | 0:19075177391c | 105 | |
sayzyas | 0:19075177391c | 106 | #define MOTOR_ |
sayzyas | 0:19075177391c | 107 | |
sayzyas | 0:19075177391c | 108 | /* Above is still under construction ..... */ |
sayzyas | 0:19075177391c | 109 | |
sayzyas | 0:19075177391c | 110 | #define __DISP_GAMAPAD_STATUS_ALL__ |
sayzyas | 0:19075177391c | 111 | #define __DISP_WRITE_VALUE__ |
sayzyas | 0:19075177391c | 112 | #define I2C_ADDRESS_RESOLVER 0x02 |
sayzyas | 0:19075177391c | 113 | |
sayzyas | 0:19075177391c | 114 | |
sayzyas | 0:19075177391c | 115 | #define _OK_ 1 |
sayzyas | 0:19075177391c | 116 | #define _NG_ 0 |
sayzyas | 0:19075177391c | 117 | #define _FAIL_ 0 |
sayzyas | 0:19075177391c | 118 | |
sayzyas | 0:19075177391c | 119 | #define ON 1 |
sayzyas | 0:19075177391c | 120 | #define OFF 0 |
sayzyas | 0:19075177391c | 121 | |
sayzyas | 0:19075177391c | 122 | #define LFS_READ_COUNT 3 |
sayzyas | 0:19075177391c | 123 | #define TARGET_CHECK_COUNT 10 |
sayzyas | 0:19075177391c | 124 | |
sayzyas | 0:19075177391c | 125 | //#define __DSP_MOTOR_CURRENT_ |
sayzyas | 0:19075177391c | 126 | |
sayzyas | 0:19075177391c | 127 | /* Usually this should be comment out */ |
sayzyas | 0:19075177391c | 128 | //#define _COMMUNCATE_PC_BY_SERIAL_ |
sayzyas | 0:19075177391c | 129 | |
sayzyas | 0:19075177391c | 130 | // Should validate this definition when you use DHCP. |
sayzyas | 0:19075177391c | 131 | //#define __ETERNET_DHCP__ |
sayzyas | 0:19075177391c | 132 | |
sayzyas | 0:19075177391c | 133 | #define NumberOfPcCommand 11 |
sayzyas | 0:19075177391c | 134 | |
sayzyas | 0:19075177391c | 135 | enum{ |
sayzyas | 0:19075177391c | 136 | MOTOR_RFCRW, // RF crawler |
sayzyas | 0:19075177391c | 137 | MOTOR_LBCRW, // LB crawler |
sayzyas | 0:19075177391c | 138 | MOTOR_RFTFM, // RF Transform |
sayzyas | 0:19075177391c | 139 | MOTOR_LBTFM, // LB transform |
sayzyas | 0:19075177391c | 140 | MOTOR_WINCH, // Winch |
sayzyas | 0:19075177391c | 141 | MOTOR_CMPAN, // Pan/Tilt |
sayzyas | 0:19075177391c | 142 | MOTOR_CTILT |
sayzyas | 0:19075177391c | 143 | }; |
sayzyas | 0:19075177391c | 144 | |
sayzyas | 0:19075177391c | 145 | |
sayzyas | 0:19075177391c | 146 | |
sayzyas | 0:19075177391c | 147 | |
sayzyas | 0:19075177391c | 148 | enum{ |
sayzyas | 0:19075177391c | 149 | MOTOR_DIR_FWD, // Motor forwaed rotation |
sayzyas | 0:19075177391c | 150 | MOTOR_DIR_RVS, // Motor reverse rotation |
sayzyas | 0:19075177391c | 151 | MOTOR_DIR_STP // Motor stop |
sayzyas | 0:19075177391c | 152 | }; |
sayzyas | 0:19075177391c | 153 | |
sayzyas | 0:19075177391c | 154 | /* I2C Command packet to motor controller */ |
sayzyas | 0:19075177391c | 155 | /* For motor controller */ |
sayzyas | 0:19075177391c | 156 | #define NumberOfI2CCommand 12 |
sayzyas | 0:19075177391c | 157 | enum{ |
sayzyas | 0:19075177391c | 158 | I2C_CP_COMMAND, // instruction command |
sayzyas | 0:19075177391c | 159 | I2C_CP_MOTORNO, // motor number |
sayzyas | 0:19075177391c | 160 | I2C_CP_M_DIR, // motor rotation direction |
sayzyas | 0:19075177391c | 161 | I2C_CP_M_CNTTH_U, // motor current limit detection threshold upper byte |
sayzyas | 0:19075177391c | 162 | I2C_CP_M_CNTTH_L, // motor current limit detection threshold lower byte |
sayzyas | 0:19075177391c | 163 | I2C_CP_WDRAM_DIA_UPPER, // winch dram motor diameter upper |
sayzyas | 0:19075177391c | 164 | I2C_CP_WDRAM_DIA_LOWER, // winch dram motor diameter lower |
sayzyas | 0:19075177391c | 165 | I2C_CP_CCABLE_DIA_UPPER, // cable diameter upper byte |
sayzyas | 0:19075177391c | 166 | I2C_CP_CCABLE_DIA_LOWER, // cable diameter lower byte |
sayzyas | 0:19075177391c | 167 | I2C_CP_RESOLVER_RESO, // resolver resolution (bit) |
sayzyas | 0:19075177391c | 168 | I2C_CP_PRESET_CPOS_UPPER, // preset position upper |
sayzyas | 0:19075177391c | 169 | I2C_CP_PRESET_CPOS_LOWER // preset position lower |
sayzyas | 0:19075177391c | 170 | }; |
sayzyas | 0:19075177391c | 171 | |
sayzyas | 0:19075177391c | 172 | /* Winch Operating mode */ |
sayzyas | 0:19075177391c | 173 | enum{ |
sayzyas | 0:19075177391c | 174 | WINCH_POSITION_CLEAR, |
sayzyas | 0:19075177391c | 175 | WINCH_PRESET_BASEDATA, |
sayzyas | 0:19075177391c | 176 | WINCH_MMODE_RELATIVE, |
sayzyas | 0:19075177391c | 177 | WINCH_MMODE_ABSOLUTE, |
sayzyas | 0:19075177391c | 178 | WINCH_STEPDOWN_BTN_ON, |
sayzyas | 0:19075177391c | 179 | WINCH_STEPDOWN_BTN_OFF, |
sayzyas | 0:19075177391c | 180 | WINCH_STEPUP_BTN_ON, |
sayzyas | 0:19075177391c | 181 | WINCH_STEPUP_BTN_OFF, |
sayzyas | 0:19075177391c | 182 | WINCH_U_STEPDOWN_BTN_ON, |
sayzyas | 0:19075177391c | 183 | WINCH_U_STEPDOWN_BTN_OFF, |
sayzyas | 0:19075177391c | 184 | WINCH_U_STEPUP_BTN_ON, |
sayzyas | 0:19075177391c | 185 | WINCH_U_STEPUP_BTN_OFF, |
sayzyas | 0:19075177391c | 186 | WINCH_PRESET_POSITION |
sayzyas | 0:19075177391c | 187 | }; |
sayzyas | 0:19075177391c | 188 | |
sayzyas | 0:19075177391c | 189 | /* Ether net */ |
sayzyas | 0:19075177391c | 190 | #define TCP_PCCSERVER_PORT 10004 |
sayzyas | 0:19075177391c | 191 | #define TCP_CMDSERVER_PORT 10002 |
sayzyas | 0:19075177391c | 192 | #define UDP_SERVER_PORT 10000 |
sayzyas | 0:19075177391c | 193 | |
sayzyas | 0:19075177391c | 194 | #define MOTOR_FWD 'F' /* Forward Rotation */ |
sayzyas | 0:19075177391c | 195 | #define MOTOR_RVS 'R' /* Reverse Rotation */ |
sayzyas | 0:19075177391c | 196 | #define MOTOR_STP 'S' /* Stop */ |
sayzyas | 0:19075177391c | 197 | |
sayzyas | 0:19075177391c | 198 | // ========================================================= |
sayzyas | 0:19075177391c | 199 | // Setting Values |
sayzyas | 0:19075177391c | 200 | // ========================================================= |
sayzyas | 0:19075177391c | 201 | typedef struct { |
sayzyas | 0:19075177391c | 202 | int8_t sv_JS_ShapeMode; // JS Shape: 0=I, 1=KO |
sayzyas | 0:19075177391c | 203 | int8_t sv_JS_OpeMode; // JS Operation: 0=single, 1=dual |
sayzyas | 0:19075177391c | 204 | int8_t sv_WinchValid; // Winch function valid or not: 0=Tfm, Crawler valid, 1=Winch valid |
sayzyas | 0:19075177391c | 205 | int8_t res; |
sayzyas | 0:19075177391c | 206 | } basic_operation_t; |
sayzyas | 0:19075177391c | 207 | |
sayzyas | 0:19075177391c | 208 | |
sayzyas | 0:19075177391c | 209 | typedef struct { |
sayzyas | 0:19075177391c | 210 | uint16_t rf_mtr_ithd_f; // 2 Current threshold RF motor ( forward ) |
sayzyas | 0:19075177391c | 211 | uint16_t rf_mtr_ithd_r; // 2 Current threshold RF motor ( reverse ) |
sayzyas | 0:19075177391c | 212 | uint16_t lb_mtr_ithd_f; // 2 Current threshold LB motor ( forward ) |
sayzyas | 0:19075177391c | 213 | uint16_t lb_mtr_ithd_r; // 2 Current threshold LB motor ( reverse ) |
sayzyas | 0:19075177391c | 214 | uint8_t rf_mtr_hspd_f; // 1 Motor speed RF ( forward ) |
sayzyas | 0:19075177391c | 215 | uint8_t rf_mtr_hspd_r; // 1 Motor speed RF ( reverse ) |
sayzyas | 0:19075177391c | 216 | uint8_t lb_mtr_hspd_f; // 1 Motor speed LB ( forward ) |
sayzyas | 0:19075177391c | 217 | uint8_t lb_mtr_hspd_r; // 1 Motor speed LB ( reverse ) |
sayzyas | 0:19075177391c | 218 | uint8_t reserved_1; // 1 reserved for future use |
sayzyas | 0:19075177391c | 219 | uint8_t reserved_2; // 1 reserved for future use |
sayzyas | 0:19075177391c | 220 | uint8_t reserved_3; // 1 reserved for future use |
sayzyas | 0:19075177391c | 221 | uint8_t reserved_4; // 1 reserved for future use |
sayzyas | 0:19075177391c | 222 | } crawler_SetValue_t; // << 16 byte >> |
sayzyas | 0:19075177391c | 223 | |
sayzyas | 0:19075177391c | 224 | typedef struct { |
sayzyas | 0:19075177391c | 225 | uint16_t rf_mtr_ithd_f; // 2 Current threshold RF motor ( forward ) |
sayzyas | 0:19075177391c | 226 | uint16_t rf_mtr_ithd_r; // 2 Current threshold RF motor ( reverse ) |
sayzyas | 0:19075177391c | 227 | uint16_t lb_mtr_ithd_f; // 2 Current threshold LB motor ( forward ) |
sayzyas | 0:19075177391c | 228 | uint16_t lb_mtr_ithd_r; // 2 Current threshold LB motor ( reverse ) |
sayzyas | 0:19075177391c | 229 | uint8_t rf_mtr_hspd_f; // 1 Motor speed RF ( forward ) |
sayzyas | 0:19075177391c | 230 | uint8_t rf_mtr_hspd_r; // 1 Motor speed RF ( reverse ) |
sayzyas | 0:19075177391c | 231 | uint8_t lb_mtr_hspd_f; // 1 Motor speed LB ( forward ) |
sayzyas | 0:19075177391c | 232 | uint8_t lb_mtr_hspd_r; // 1 Motor speed LB ( reverse ) |
sayzyas | 0:19075177391c | 233 | uint8_t reserved_1; // 1 reserved for future use |
sayzyas | 0:19075177391c | 234 | uint8_t reserved_2; // 1 reserved for future use |
sayzyas | 0:19075177391c | 235 | uint8_t reserved_3; // 1 reserved for future use |
sayzyas | 0:19075177391c | 236 | uint8_t reserved_4; // 1 reserved for future use |
sayzyas | 0:19075177391c | 237 | } tfm_SetValue_t; // << 16 byte >> |
sayzyas | 0:19075177391c | 238 | |
sayzyas | 0:19075177391c | 239 | typedef struct { |
sayzyas | 0:19075177391c | 240 | uint16_t pan_mtr_ithd_f; // 2 Current threshold winch dram Motor ( forward ) |
sayzyas | 0:19075177391c | 241 | uint16_t pan_mtr_ithd_r; // 2 Current threshold winch dram Motor ( reverse ) |
sayzyas | 0:19075177391c | 242 | uint16_t tlt_mtr_ithd_f; // 2 Current threshold winch No2 Motor ( forward ) |
sayzyas | 0:19075177391c | 243 | uint16_t tlt_mtr_ithd_r; // 2 Current threshold winch No2 Motor ( reverse ) |
sayzyas | 0:19075177391c | 244 | uint8_t pan_mtr_hspd_f; // 1 Motor speed winch dram motor high speed ( forward ) |
sayzyas | 0:19075177391c | 245 | uint8_t pan_mtr_hspd_r; // 1 Motor speed winch dram motor high speed ( reverse ) |
sayzyas | 0:19075177391c | 246 | uint8_t tlt_mtr_hspd_f; // 1 Motor speed winch No2 motor high speed ( forward ) |
sayzyas | 0:19075177391c | 247 | uint8_t tlt_mtr_hspd_r; // 1 Motor speed winch No2 motor high speed ( reverse ) |
sayzyas | 0:19075177391c | 248 | uint8_t reserved_1; // 1 reserved for future use |
sayzyas | 0:19075177391c | 249 | uint8_t reserved_2; // 1 reserved for future use |
sayzyas | 0:19075177391c | 250 | uint8_t reserved_3; // 1 reserved for future use |
sayzyas | 0:19075177391c | 251 | uint8_t reserved_4; // 1 reserved for future use |
sayzyas | 0:19075177391c | 252 | } ptl_SetValue_t; // << 24 byte >> |
sayzyas | 0:19075177391c | 253 | |
sayzyas | 0:19075177391c | 254 | typedef struct { |
sayzyas | 0:19075177391c | 255 | uint16_t drm_mtr_ithd_f; // 2 Current threshold winch dram Motor ( forward ) |
sayzyas | 0:19075177391c | 256 | uint16_t drm_mtr_ithd_r; // 2 Current threshold winch dram Motor ( reverse ) |
sayzyas | 0:19075177391c | 257 | uint16_t no2_mtr_ithd_f; // 2 Current threshold winch No2 Motor ( forward ) |
sayzyas | 0:19075177391c | 258 | uint16_t no2_mtr_ithd_r; // 2 Current threshold winch No2 Motor ( reverse ) |
sayzyas | 0:19075177391c | 259 | uint8_t drm_mtr_hspd_f; // 1 Motor speed winch dram motor high speed ( forward ) |
sayzyas | 0:19075177391c | 260 | uint8_t drm_mtr_hspd_r; // 1 Motor speed winch dram motor high speed ( reverse ) |
sayzyas | 0:19075177391c | 261 | uint8_t no2_mtr_hspd_f; // 1 Motor speed winch No2 motor high speed ( forward ) |
sayzyas | 0:19075177391c | 262 | uint8_t no2_mtr_hspd_r; // 1 Motor speed winch No2 motor high speed ( reverse ) |
sayzyas | 0:19075177391c | 263 | uint16_t dram_dmtr_x100; // 2 Winch dram diameter x 100 |
sayzyas | 0:19075177391c | 264 | uint16_t adj_val_x10000; // 2 Winch adjust value x 100 |
sayzyas | 0:19075177391c | 265 | uint8_t res_resolution; // 1 Winch resolver resolution (bit) |
sayzyas | 0:19075177391c | 266 | uint8_t reserved_1; // 1 reserved for future use |
sayzyas | 0:19075177391c | 267 | uint8_t reserved_2; // 1 reserved for future use |
sayzyas | 0:19075177391c | 268 | uint8_t reserved_3; // 1 reserved for future use |
sayzyas | 0:19075177391c | 269 | uint8_t reserved_4; // 1 reserved for future use |
sayzyas | 0:19075177391c | 270 | uint8_t reserved_5; // 1 reserved for future use |
sayzyas | 0:19075177391c | 271 | uint8_t reserved_6; // 1 reserved for future use |
sayzyas | 0:19075177391c | 272 | uint8_t reserved_7; // 1 reserved for future use |
sayzyas | 0:19075177391c | 273 | } wch_SetValue_t; // << 24 byte >> |
sayzyas | 0:19075177391c | 274 | |
sayzyas | 0:19075177391c | 275 | typedef struct { |
sayzyas | 0:19075177391c | 276 | uint8_t rjs_centervalue; // 1 R JoyStick center value |
sayzyas | 0:19075177391c | 277 | uint8_t rjs_u_dead_zone; // 1 R Joystick upper dead zone width |
sayzyas | 0:19075177391c | 278 | uint8_t rjs_l_dead_zone; // 1 R Joystick lower dead zone width |
sayzyas | 0:19075177391c | 279 | uint8_t ljs_centervalue; // 1 L JoyStick center value |
sayzyas | 0:19075177391c | 280 | uint8_t ljs_u_dead_zone; // 1 L Joystick upper dead zone width |
sayzyas | 0:19075177391c | 281 | uint8_t ljs_l_dead_zone; // 1 L Joystick lower dead zone width |
sayzyas | 0:19075177391c | 282 | uint8_t reserved_1; // 1 reserved for future use |
sayzyas | 0:19075177391c | 283 | uint8_t reserved_2; // 1 reserved for future use |
sayzyas | 0:19075177391c | 284 | } js_SetValue_t; // << 8 byte >> |
sayzyas | 0:19075177391c | 285 | |
sayzyas | 0:19075177391c | 286 | typedef struct SetValue { |
sayzyas | 0:19075177391c | 287 | crawler_SetValue_t crwCtrl; |
sayzyas | 0:19075177391c | 288 | tfm_SetValue_t tfmCtrl; |
sayzyas | 0:19075177391c | 289 | ptl_SetValue_t ptlCtrl; |
sayzyas | 0:19075177391c | 290 | wch_SetValue_t wchCtrl; |
sayzyas | 0:19075177391c | 291 | } setValue_t; |
sayzyas | 0:19075177391c | 292 | |
sayzyas | 0:19075177391c | 293 | #define SLOWDOWN_DISTANCE 23 // <--10 2016.06.01 |
sayzyas | 0:19075177391c | 294 | #define SLOWDOWN_NEAR_DISTANCE 3 |
sayzyas | 0:19075177391c | 295 | /* |
sayzyas | 0:19075177391c | 296 | typedef struct { |
sayzyas | 0:19075177391c | 297 | int16_t dt_WinchCntPosition; // Current winch posittion |
sayzyas | 0:19075177391c | 298 | int16_t dt_WinchRtvValue; // Winch Moving distance |
sayzyas | 0:19075177391c | 299 | int16_t dt_WinchDstPosition; // Destination Position |
sayzyas | 0:19075177391c | 300 | char operation; |
sayzyas | 0:19075177391c | 301 | int8_t dt_WinchMotorCurrent; // Winch motor current |
sayzyas | 0:19075177391c | 302 | } winchData_t; |
sayzyas | 0:19075177391c | 303 | */ |
sayzyas | 0:19075177391c | 304 | |
sayzyas | 0:19075177391c | 305 | typedef struct { |
sayzyas | 0:19075177391c | 306 | int16_t dt_WinchCntPosition; // Current winch posittion |
sayzyas | 0:19075177391c | 307 | int16_t dt_WinchRtvValue; // Winch Moving distance |
sayzyas | 0:19075177391c | 308 | int16_t dt_WinchDstPosition; // Destination Position |
sayzyas | 0:19075177391c | 309 | uint8_t operation; |
sayzyas | 0:19075177391c | 310 | uint8_t dt_WinchMotor1Current; // Winch motor 1 current |
sayzyas | 0:19075177391c | 311 | uint8_t dt_WinchMotor2Current; // Winch motor 2 current |
sayzyas | 0:19075177391c | 312 | uint8_t res; |
sayzyas | 0:19075177391c | 313 | } winchData_t; |
sayzyas | 0:19075177391c | 314 | |
sayzyas | 0:19075177391c | 315 | |
sayzyas | 0:19075177391c | 316 | #define ROTATE_PER_RESOLUTION 24 |
sayzyas | 0:19075177391c | 317 | |
sayzyas | 0:19075177391c | 318 | #define __READ_CURRENT_AT_CIF_TASK__ |
sayzyas | 0:19075177391c | 319 | |
sayzyas | 0:19075177391c | 320 | //mv_WinchMvData |