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.
64 lines
2.1 KiB
64 lines
2.1 KiB
#pragma once
|
|
|
|
#define VERSION "v2.0"
|
|
// 设备ID
|
|
#define DEVICE_ID (128 + 3)
|
|
// 调试串口
|
|
#define DEBUG_UART huart1
|
|
// 调试指示灯
|
|
#define DEBUG_LIGHT_GPIO PE2
|
|
|
|
// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
|
|
// http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md
|
|
#define DELAY_US_TIMER htim6
|
|
|
|
// 电机通道编号
|
|
#define TMC_MOTOR_SPI hspi1
|
|
|
|
// MOTOR1
|
|
#define TMC_MOTOR1_CHANNEL 1
|
|
#define TMC_MOTOR1_SPI_SELECT1_IO PA4
|
|
#define TMC_MOTOR1_nFREEZE_IO PC2
|
|
#define TMC_MOTOR1_nRESET_IO PB3
|
|
#define TMC_MOTOR1_SUB_IC_ENN_IO PC3
|
|
#define TMC_MOTOR1_ENN_IO // unused
|
|
|
|
// MOTOR2
|
|
#define TMC_MOTOR2_CHANNEL 2
|
|
#define TMC_MOTOR2_SPI_SELECT1_IO PA8
|
|
#define TMC_MOTOR2_nFREEZE_IO PC6
|
|
#define TMC_MOTOR2_nRESET_IO PB2
|
|
#define TMC_MOTOR2_SUB_IC_ENN_IO PC7
|
|
#define TMC_MOTOR2_ENN_IO // unused
|
|
|
|
/*******************************************************************************
|
|
* MotorConfig *
|
|
*******************************************************************************/
|
|
|
|
#define MOTOR_REDUCTION_RATIO1 50
|
|
#define MOTOR_REDUCTION_RATIO2 50
|
|
|
|
#define SCARA_L2 (2385) // 0.1mm
|
|
#define SCARA_L1 (2150) // 0.1mm
|
|
/*******************************************************************************
|
|
* REG LIST *
|
|
*******************************************************************************/
|
|
// https://iflytop1.feishu.cn/docx/ZBsddjrL1oHAiYx8DdmcccEBnPf
|
|
|
|
#define DEVICE_BASIC_CTRL_ADD_BASE 0
|
|
#define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
|
|
#define REG_SCARA_CTRL_ADD_BASE 11200 // 机械臂控制基地址
|
|
#define REG_BARCODE_CTRL_ADD_BASE 20000 // 扫码器控制基地址
|
|
|
|
#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
|
|
|
|
#define ARM_SENSOR1_GPIO PD0
|
|
#define ARM_SENSOR2_GPIO PD1
|
|
#define ARM_SENSOR3_GPIO PD2
|
|
#define ARM_SENSOR4_GPIO PD3
|
|
#define ARM_SENSOR5_GPIO PD4
|
|
#define ARM_SENSOR6_GPIO PD5
|
|
#define ARM_SENSOR7_GPIO PD6
|
|
#define ARM_SENSOR8_GPIO PD7
|
|
|
|
#define CODE_SCANER_UART huart3
|