Files
CPY_AuxiliaryControlBoard/Core/Inc/main.h
T
2026-09-01 14:09:31 +08:00

116 lines
3.3 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 "stm32h7xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "stdint.h"
#include "string.h"
/* 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 */
#define VERSION_STR "V1.1.0"
#ifdef BOOTLOADER
#define SW_VER "BL for " VERSION_STR
#else
#define SW_VER VERSION_STR
#endif
/* USER CODE END EM */
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define LED_Pin GPIO_PIN_2
#define LED_GPIO_Port GPIOE
#define WORK_CMD_Pin GPIO_PIN_3
#define WORK_CMD_GPIO_Port GPIOE
#define I_FILA_Pin GPIO_PIN_5
#define I_FILA_GPIO_Port GPIOC
#define V_FILA_Pin GPIO_PIN_0
#define V_FILA_GPIO_Port GPIOB
#define I_XRAY_Pin GPIO_PIN_1
#define I_XRAY_GPIO_Port GPIOB
#define WDI_Pin GPIO_PIN_10
#define WDI_GPIO_Port GPIOB
#define WDO_Pin GPIO_PIN_11
#define WDO_GPIO_Port GPIOB
#define FLASH_CS_Pin GPIO_PIN_6
#define FLASH_CS_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
#define ADC_CHNL_NUM 3
#define DEBUG 1
#if DEBUG
#define debug(fmt, args...) printf(fmt"\r\n", ##args)
#define dump(buf, len) do { int __i = 0; /*printf("\xAA\xAA");*/ for (__i = 0; __i < (len); __i++) {printf("%02X ", ((uint8_t *)(buf))[__i]);} printf("\r\n"); } while (0)
#define assert(err,fmt, args...) if (!(err)) do {printf("\xAA\xAA"); printf(fmt"\r\n", ##args); while(1);} while (0)
#define func_enter() printf("enter %s\r\n", __func__)
#define func_exit() printf("exit %s\r\n", __func__)
#else
#define dump(buf, len)
#define debug(args...)
#define assert(args...)
#define func_enter()
#define func_exit()
#endif
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */