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.

81 lines
3.2 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
  1. #pragma once
  2. #define VERSION "v1.0"
  3. // 设备ID
  4. #define DEVICE_ID (128 + 5)
  5. // 调试串口
  6. #define DEBUG_UART huart1
  7. // 调试指示灯
  8. #define DEBUG_LIGHT_GPIO PE8
  9. // 微秒延迟定时器,注意该延时定时器需要按照以下文档进行配置
  10. // http://192.168.1.3:3000/zwikipedia/iflytop_wikipedia/src/branch/master/doc/stm32cubemx_us_timer.md
  11. #define DELAY_US_TIMER htim6
  12. #define MICROSWITCH_NUM 6
  13. //
  14. /*******************************************************************************
  15. * 485 *
  16. *******************************************************************************/
  17. #define MASTER_SLAVE_485_UART huart2
  18. /*******************************************************************************
  19. * *
  20. *******************************************************************************/
  21. #define REACTION_BOX_SWEEP_SENSOR_UART huart3
  22. /*******************************************************************************
  23. * MOTOR *
  24. *******************************************************************************/
  25. /**
  26. *
  27. *
  28. */
  29. #define MOTOR_SPI hspi1
  30. #define TMC5130_MOTOR_NUM 2
  31. #define MOTOR_CH(n) (n)
  32. // FYBJ_PY
  33. #define MOTOR0_CSN PA4 // 平移电机片选信号
  34. #define MOTOR0_ENN PE14
  35. // FYBJ_TJ_DRV
  36. #define MOTOR1_CSN PC4 // 添加电机片选信号
  37. #define MOTOR1_ENN PE13
  38. /*******************************************************************************
  39. * REG LIST *
  40. *******************************************************************************/
  41. #define DEVICE_BASIC_CONTROLLER_ADD_BASE 0
  42. #define GPIO_INPUT_ADD_BASE 1000 // GPIO输入
  43. #define REG_PY_MOTOR_CTRL_ADD_BASE 10000 // 控制 入料电机控制
  44. #define REG_TJ_MOTOR_CTRL_ADD_BASE 10100 // 控制 转移电机控制
  45. #define REG_ID_CARD_READER_CTRL_ADD_BASE 20000 // 控制 串口扫码器
  46. #define REG_LARSER_SCANNER_CTRL_ADD_BASE 30000 // 控制 单点激光扫码器
  47. /*******************************************************************************
  48. * GPIO *
  49. *******************************************************************************/
  50. #define BEEP PA1 // 蜂鸣器
  51. #define FAN1_FB_INT PA15 // 帕尔贴风机反馈
  52. #define HOT_CTR PB1
  53. #define FAN0_POWER PC8 // 外部风机电源
  54. #define FAN1_POWER PC9 // 帕尔贴风机
  55. #define FYBH_READ1 PD0
  56. #define FYBH_READ2 PD1
  57. #define FYBH_READ3 PD2
  58. #define FYBH_READ4 PD3
  59. #define FYBH_READ5 PD4
  60. #define FYBH_READ6 PD5
  61. #define FYBJL_SENSOR8 PD7 // 开门霍尔
  62. #define FYBJL_SENSOR7 PD8 // 卡板光电1
  63. #define FYBJL_SENSOR6 PD9 // 预留光电
  64. #define FYBJL_SENSOR5 PD10 // 推杆限位光电
  65. #define FYBJL_SENSOR4 PD11 // 推杆原点光电
  66. #define FYBJL_SENSOR3 PD12 // 平移计步光电(预留)
  67. #define FYBJL_SENSOR2 PD13 // 平移限位光电
  68. #define FYBJL_SENSOR1 PD14 // 平移原点光电
  69. #define FYBJL_SENSOR0 PD15 // 黑白扫码
  70. #define COLD_CTR PE10