/* * system_variables.h * * Created on: 15 sep. 2016 * Author: Philip */ #ifndef SYSTEM_VARIABLES_H_ #define SYSTEM_VARIABLES_H_ #define ADC_STATE_POLL AS_DMA #define ADC_STATE #include "stm32f4xx.h" enum ADC_STATES { AS_POLL, AS_IRQ, AS_DMA }; /* A buffer for the ADC to write with DMA */ enum{ ADC_BUFFER_LENGTH = 9 }; extern volatile uint32_t g_ADCBuffer[ADC_BUFFER_LENGTH]; /* Defining boolean - false = 0, true = 1 */ enum BOOLEAN { false,true }; /* Counter of ADC readings */ extern int g_MeasurementNumber; /* ADC Rank - For each IO we increment the rank?? */ extern int adc_rank; /* Last ADC reading (when polling) */ extern __IO uint32_t g_ADCValue; /* ADC handler - OBS: Tried to use this as a pointer but it did not work */ extern ADC_HandleTypeDef g_AdcHandle; /* DMA handler */ extern DMA_HandleTypeDef g_DmaHandle; #endif /* SYSTEM_VARIABLES_H_ */