/* 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 "stm32h7xx_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 */
extern int sdc_closed;
extern int sdc_closed_nodelay;
extern int ts_error;
extern int hv_active;
extern int neg_air_closed;
extern int pos_air_closed;
extern int precharge_closed;
extern int pre_and_air_open;

/* 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 LV_I_measure_Pin GPIO_PIN_0
#define LV_I_measure_GPIO_Port GPIOC
#define TEMP_TSDCDC_Pin GPIO_PIN_1
#define TEMP_TSDCDC_GPIO_Port GPIOC
#define STATUS_LED_B_Pin GPIO_PIN_2
#define STATUS_LED_B_GPIO_Port GPIOC
#define TS_ERROR_Pin GPIO_PIN_0
#define TS_ERROR_GPIO_Port GPIOA
#define HV_ACTIVE_Pin GPIO_PIN_1
#define HV_ACTIVE_GPIO_Port GPIOA
#define IMD_M_Pin GPIO_PIN_2
#define IMD_M_GPIO_Port GPIOA
#define IMD_OK_Pin GPIO_PIN_3
#define IMD_OK_GPIO_Port GPIOA
#define AMS_CS_Pin GPIO_PIN_4
#define AMS_CS_GPIO_Port GPIOA
#define NEG_AIR_CLOSED_Pin GPIO_PIN_6
#define NEG_AIR_CLOSED_GPIO_Port GPIOA
#define POS_AIR_CLOSED_Pin GPIO_PIN_7
#define POS_AIR_CLOSED_GPIO_Port GPIOA
#define MSTR1_Pin GPIO_PIN_4
#define MSTR1_GPIO_Port GPIOC
#define MSTR2_Pin GPIO_PIN_5
#define MSTR2_GPIO_Port GPIOC
#define PRE_and_AIR__open_Pin GPIO_PIN_0
#define PRE_and_AIR__open_GPIO_Port GPIOB
#define SDC_VOLTAGE_Pin GPIO_PIN_1
#define SDC_VOLTAGE_GPIO_Port GPIOB
#define IMD_POWER_Pin GPIO_PIN_2
#define IMD_POWER_GPIO_Port GPIOB
#define IMD_ERROR_LED_Pin GPIO_PIN_10
#define IMD_ERROR_LED_GPIO_Port GPIOB
#define AMS_ERROR_LED_Pin GPIO_PIN_13
#define AMS_ERROR_LED_GPIO_Port GPIOB
#define STATUS_LED_R_Pin GPIO_PIN_15
#define STATUS_LED_R_GPIO_Port GPIOB
#define POS_AIR_CTRL_Pin GPIO_PIN_6
#define POS_AIR_CTRL_GPIO_Port GPIOC
#define NEG_AIR_CTRL_Pin GPIO_PIN_7
#define NEG_AIR_CTRL_GPIO_Port GPIOC
#define TSAL_GREEN_Pin GPIO_PIN_9
#define TSAL_GREEN_GPIO_Port GPIOC
#define PRECHARGE_CTRL_Pin GPIO_PIN_8
#define PRECHARGE_CTRL_GPIO_Port GPIOA
#define INTR1_Pin GPIO_PIN_9
#define INTR1_GPIO_Port GPIOA
#define WAKE1_Pin GPIO_PIN_10
#define WAKE1_GPIO_Port GPIOA
#define AMS_NERROR_Pin GPIO_PIN_11
#define AMS_NERROR_GPIO_Port GPIOA
#define STATUS_LED_G_Pin GPIO_PIN_15
#define STATUS_LED_G_GPIO_Port GPIOA
#define INTR2_Pin GPIO_PIN_6
#define INTR2_GPIO_Port GPIOB
#define WAKE2_Pin GPIO_PIN_7
#define WAKE2_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
