adc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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) 2026 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. #define ADC_CH 5
  30. typedef struct
  31. {
  32. float Spray1_I; //ÅçÍ·1µçÁ÷ A
  33. float Spray2_I; //ÅçÍ·2µçÁ÷ A
  34. float Temp; //ÎÂ¶È ¡ãC
  35. float BatVol; //µçѹ V
  36. }_adcData;
  37. extern uint16_t adcBuf[ADC_CH];
  38. /* USER CODE END Includes */
  39. extern ADC_HandleTypeDef hadc1;
  40. /* USER CODE BEGIN Private defines */
  41. /* USER CODE END Private defines */
  42. void MX_ADC1_Init(void);
  43. /* USER CODE BEGIN Prototypes */
  44. extern void MY_ADC_INIT(void);
  45. /* USER CODE END Prototypes */
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* __ADC_H__ */