/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file adc.h * @brief This file contains all the function prototypes for * the adc.c file ****************************************************************************** * @attention * * Copyright (c) 2026 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 __ADC_H__ #define __ADC_H__ #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ extern ADC_HandleTypeDef hadc1; /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void MX_ADC1_Init(void); /* USER CODE BEGIN Prototypes */ /* ADC1 上电自校准(RM0090 §13.3.6;本仓库 HAL 无 HAL_ADCEx_Calibration_Start, * 实现见 Src/adc.c 的 USER CODE BEGIN 1)。返回 0 = 完成,-1 = 等待超时 */ int adc1_calibrate(void); /* ADC1 关闭(清 ADON 并等其生效)。实现见 Src/adc.c 的 USER CODE BEGIN 1。 * **必须在挂 DMA 之前调用**:把"使能 ADC"推迟到 HAL_ADC_Start_DMA 内部完成, * 使能与搬运之间不留可观测间隔。返回 0 = 已关闭,-1 = 等待超时。 * 动机与台架证据见 docs/子系统设计/ADC采样节拍设计说明.md §4.5(DMA 缓冲 +2 格旋转)。 */ int adc1_disable(void); /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __ADC_H__ */