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.

104 lines
4.8 KiB

3 months ago
  1. #pragma once
  2. #include "project_configs.h"
  3. #define MAX_USR_NAME_SIZE 31
  4. /***********************************************************************************************************************
  5. * ָʾ *
  6. ***********************************************************************************************************************/
  7. #define DEBUG_LIGHT_IO PE2
  8. #define DEBUG_UART_INDEX 1
  9. #define DEBUG_UART_INS huart1
  10. #define DEBUG_UART_BAUDRATE 460800
  11. #define DEBUG_TX_PIN PB6
  12. #define DEBUG_RX_PIN PB7
  13. /***********************************************************************************************************************
  14. * ID *
  15. ***********************************************************************************************************************/
  16. #define ID0_IO PE1
  17. #define ID1_IO PE3
  18. #define ID2_IO PE4
  19. #define ID3_IO PE5
  20. #define ID4_IO PE6
  21. /***********************************************************************************************************************
  22. * *
  23. ***********************************************************************************************************************/
  24. // SPI
  25. #define MOTOR_SPI_INS hspi1
  26. #define MOTOR_SPI_INDEX 1
  27. #define MOTOR_SPI_SCK PA5
  28. #define MOTOR_SPI_SDO PA6
  29. #define MOTOR_SPI_SDI PA7
  30. // POWER EN
  31. #define MOTO_POWER_EN_IO PE7
  32. // CSN
  33. #define MOTO1_CSN_IO PE8
  34. #define MOTO2_CSN_IO PE9
  35. #define MOTO3_CSN_IO PE10
  36. #define MOTO4_CSN_IO PE11
  37. // ENN
  38. #define MOTO1_DRV_ENN_IO PE12
  39. #define MOTO2_DRV_ENN_IO PE13
  40. #define MOTO3_DRV_ENN_IO PE14
  41. #define MOTO4_DRV_ENN_IO PE15
  42. // REF
  43. #define MOTOR1_REF_L_IO PD6
  44. #define MOTOR1_REF_R_IO PD7
  45. #define MOTOR2_REF_L_IO PD10
  46. #define MOTOR2_REF_R_IO PD11
  47. #define MOTOR3_REF_L_IO PD12
  48. #define MOTOR3_REF_R_IO PD13
  49. #define MOTOR4_REF_L_IO PD14
  50. #define MOTOR4_REF_R_IO PD15
  51. /***********************************************************************************************************************
  52. * CAN *
  53. ***********************************************************************************************************************/
  54. #define CAN1_TX_PIN PD1
  55. #define CAN1_RX_PIN PD0
  56. #define IO_OUT1_IO PC0
  57. #define IO_OUT2_IO PC1
  58. /***********************************************************************************************************************
  59. * BLE_REMOTER *
  60. ***********************************************************************************************************************/
  61. #define BLE_UART_INS huart3
  62. #define BLE_CONNECTED_STATE_IO PB4
  63. #define BLE_UART_TX PD8
  64. #define BLE_UART_RX PD9
  65. #define BLE_UART_BAUDRATE 115200
  66. /***********************************************************************************************************************
  67. * TJC *
  68. ***********************************************************************************************************************/
  69. #define TJC_UART_CH_SEL_PIN PB12
  70. #define TJC_UART_CH_EN_PIN PB13
  71. #define TJC_UART_TX PC10
  72. #define TJC_UART_RX PC11
  73. #define TJC_UART_INS huart4
  74. /***********************************************************************************************************************
  75. * MOTOR_CFG *
  76. ***********************************************************************************************************************/
  77. #define MOTOR_SHAFT false
  78. #define STEPMOTOR_IHOLD 3
  79. #define STEPMOTOR_IHOLDDELAY 100
  80. #define MOTOR_VSTART 150 // �����ٶ�
  81. #define MOTOR_A1 5 // �׶�1_���ٶ�
  82. #define MOTOR_AMAX 20 // �׶�2_���ٶ�
  83. #define MOTOR_V1 500 // �׶�2_��ʼ�ٶ�
  84. #define MOTOR_TZEROWAIT 100 // �ٶ��������л�ʱ��
  85. #define BLENAME "AciDisp" // BLE����
  86. // #define MAX_RPM 800 // ����ת��
  87. #define PUMP_TEST_RPM 500 // �û�����ʱת��
  88. /***********************************************************************************************************************
  89. * Ĭֵ *
  90. ***********************************************************************************************************************/
  91. #define USER_DEFAULT_PWD "888888"
  92. #define PUMPDEFVEL 400 // 100r/min