You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

403 lines
19 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include "board.h"
  4. #include "sdk\components\subcanmodule\zcancmder_subboard_initer.hpp"
  5. /*******************************************************************************
  6. * PROJECT_INCLUDE *
  7. *******************************************************************************/
  8. #include "sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp"
  9. #include "sdk\components\mini_servo_motor\feite_servo_motor.hpp"
  10. #include "sdk\components\mini_servo_motor\mini_servo_motor_ctrl_module.hpp"
  11. #include "sdk\components\pipette_module\pipette_ctrl_module_v2.hpp"
  12. #include "sdk\components\sensors\m3078\m3078_code_scaner.hpp"
  13. #include "sdk\components\tmc\ic\ztmc4361A.hpp"
  14. #include "sdk\components\tmc\ic\ztmc5130.hpp"
  15. #define TAG "main"
  16. using namespace iflytop;
  17. using namespace std;
  18. static ZCancmderSubboardIniter initer;
  19. extern void umain();
  20. extern "C" {
  21. void StartDefaultTask(void const* argument) { umain(); }
  22. extern DMA_HandleTypeDef hdma_usart3_rx;
  23. extern DMA_HandleTypeDef hdma_usart3_tx;
  24. }
  25. /*******************************************************************************
  26. * GET_DEVICE_ID *
  27. *******************************************************************************/
  28. static ZGPIO ID0;
  29. static ZGPIO ID1;
  30. static ZGPIO ID2;
  31. static ZGPIO ID3;
  32. static ZGPIO ID4;
  33. static int32_t getDeviceId() {
  34. static bool init = false;
  35. if (!init) {
  36. ID0.initAsInput(ID0_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  37. ID1.initAsInput(ID1_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  38. ID2.initAsInput(ID2_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  39. ID3.initAsInput(ID3_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  40. ID4.initAsInput(ID4_IO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  41. init = true;
  42. }
  43. uint8_t id = ID0.getState() * 1 + ID1.getState() * 2 + ID2.getState() * 4 + ID3.getState() * 8 + ID4.getState() * 16;
  44. return id;
  45. }
  46. /*******************************************************************************
  47. * INIT_SUBMODULE *
  48. *******************************************************************************/
  49. #define GLOBAL_SCALE 32
  50. #define DEFAULT_ENABLE true
  51. void nvs_init_cb() {}
  52. static void initsubmodule() {
  53. osDelay(1000);
  54. {
  55. static TMC5130 g_motor;
  56. static StepMotorCtrlModule g_stepMotorCtrlModule;
  57. TMC5130::cfg_t cfg = {
  58. .spi = &TMC_MOTOR_SPI, //
  59. .csgpio = MOTO1_CSN, //
  60. .ennPin = MOTO1_DRV_ENN, //
  61. };
  62. g_motor.initialize(&cfg);
  63. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  64. g_motor.enable(true);
  65. g_motor.setMotorShaft(false);
  66. g_motor.setGlobalScale(GLOBAL_SCALE);
  67. // g_motor.rotate(1*1000);
  68. static ZGPIO input[10];
  69. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  70. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  71. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  72. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  73. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  74. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  75. smcm_cfg.base_param.stepmotor_ihold = 1;
  76. smcm_cfg.base_param.stepmotor_irun = 20;
  77. smcm_cfg.base_param.motor_shaft = 0;
  78. smcm_cfg.base_param.motor_default_velocity = 800;
  79. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  80. smcm_cfg.base_param.max_d = 0;
  81. smcm_cfg.base_param.min_d = 0;
  82. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  83. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  84. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  85. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  86. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  87. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  88. g_stepMotorCtrlModule.initialize(initer.get_module_id(1), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  89. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  90. initer.register_module(&g_stepMotorCtrlModule);
  91. }
  92. {
  93. static TMC5130 g_motor;
  94. static StepMotorCtrlModule g_stepMotorCtrlModule;
  95. TMC5130::cfg_t cfg = {
  96. .spi = &TMC_MOTOR_SPI, //
  97. .csgpio = MOTO2_CSN, //
  98. .ennPin = MOTO2_DRV_ENN, //
  99. };
  100. g_motor.initialize(&cfg);
  101. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  102. g_motor.enable(true);
  103. g_motor.setMotorShaft(false);
  104. g_motor.setGlobalScale(GLOBAL_SCALE);
  105. static ZGPIO input[10];
  106. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  107. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  108. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  109. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  110. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  111. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  112. smcm_cfg.base_param.stepmotor_ihold = 1;
  113. smcm_cfg.base_param.stepmotor_irun = 20;
  114. smcm_cfg.base_param.motor_shaft = 0;
  115. smcm_cfg.base_param.motor_default_velocity = 800;
  116. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  117. smcm_cfg.base_param.max_d = 0;
  118. smcm_cfg.base_param.min_d = 0;
  119. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  120. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  121. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  122. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  123. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  124. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  125. g_stepMotorCtrlModule.initialize(initer.get_module_id(2), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  126. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  127. initer.register_module(&g_stepMotorCtrlModule);
  128. }
  129. {
  130. static TMC5130 g_motor;
  131. static StepMotorCtrlModule g_stepMotorCtrlModule;
  132. TMC5130::cfg_t cfg = {
  133. .spi = &TMC_MOTOR_SPI, //
  134. .csgpio = MOTO3_CSN, //
  135. .ennPin = MOTO3_DRV_ENN, //
  136. };
  137. g_motor.initialize(&cfg);
  138. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  139. g_motor.enable(true);
  140. g_motor.setMotorShaft(false);
  141. g_motor.setGlobalScale(GLOBAL_SCALE);
  142. static ZGPIO input[10];
  143. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  144. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  145. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  146. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  147. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  148. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  149. smcm_cfg.base_param.stepmotor_ihold = 1;
  150. smcm_cfg.base_param.stepmotor_irun = 20;
  151. smcm_cfg.base_param.motor_shaft = 0;
  152. smcm_cfg.base_param.motor_default_velocity = 800;
  153. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  154. smcm_cfg.base_param.max_d = 0;
  155. smcm_cfg.base_param.min_d = 0;
  156. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  157. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  158. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  159. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  160. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  161. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  162. g_stepMotorCtrlModule.initialize(initer.get_module_id(3), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  163. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  164. initer.register_module(&g_stepMotorCtrlModule);
  165. }
  166. {
  167. static TMC5130 g_motor;
  168. static StepMotorCtrlModule g_stepMotorCtrlModule;
  169. TMC5130::cfg_t cfg = {
  170. .spi = &TMC_MOTOR_SPI, //
  171. .csgpio = MOTO4_CSN, //
  172. .ennPin = MOTO4_DRV_ENN, //
  173. };
  174. g_motor.initialize(&cfg);
  175. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  176. g_motor.enable(true);
  177. g_motor.setMotorShaft(false);
  178. g_motor.setGlobalScale(GLOBAL_SCALE);
  179. static ZGPIO input[10];
  180. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  181. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  182. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  183. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  184. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  185. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  186. smcm_cfg.base_param.stepmotor_ihold = 1;
  187. smcm_cfg.base_param.stepmotor_irun = 20;
  188. smcm_cfg.base_param.motor_shaft = 0;
  189. smcm_cfg.base_param.motor_default_velocity = 800;
  190. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  191. smcm_cfg.base_param.max_d = 0;
  192. smcm_cfg.base_param.min_d = 0;
  193. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  194. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  195. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  196. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  197. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  198. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  199. g_stepMotorCtrlModule.initialize(initer.get_module_id(4), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  200. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  201. initer.register_module(&g_stepMotorCtrlModule);
  202. }
  203. {
  204. static TMC5130 g_motor;
  205. static StepMotorCtrlModule g_stepMotorCtrlModule;
  206. TMC5130::cfg_t cfg = {
  207. .spi = &TMC_MOTOR_SPI, //
  208. .csgpio = MOTO5_CSN, //
  209. .ennPin = MOTO5_DRV_ENN, //
  210. };
  211. g_motor.initialize(&cfg);
  212. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  213. g_motor.enable(true);
  214. g_motor.setMotorShaft(false);
  215. g_motor.setGlobalScale(GLOBAL_SCALE);
  216. static ZGPIO input[10];
  217. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  218. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  219. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  220. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  221. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  222. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  223. smcm_cfg.base_param.stepmotor_ihold = 1;
  224. smcm_cfg.base_param.stepmotor_irun = 20;
  225. smcm_cfg.base_param.motor_shaft = 0;
  226. smcm_cfg.base_param.motor_default_velocity = 800;
  227. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  228. smcm_cfg.base_param.max_d = 0;
  229. smcm_cfg.base_param.min_d = 0;
  230. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  231. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  232. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  233. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  234. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  235. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  236. g_stepMotorCtrlModule.initialize(initer.get_module_id(5), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  237. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  238. initer.register_module(&g_stepMotorCtrlModule);
  239. }
  240. {
  241. static TMC5130 g_motor;
  242. static StepMotorCtrlModule g_stepMotorCtrlModule;
  243. TMC5130::cfg_t cfg = {
  244. .spi = &TMC_MOTOR_SPI, //
  245. .csgpio = MOTO6_CSN, //
  246. .ennPin = MOTO6_DRV_ENN, //
  247. };
  248. g_motor.initialize(&cfg);
  249. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  250. g_motor.enable(true);
  251. g_motor.setMotorShaft(false);
  252. g_motor.setGlobalScale(GLOBAL_SCALE);
  253. static ZGPIO input[10];
  254. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  255. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  256. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  257. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  258. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  259. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  260. smcm_cfg.base_param.stepmotor_ihold = 1;
  261. smcm_cfg.base_param.stepmotor_irun = 20;
  262. smcm_cfg.base_param.motor_shaft = 0;
  263. smcm_cfg.base_param.motor_default_velocity = 800;
  264. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  265. smcm_cfg.base_param.max_d = 0;
  266. smcm_cfg.base_param.min_d = 0;
  267. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  268. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  269. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  270. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  271. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  272. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  273. g_stepMotorCtrlModule.initialize(initer.get_module_id(6), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  274. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  275. initer.register_module(&g_stepMotorCtrlModule);
  276. }
  277. {
  278. static TMC5130 g_motor;
  279. static StepMotorCtrlModule g_stepMotorCtrlModule;
  280. TMC5130::cfg_t cfg = {
  281. .spi = &TMC_MOTOR_SPI, //
  282. .csgpio = MOTO7_CSN, //
  283. .ennPin = MOTO7_DRV_ENN, //
  284. };
  285. g_motor.initialize(&cfg);
  286. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  287. g_motor.enable(true);
  288. g_motor.setMotorShaft(false);
  289. g_motor.setGlobalScale(GLOBAL_SCALE);
  290. static ZGPIO input[10];
  291. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  292. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  293. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  294. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  295. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  296. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  297. smcm_cfg.base_param.stepmotor_ihold = 1;
  298. smcm_cfg.base_param.stepmotor_irun = 20;
  299. smcm_cfg.base_param.motor_shaft = 0;
  300. smcm_cfg.base_param.motor_default_velocity = 800;
  301. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  302. smcm_cfg.base_param.max_d = 0;
  303. smcm_cfg.base_param.min_d = 0;
  304. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  305. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  306. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  307. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  308. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  309. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  310. g_stepMotorCtrlModule.initialize(initer.get_module_id(7), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  311. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  312. initer.register_module(&g_stepMotorCtrlModule);
  313. }
  314. {
  315. static TMC5130 g_motor;
  316. static StepMotorCtrlModule g_stepMotorCtrlModule;
  317. TMC5130::cfg_t cfg = {
  318. .spi = &TMC_MOTOR_SPI, //
  319. .csgpio = MOTO8_CSN, //
  320. .ennPin = MOTO8_DRV_ENN, //
  321. };
  322. g_motor.initialize(&cfg);
  323. ZLOGI(TAG, "motora initialize 5160:%x ", g_motor.readICVersion());
  324. g_motor.enable(true);
  325. g_motor.setMotorShaft(false);
  326. g_motor.setGlobalScale(GLOBAL_SCALE);
  327. static ZGPIO input[10];
  328. // input[0].initAsInput(MOTOR0_REFL /*REFL*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  329. // input[1].initAsInput(MOTOR0_REFR /*REFR*/, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, true);
  330. StepMotorCtrlModule::flash_config_t smcm_cfg = {0};
  331. StepMotorCtrlModule::create_default_cfg(smcm_cfg);
  332. smcm_cfg.base_param.motor_one_circle_pulse = 1000;
  333. smcm_cfg.base_param.motor_one_circle_pulse_denominator = 1;
  334. smcm_cfg.base_param.stepmotor_ihold = 1;
  335. smcm_cfg.base_param.stepmotor_irun = 20;
  336. smcm_cfg.base_param.motor_shaft = 0;
  337. smcm_cfg.base_param.motor_default_velocity = 800;
  338. smcm_cfg.base_param.motor_run_to_zero_speed = 0;
  339. smcm_cfg.base_param.max_d = 0;
  340. smcm_cfg.base_param.min_d = 0;
  341. smcm_cfg.base_param.motor_run_to_zero_max_d = 0;
  342. smcm_cfg.base_param.motor_run_to_zero_speed = 1;
  343. smcm_cfg.base_param.motor_run_to_zero_dec = 0;
  344. smcm_cfg.base_param.motor_look_zero_edge_max_d = 0;
  345. smcm_cfg.base_param.motor_look_zero_edge_speed = 1;
  346. smcm_cfg.base_param.motor_look_zero_edge_dec = 0;
  347. g_stepMotorCtrlModule.initialize(initer.get_module_id(8), &g_motor, input, ZARRAY_SIZE(input), nullptr, &smcm_cfg);
  348. g_stepMotorCtrlModule.enable(DEFAULT_ENABLE);
  349. initer.register_module(&g_stepMotorCtrlModule);
  350. }
  351. }
  352. /*******************************************************************************
  353. * MAIN *
  354. *******************************************************************************/
  355. void umain() {
  356. ZCancmderSubboardIniter::cfg_t cfg = //
  357. {
  358. .deviceId = getDeviceId(),
  359. .input_gpio = {},
  360. .output_gpio = {},
  361. };
  362. initer.init(&cfg);
  363. initsubmodule();
  364. initer.loop();
  365. }