142 lines
4.4 KiB
C
142 lines
4.4 KiB
C
/* USER CODE BEGIN Header */
|
|
/**
|
|
******************************************************************************
|
|
* @file : main.h
|
|
* @brief : Header for main.c file.
|
|
* This file contains the common defines of the application.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* Copyright (c) 2025 STMicroelectronics.
|
|
* All rights reserved.
|
|
*
|
|
* This software is licensed under terms that can be found in the LICENSE file
|
|
* in the root directory of this software component.
|
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
/* USER CODE END Header */
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __MAIN_H
|
|
#define __MAIN_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "stm32g4xx_hal.h"
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN ET */
|
|
|
|
/* USER CODE END ET */
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
/* USER CODE BEGIN EC */
|
|
|
|
/* USER CODE END EC */
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN EM */
|
|
|
|
/* USER CODE END EM */
|
|
|
|
/* Exported functions prototypes ---------------------------------------------*/
|
|
void Error_Handler(void);
|
|
|
|
/* USER CODE BEGIN EFP */
|
|
|
|
/* USER CODE END EFP */
|
|
|
|
/* Private defines -----------------------------------------------------------*/
|
|
#define MOTOR1_1N_Pin GPIO_PIN_13
|
|
#define MOTOR1_1N_GPIO_Port GPIOC
|
|
#define MOTOR2_Z_Pin GPIO_PIN_10
|
|
#define MOTOR2_Z_GPIO_Port GPIOG
|
|
#define MOTOR1_I_U_Pin GPIO_PIN_0
|
|
#define MOTOR1_I_U_GPIO_Port GPIOA
|
|
#define MOTOR1_I_V_Pin GPIO_PIN_1
|
|
#define MOTOR1_I_V_GPIO_Port GPIOA
|
|
#define RS485_TX_Pin GPIO_PIN_2
|
|
#define RS485_TX_GPIO_Port GPIOA
|
|
#define MOTOR2_I_U__Pin GPIO_PIN_3
|
|
#define MOTOR2_I_U__GPIO_Port GPIOA
|
|
#define MOTOR1_ENCODER_B_Pin GPIO_PIN_4
|
|
#define MOTOR1_ENCODER_B_GPIO_Port GPIOA
|
|
#define MOTOR2_I_V__Pin GPIO_PIN_5
|
|
#define MOTOR2_I_V__GPIO_Port GPIOA
|
|
#define MOTOR2_BKIN_Pin GPIO_PIN_6
|
|
#define MOTOR2_BKIN_GPIO_Port GPIOA
|
|
#define MOTOR2_I_U_A7_Pin GPIO_PIN_7
|
|
#define MOTOR2_I_U_A7_GPIO_Port GPIOA
|
|
#define RUN_LED_Pin GPIO_PIN_4
|
|
#define RUN_LED_GPIO_Port GPIOC
|
|
#define MOTOR2_I_V_B0_Pin GPIO_PIN_0
|
|
#define MOTOR2_I_V_B0_GPIO_Port GPIOB
|
|
#define RS485_DE_Pin GPIO_PIN_1
|
|
#define RS485_DE_GPIO_Port GPIOB
|
|
#define MOTOR2_I_W__Pin GPIO_PIN_2
|
|
#define MOTOR2_I_W__GPIO_Port GPIOB
|
|
#define RS485_RX_Pin GPIO_PIN_10
|
|
#define RS485_RX_GPIO_Port GPIOB
|
|
#define MOTOR1_I_W_Pin GPIO_PIN_11
|
|
#define MOTOR1_I_W_GPIO_Port GPIOB
|
|
#define MOTOR_I_LINE_Pin GPIO_PIN_12
|
|
#define MOTOR_I_LINE_GPIO_Port GPIOB
|
|
#define MOTOR2_I_W_B13_Pin GPIO_PIN_13
|
|
#define MOTOR2_I_W_B13_GPIO_Port GPIOB
|
|
#define MOTOR1_2N_Pin GPIO_PIN_14
|
|
#define MOTOR1_2N_GPIO_Port GPIOB
|
|
#define MOTOR1_3N_Pin GPIO_PIN_15
|
|
#define MOTOR1_3N_GPIO_Port GPIOB
|
|
#define MOTOR2_1P_Pin GPIO_PIN_6
|
|
#define MOTOR2_1P_GPIO_Port GPIOC
|
|
#define MOTOR1_1P_Pin GPIO_PIN_8
|
|
#define MOTOR1_1P_GPIO_Port GPIOA
|
|
#define MOTOR1_2P_Pin GPIO_PIN_9
|
|
#define MOTOR1_2P_GPIO_Port GPIOA
|
|
#define MOTOR1_3P_Pin GPIO_PIN_10
|
|
#define MOTOR1_3P_GPIO_Port GPIOA
|
|
#define CAN_RX_Pin GPIO_PIN_11
|
|
#define CAN_RX_GPIO_Port GPIOA
|
|
#define CAN_TX_Pin GPIO_PIN_12
|
|
#define CAN_TX_GPIO_Port GPIOA
|
|
#define MOTOR1_BKIN_Pin GPIO_PIN_15
|
|
#define MOTOR1_BKIN_GPIO_Port GPIOA
|
|
#define MOTOR2_1N_Pin GPIO_PIN_10
|
|
#define MOTOR2_1N_GPIO_Port GPIOC
|
|
#define MOTOR2_2N_Pin GPIO_PIN_11
|
|
#define MOTOR2_2N_GPIO_Port GPIOC
|
|
#define MOTOR1_ENCODER_Z_Pin GPIO_PIN_3
|
|
#define MOTOR1_ENCODER_Z_GPIO_Port GPIOB
|
|
#define MOTOR1_ENCODER_A_Pin GPIO_PIN_4
|
|
#define MOTOR1_ENCODER_A_GPIO_Port GPIOB
|
|
#define MOTOR2_3N_Pin GPIO_PIN_5
|
|
#define MOTOR2_3N_GPIO_Port GPIOB
|
|
#define MOTOR2_ENCODER_A_Pin GPIO_PIN_6
|
|
#define MOTOR2_ENCODER_A_GPIO_Port GPIOB
|
|
#define MOTOR2_ENCODER_B_Pin GPIO_PIN_7
|
|
#define MOTOR2_ENCODER_B_GPIO_Port GPIOB
|
|
#define MOTOR2_2P_Pin GPIO_PIN_8
|
|
#define MOTOR2_2P_GPIO_Port GPIOB
|
|
#define MOTOR2_3P_Pin GPIO_PIN_9
|
|
#define MOTOR2_3P_GPIO_Port GPIOB
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|