/* 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 "stm32l4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <string.h> 	// memset
#include <stdio.h>		// printf
#include <stdbool.h> // bool
#include <stdlib.h> 	// abs
#include <stdint.h>	// uint8_t
#include "Printf.h"
#include "led.h"
#include "Modbussimple.h"
#include "uType.h"
#include "Callback.h"	
#include "FLASH.h"	
#include "tiny_md5.h"	
#include "iap_upgrade.h"
	
//#include "lt_fdc2214_iic.h"
#include "lt_fdc2214.h"
#include "Tlt_fdc2214.h"
//#include "ADS1256.h" // 硬件SPI
//#include "ADS1256_soft.h"
#include "ADS1256tb.h"
#include "filter.h"
#include "ntc_temperature.h"
#include "calib_piecewise_linear.h"

#include "kv_flash.h"
#include "task_monitor.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
void Restart_UART2_DMA(void);
void Restart_UART1_DMA(void);


/* 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 ADS_DRDY_Pin GPIO_PIN_0
#define ADS_DRDY_GPIO_Port GPIOA
#define SPI_CS_Pin GPIO_PIN_4
#define SPI_CS_GPIO_Port GPIOA
#define ADS_RST_Pin GPIO_PIN_0
#define ADS_RST_GPIO_Port GPIOB
#define ADS_PDMN_Pin GPIO_PIN_1
#define ADS_PDMN_GPIO_Port GPIOB
#define FDC_SLEEP1_Pin GPIO_PIN_2
#define FDC_SLEEP1_GPIO_Port GPIOB
#define IIC_SCL_Pin GPIO_PIN_10
#define IIC_SCL_GPIO_Port GPIOB
#define IIC_SDA_Pin GPIO_PIN_11
#define IIC_SDA_GPIO_Port GPIOB
#define LED_R_Pin GPIO_PIN_12
#define LED_R_GPIO_Port GPIOB
#define LED_G_Pin GPIO_PIN_13
#define LED_G_GPIO_Port GPIOB
#define RS485_RD_Pin GPIO_PIN_11
#define RS485_RD_GPIO_Port GPIOA
#define BootLED_Pin GPIO_PIN_15
#define BootLED_GPIO_Port GPIOA
#define FDC_SLEEP2_Pin GPIO_PIN_5
#define FDC_SLEEP2_GPIO_Port GPIOB
#define IIC_SCL2_Pin GPIO_PIN_6
#define IIC_SCL2_GPIO_Port GPIOB
#define IIC_SDA2_Pin GPIO_PIN_7
#define IIC_SDA2_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
