/* 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 HMI_COM huart2
#define ENCODER_MAX_COUNT 65535
#define AD7793_SPI hspi3
#define US_TIM_PRE 71
#define RS485_COM huart5
#define ENCODER_TIM htim2
#define TEC_TIM_COUNTER 143
#define US_TIM_PERIOD_COUNT 9999
#define TEC_TIM_PRESCALER 99
#define SERVO_COM huart3
#define TEC_TIM htim1
#define COLLECT_TIM htim3
#define ADS8866_SPI hspi2
#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 RS485_DE_Pin GPIO_PIN_1
#define RS485_DE_GPIO_Port GPIOF
#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 TEC_LEFT_SD_Pin GPIO_PIN_6
#define TEC_LEFT_SD_GPIO_Port GPIOA
#define TEC_RIGHT_SD_Pin GPIO_PIN_7
#define TEC_RIGHT_SD_GPIO_Port GPIOA
#define ADS8866_CONVST_Pin GPIO_PIN_0
#define ADS8866_CONVST_GPIO_Port GPIOB
#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 SPI2_ADS8866_SCK_Pin GPIO_PIN_13
#define SPI2_ADS8866_SCK_GPIO_Port GPIOB
#define SPI2_ADS8866_MISO_Pin GPIO_PIN_14
#define SPI2_ADS8866_MISO_GPIO_Port GPIOB
#define SPI2_ADS8866_MOSI_Pin GPIO_PIN_15
#define SPI2_ADS8866_MOSI_GPIO_Port GPIOB
#define TEC_RIGHT_IN_Pin GPIO_PIN_8
#define TEC_RIGHT_IN_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_AD7793_SCK_Pin GPIO_PIN_3
#define SPI3_AD7793_SCK_GPIO_Port GPIOB
#define SPI3_AD7793_MISO_Pin GPIO_PIN_4
#define SPI3_AD7793_MISO_GPIO_Port GPIOB
#define SPI3_AD7793_MOSI_Pin GPIO_PIN_5
#define SPI3_AD7793_MOSI_GPIO_Port GPIOB
#define SPI3_AD7793_CS_Pin GPIO_PIN_7
#define SPI3_AD7793_CS_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
