|
|
@ -33,6 +33,18 @@ void ZCanProtocolParser::initialize(IZCanReceiver* cancmder) { |
|
|
|
REGFN(step_motor_stop); |
|
|
|
REGFN(step_motor_read_io_state); |
|
|
|
|
|
|
|
REGFN(mini_servo_enable); |
|
|
|
REGFN(mini_servo_read_pos); |
|
|
|
REGFN(mini_servo_active_cfg); |
|
|
|
REGFN(mini_servo_stop); |
|
|
|
REGFN(mini_servo_rotate); |
|
|
|
REGFN(mini_servo_move_to); |
|
|
|
REGFN(mini_servo_set_mid_point); |
|
|
|
REGFN(mini_servo_read_io_state); |
|
|
|
|
|
|
|
REGFN(board_read_ext_io); |
|
|
|
REGFN(board_write_ext_io); |
|
|
|
|
|
|
|
#if 0
|
|
|
|
REGFN(xymotor_enable); |
|
|
|
REGFN(xymotor_move_by); |
|
|
@ -143,7 +155,6 @@ int32_t ZCanProtocolParser::module_get_reg(cmdcontxt_t* cxt) { |
|
|
|
CHECK_AND_GET_MODULE(1); |
|
|
|
int32_t* ack = (int32_t*)cxt->ackbuf; |
|
|
|
cxt->acklen = 4; |
|
|
|
ZLOGI(TAG, "module_get_reg %d", cxt->params[0]); |
|
|
|
return module->module_get_reg(cxt->params[0], &ack[0]); |
|
|
|
} |
|
|
|
|
|
|
@ -274,6 +285,20 @@ int32_t ZCanProtocolParser::mini_servo_read_io_state(cmdcontxt_t* cxt) { |
|
|
|
cxt->acklen = 4; |
|
|
|
return module->mini_servo_read_io_state(cxt->params[0], ack); |
|
|
|
} |
|
|
|
#undef MODULE_CLASS
|
|
|
|
|
|
|
|
#define MODULE_CLASS ZIBoard
|
|
|
|
int32_t ZCanProtocolParser::board_read_ext_io(cmdcontxt_t* cxt) { |
|
|
|
CHECK_AND_GET_MODULE(1); |
|
|
|
int32_t* ack = (int32_t*)cxt->ackbuf; |
|
|
|
cxt->acklen = 4; |
|
|
|
return module->board_read_ext_io(cxt->params[0], ack); |
|
|
|
} |
|
|
|
int32_t ZCanProtocolParser::board_write_ext_io(cmdcontxt_t* cxt) { |
|
|
|
CHECK_AND_GET_MODULE(2); |
|
|
|
return module->board_write_ext_io(cxt->params[0], cxt->params[1]); |
|
|
|
} |
|
|
|
#undef MODULE_CLASS
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|