13 changed files with 497 additions and 511 deletions
-
10.cproject
-
2.project
-
4.settings/language.settings.xml
-
4.settings/stm32cubeide.project.prefs
-
0dap.cfg
-
2sdk
-
117usrc/main.cpp
-
107usrc/project.hpp
-
4zapp.ioc
-
14zapp.launch
@ -1,3 +1,3 @@ |
|||
8DF89ED150041C4CBC7CB9A9CAA90856=763711B08F1ABC1A77FC8FA1A08B45FA |
|||
DC22A860405A8BF2F2C095E5B6529F12=763711B08F1ABC1A77FC8FA1A08B45FA |
|||
8DF89ED150041C4CBC7CB9A9CAA90856=F6DE5292A9642B92EC07AFF89A393D1B |
|||
DC22A860405A8BF2F2C095E5B6529F12=D76CD03FA6D6925E54EEE32EC928F8C2 |
|||
eclipse.preferences.version=1 |
@ -1 +1 @@ |
|||
Subproject commit c081915dfcdc6901b278c969f861458ee386eae0 |
|||
Subproject commit f28856b68a9c6fd2b06070a2a10c6f40dfe9896d |
@ -1,64 +1,83 @@ |
|||
#pragma once
|
|||
|
|||
#define VERSION "v2.0"
|
|||
#define VERSION "v1.0"
|
|||
// 设备ID
|
|||
#define DEVICE_ID (128 + 3)
|
|||
#define DEVICE_ID (128 + 5)
|
|||
// 调试串口
|
|||
#define DEBUG_UART huart1
|
|||
// 调试指示灯
|
|||
#define DEBUG_LIGHT_GPIO PE2
|
|||
|
|||
#define DEBUG_LIGHT_GPIO PE8
|
|||
// 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
|
|||
// 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
|
|||
#define DELAY_US_TIMER htim6
|
|||
#define MICROSWITCH_NUM 6
|
|||
//
|
|||
/*******************************************************************************
|
|||
* 主从485通讯 * |
|||
*******************************************************************************/ |
|||
#define MASTER_SLAVE_485_UART huart2
|
|||
/*******************************************************************************
|
|||
* 反应盒扫码传感器 * |
|||
*******************************************************************************/ |
|||
#define REACTION_BOX_SWEEP_SENSOR_UART huart3
|
|||
/*******************************************************************************
|
|||
* MOTOR * |
|||
*******************************************************************************/ |
|||
/**
|
|||
* |
|||
* |
|||
*/ |
|||
#define MOTOR_SPI hspi1
|
|||
|
|||
// 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
|
|||
#define TMC5130_MOTOR_NUM 2
|
|||
#define MOTOR_CH(n) (n)
|
|||
// FYBJ_PY
|
|||
#define MOTOR0_CSN PA4 // 平移电机片选信号
|
|||
#define MOTOR0_ENN PE14
|
|||
// FYBJ_TJ_DRV
|
|||
#define MOTOR1_CSN PC4 // 添加电机片选信号
|
|||
#define MOTOR1_ENN PE13
|
|||
|
|||
/*******************************************************************************
|
|||
* MotorConfig * |
|||
* REG LIST * |
|||
*******************************************************************************/ |
|||
|
|||
#define MOTOR_REDUCTION_RATIO1 50
|
|||
#define MOTOR_REDUCTION_RATIO2 50
|
|||
#define DEVICE_BASIC_CONTROLLER_ADD_BASE 0
|
|||
|
|||
#define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
|
|||
#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
|
|||
|
|||
#define REG_PY_MOTOR_CTRL_ADD_BASE 10000 // 控制 入料电机控制
|
|||
#define REG_TJ_MOTOR_CTRL_ADD_BASE 10100 // 控制 转移电机控制
|
|||
#define REG_ID_CARD_READER_CTRL_ADD_BASE 20000 // 控制 串口扫码器
|
|||
#define REG_LARSER_SCANNER_CTRL_ADD_BASE 30000 // 控制 单点激光扫码器
|
|||
|
|||
|
|||
#define SCARA_L2 (2385) // 0.1mm
|
|||
#define SCARA_L1 (2150) // 0.1mm
|
|||
/*******************************************************************************
|
|||
* REG LIST * |
|||
* GPIO * |
|||
*******************************************************************************/ |
|||
// https://iflytop1.feishu.cn/docx/ZBsddjrL1oHAiYx8DdmcccEBnPf
|
|||
#define BEEP PA1 // 蜂鸣器
|
|||
#define FAN1_FB_INT PA15 // 帕尔贴风机反馈
|
|||
|
|||
#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 HOT_CTR PB1
|
|||
|
|||
#define REG_GPIO_INPUT0 (GPIO_INPUT_ADD_BASE + 0)
|
|||
#define FAN0_POWER PC8 // 外部风机电源
|
|||
#define FAN1_POWER PC9 // 帕尔贴风机
|
|||
|
|||
#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 FYBH_READ1 PD0
|
|||
#define FYBH_READ2 PD1
|
|||
#define FYBH_READ3 PD2
|
|||
#define FYBH_READ4 PD3
|
|||
#define FYBH_READ5 PD4
|
|||
#define FYBH_READ6 PD5
|
|||
#define FYBJL_SENSOR8 PD7 // 开门霍尔
|
|||
#define FYBJL_SENSOR7 PD8 // 卡板光电1
|
|||
#define FYBJL_SENSOR6 PD9 // 预留光电
|
|||
#define FYBJL_SENSOR5 PD10 // 推杆限位光电
|
|||
#define FYBJL_SENSOR4 PD11 // 推杆原点光电
|
|||
#define FYBJL_SENSOR3 PD12 // 平移计步光电(预留)
|
|||
#define FYBJL_SENSOR2 PD13 // 平移限位光电
|
|||
#define FYBJL_SENSOR1 PD14 // 平移原点光电
|
|||
#define FYBJL_SENSOR0 PD15 // 黑白扫码
|
|||
|
|||
#define CODE_SCANER_UART huart3
|
|||
#define COLD_CTR PE10
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue