131 lines
4.0 KiB
C
131 lines
4.0 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 "stm32f1xx_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 TEC_DEAD_TIME 100
|
|
#define AD7793_SPI hspi3
|
|
#define RS485_COM huart5
|
|
#define TEC_TIM_COUNTER 143
|
|
#define SAMPLING_TIM_PRE 71
|
|
#define US_TIM_PERIOD_COUNT 9999
|
|
#define TEC_TIM_PRESCALER 99
|
|
#define TEC_TIM htim1
|
|
#define HMI_COM huart2
|
|
#define SAMPLING_TIM htim3
|
|
#define US_TIM_PRE 71
|
|
#define TIMESTAMP_TIM htim4
|
|
#define ENCODER_TIM htim2
|
|
#define SAMPLING_TIM_PERIOD_COUNT 499//999
|
|
#define SERVO_COM huart3
|
|
#define LIGHT_ADC hadc1
|
|
#define ENCODER_MAX_COUNT 65535
|
|
#define PE5_LED1_Pin GPIO_PIN_5
|
|
#define PE5_LED1_GPIO_Port GPIOE
|
|
#define PE6_LED2_Pin GPIO_PIN_6
|
|
#define PE6_LED2_GPIO_Port GPIOE
|
|
#define TIM2_ENCODER_B_Pin GPIO_PIN_0
|
|
#define TIM2_ENCODER_B_GPIO_Port GPIOA
|
|
#define TIM2_ENCODER_A_Pin GPIO_PIN_1
|
|
#define TIM2_ENCODER_A_GPIO_Port GPIOA
|
|
#define UART2_TX_LCD_Pin GPIO_PIN_2
|
|
#define UART2_TX_LCD_GPIO_Port GPIOA
|
|
#define UART2_RX_LCD_Pin GPIO_PIN_3
|
|
#define UART2_RX_LCD_GPIO_Port GPIOA
|
|
#define I2C2_EEPROM_SCL_Pin GPIO_PIN_10
|
|
#define I2C2_EEPROM_SCL_GPIO_Port GPIOB
|
|
#define I2C2_EEPROM_SDA_Pin GPIO_PIN_11
|
|
#define I2C2_EEPROM_SDA_GPIO_Port GPIOB
|
|
#define TIM1_CH1N_TEC_Pin GPIO_PIN_13
|
|
#define TIM1_CH1N_TEC_GPIO_Port GPIOB
|
|
#define FAN_CTRL_Pin GPIO_PIN_15
|
|
#define FAN_CTRL_GPIO_Port GPIOD
|
|
#define TIM1_CH1_TEC_Pin GPIO_PIN_8
|
|
#define TIM1_CH1_TEC_GPIO_Port GPIOA
|
|
#define UART1_LCD_TX_Pin GPIO_PIN_9
|
|
#define UART1_LCD_TX_GPIO_Port GPIOA
|
|
#define UART1_LCD_RX_Pin GPIO_PIN_10
|
|
#define UART1_LCD_RX_GPIO_Port GPIOA
|
|
#define UART3_SERVO_TX_Pin GPIO_PIN_10
|
|
#define UART3_SERVO_TX_GPIO_Port GPIOC
|
|
#define UART3_SERVO_RX_Pin GPIO_PIN_11
|
|
#define UART3_SERVO_RX_GPIO_Port GPIOC
|
|
#define UART5_RS485_TX_Pin GPIO_PIN_12
|
|
#define UART5_RS485_TX_GPIO_Port GPIOC
|
|
#define UART5_RS485_RX_Pin GPIO_PIN_2
|
|
#define UART5_RS485_RX_GPIO_Port GPIOD
|
|
#define FAN_CONTROL_Pin GPIO_PIN_5
|
|
#define FAN_CONTROL_GPIO_Port GPIOD
|
|
#define SPI3_SCK_AD7793_Pin GPIO_PIN_3
|
|
#define SPI3_SCK_AD7793_GPIO_Port GPIOB
|
|
#define SPI3_MISO_AD7793_Pin GPIO_PIN_4
|
|
#define SPI3_MISO_AD7793_GPIO_Port GPIOB
|
|
#define SPI3_MOSI_AD7793_Pin GPIO_PIN_5
|
|
#define SPI3_MOSI_AD7793_GPIO_Port GPIOB
|
|
#define SPI3_CS_AD7793_Pin GPIO_PIN_7
|
|
#define SPI3_CS_AD7793_GPIO_Port GPIOB
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|