adc.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file adc.h
  5. * @brief This file contains all the function prototypes for
  6. * the adc.c file
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2023 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __ADC_H__
  22. #define __ADC_H__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "main.h"
  28. /* USER CODE BEGIN Includes */
  29. #include "math.h"
  30. /* USER CODE END Includes */
  31. extern ADC_HandleTypeDef hadc1;
  32. /* USER CODE BEGIN Private defines */
  33. extern uint8_t adc1_byte1 ;
  34. extern uint8_t adc2_byte1 ; // 定义一个字节变量用于存储转换结果
  35. extern uint8_t adc3_byte1 ;
  36. extern uint8_t adc1_byte2 ;
  37. extern uint8_t adc2_byte2 ; // 定义一个字节变量用于存储转换结果
  38. extern uint8_t adc3_byte2 ;
  39. extern uint16_t adc1_filtered;
  40. extern uint16_t adc2_filtered;
  41. extern uint16_t adc3_filtered;
  42. extern uint16_t Value_old_addr2;
  43. extern uint16_t Value_old_addr3;
  44. extern uint16_t adc2_rawValue;
  45. extern uint16_t adc3_rawValue;
  46. /* USER CODE END Private defines */
  47. void MX_ADC1_Init(void);
  48. /* USER CODE BEGIN Prototypes */
  49. void AdcCalibration_init(void);
  50. void GetADCResults(ADC_HandleTypeDef* hadc);
  51. /* USER CODE END Prototypes */
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #endif /* __ADC_H__ */