implemented sweep and current steps processing. But not compiles
This commit is contained in:
101
Core/Inc/main.h
101
Core/Inc/main.h
@ -30,59 +30,74 @@ extern "C" {
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
void Error_Handler(void);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
#define LED_RED_Pin GPIO_PIN_14
|
||||
#define LED_RED_GPIO_Port GPIOB
|
||||
#define LED_BLUE_Pin GPIO_PIN_7
|
||||
#define LED_BLUE_GPIO_Port GPIOB
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
/* Shared ADC app types and declarations */
|
||||
|
||||
/* Size of circular DMA buffer for ADC1 */
|
||||
#ifndef ADC_BUFF_SIZE
|
||||
#define ADC_BUFF_SIZE 100
|
||||
#endif
|
||||
|
||||
/* Structure describing simple accumulation state for ADC processing */
|
||||
struct ADC_proc {
|
||||
uint8_t status; /* 0 - stopped, 1 - collecting, 2 - filled */
|
||||
uint32_t sum;
|
||||
uint32_t avg;
|
||||
uint32_t N;
|
||||
};
|
||||
|
||||
/* Externs provided by main.c */
|
||||
extern struct ADC_proc adc_process;
|
||||
extern uint16_t ADC1_buff_circular[ADC_BUFF_SIZE];
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
#define CURR_STEP_START_TRG_Pin GPIO_PIN_0
|
||||
#define CURR_STEP_START_TRG_GPIO_Port GPIOC
|
||||
#define CURR_STEP_START_TRG_EXTI_IRQn EXTI0_IRQn
|
||||
#define SWEEP_CYCLE_START_TRG_Pin GPIO_PIN_1
|
||||
#define SWEEP_CYCLE_START_TRG_GPIO_Port GPIOC
|
||||
#define SWEEP_CYCLE_START_TRG_EXTI_IRQn EXTI1_IRQn
|
||||
#define LED_RED_Pin GPIO_PIN_14
|
||||
#define LED_RED_GPIO_Port GPIOB
|
||||
#define LED_BLUE_Pin GPIO_PIN_7
|
||||
#define LED_BLUE_GPIO_Port GPIOB
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
/* Shared ADC app types and declarations */
|
||||
|
||||
/* Size of circular DMA buffer for ADC1 */
|
||||
#ifndef ADC_BUFF_SIZE
|
||||
#define ADC_BUFF_SIZE 100
|
||||
#endif
|
||||
|
||||
/* Structure describing simple accumulation state for ADC processing */
|
||||
struct ADC_proc_typedef {
|
||||
uint8_t status; /* 0 - stopped, 1 - collecting, 2 - filled */
|
||||
uint32_t sum;
|
||||
uint32_t avg;
|
||||
uint32_t N;
|
||||
};
|
||||
|
||||
uint32_t curr_step_start_N = 0;
|
||||
|
||||
struct Sweep_state_typedef {
|
||||
uint32_t curr_step_N;
|
||||
uint8_t curr_step_started_flag; //0 -- not started or waiting for; 1 -- first 1/2 DMA buff; 2 -- second 1/2 DMA buff
|
||||
uint32_t curr_step_start_DMA_N;
|
||||
|
||||
};
|
||||
|
||||
/* Externs provided by main.c */
|
||||
extern struct ADC_proc adc_process;
|
||||
extern uint16_t ADC1_buff_circular[ADC_BUFF_SIZE];
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user