diff --git a/Project/applications/smartcities/adc.c b/Project/applications/smartcities/adc.c index 09ad976..dda4f8a 100644 --- a/Project/applications/smartcities/adc.c +++ b/Project/applications/smartcities/adc.c @@ -1,5 +1,9 @@ /**@file - * @brief THE GAME + * @brief Definitions for the ADC functionality + * @author Imanol Barba Sabariego + * @date 07/06/2014 + * + * This is where all the methods previously declared in adc.h are defined. */ #include "adc.h" diff --git a/Project/applications/smartcities/include/adc.h b/Project/applications/smartcities/include/adc.h index b95decf..22d7a9f 100644 --- a/Project/applications/smartcities/include/adc.h +++ b/Project/applications/smartcities/include/adc.h @@ -1,3 +1,12 @@ + +/**@file + * @brief Declaration for the ADC functionality + * @author Imanol Barba Sabariego + * @date 07/06/2014 + * + * This is where all the methods previously declared in adc.h are defined. + */ + #ifndef ADC_H #define ADC_H @@ -7,18 +16,29 @@ #include "stm32f10x_gpio.h" #include "stm32f10x_adc.h" +//! Debug printing definition +/*! This definition is used for debugging purposes, it is a shorthand for printing debug information */ #define DBG_ADC(fmt,...) printf("%c[1;35madc.c:%c[1;00m "fmt,0x1B,0x1B, ##__VA_ARGS__) //#define DBG_ADC(fmt,...) printf("") +//! Minimum battery ADC digital value #define ADCbatt_MIN_VALUE (0) +//! Maximum battery ADC digital value #define ADCbatt_MAX_VALUE (0xfff) +//! Maximum battery ADC analog value #define ADCbatt_VREF_PLUS (3300) +//! Minimum battery ADC analog value #define ADCbatt_VREF_MINUS (0) +//! Minimum sound ADC digital value #define ADCsound_MIN_VALUE (0) -#define ADCsound_MAX_VALUE (0xfff) /* 12-bit adc */ -#define ADCsound_VREF_PLUS (2800) /* Vref+ is connected with Vdda (3.3v) */ -#define ADCsound_VREF_MINUS (0) /* Vref- is connected with Vssa (0v) */ +//! Maximum sound ADC digital value +#define ADCsound_MAX_VALUE (0xfff) +//! Maximum sound ADC analog value +#define ADCsound_VREF_PLUS (3300) +//! Minimum sound ADC analog value +#define ADCsound_VREF_MINUS (0) + #define ADCbatt ADC1 #define ADCbatt_RCC RCC_APB2Periph_ADC1 /* */