From 28327759b96b67aba709c50523ffce6d39de3072 Mon Sep 17 00:00:00 2001 From: Imanol-Mikel Barba Sabariego Date: Sat, 7 Jun 2014 18:57:58 +0000 Subject: [PATCH] --- Project/applications/smartcities/adc.c | 6 +++++- Project/applications/smartcities/include/adc.h | 26 +++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) 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 /* */ -- libgit2 0.22.2