123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- /* USER CODE BEGIN Header */
- /**
- ******************************************************************************
- * @file adc.h
- * @brief This file contains all the function prototypes for
- * the adc.c file
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2022 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;
- extern ADC_HandleTypeDef hadc2;
- extern ADC_HandleTypeDef hadc3;
- /* USER CODE BEGIN Private defines */
- #define ADC1_CHANEL_COUNT 9
- #define ADC1_SAMPLE_COUNT 100
- #define ADC2_CHANEL_COUNT 3
- #define ADC2_SAMPLE_COUNT 255
- #define ADC3_CHANEL_COUNT 3
- #define ADC3_SAMPLE_COUNT 100
- #define LIMIT_MOVE_FILTER 9
- //#define CURRENT_LIMIT_MOVE_FILTER 4
- //#define VOLTAGE_LIMIT_MOVE_FILTER 8
- typedef struct{
- uint16_t idx_put;
- uint32_t buffer[LIMIT_MOVE_FILTER];
- uint32_t value;
- }ADC_MOVE_AVG_FILTER;
- /* USER CODE END Private defines */
- void MX_ADC1_Init(void);
- void MX_ADC2_Init(void);
- void MX_ADC3_Init(void);
- /* USER CODE BEGIN Prototypes */
- extern uint8_t adc_filter_move_avg(ADC_MOVE_AVG_FILTER *data, uint32_t value);
- extern uint32_t ADC1_Buf[ADC1_CHANEL_COUNT*ADC1_SAMPLE_COUNT], ADC1_Value[ADC1_CHANEL_COUNT];
- extern uint32_t ADC2_Buf[ADC2_CHANEL_COUNT*ADC2_SAMPLE_COUNT], ADC2_Value[ADC2_CHANEL_COUNT];
- extern uint32_t ADC3_Buf[ADC3_CHANEL_COUNT*ADC3_SAMPLE_COUNT] , ADC3_Value[ADC3_CHANEL_COUNT];
- extern uint32_t L1_ADC_Each_Value[ADC2_SAMPLE_COUNT];
- extern uint32_t L2_ADC_Each_Value[ADC2_SAMPLE_COUNT];
- extern uint32_t L3_ADC_Each_Value[ADC2_SAMPLE_COUNT];
- extern uint8_t bADC1_Done;
- extern uint8_t bADC2_Done;
- extern uint8_t bADC3_Done;
- struct ADC_VALUE{
- ADC_MOVE_AVG_FILTER ADC1_IN0;
- ADC_MOVE_AVG_FILTER ADC1_IN1;
- ADC_MOVE_AVG_FILTER ADC1_IN2;
- ADC_MOVE_AVG_FILTER ADC1_IN3;
- ADC_MOVE_AVG_FILTER ADC1_IN4;
- ADC_MOVE_AVG_FILTER ADC1_IN5;
- ADC_MOVE_AVG_FILTER ADC1_IN6;
- ADC_MOVE_AVG_FILTER ADC1_IN7;
- ADC_MOVE_AVG_FILTER ADC1_IN8;
- ADC_MOVE_AVG_FILTER ADC2_IN0;
- ADC_MOVE_AVG_FILTER ADC2_IN1;
- ADC_MOVE_AVG_FILTER ADC2_IN2;
-
- ADC_MOVE_AVG_FILTER ADC3_IN8;
- };
- extern struct ADC_VALUE adc_value;
- /* USER CODE END Prototypes */
- #ifdef __cplusplus
- }
- #endif
- #endif /* __ADC_H__ */
|