From: batt Date: Fri, 17 Apr 2009 17:07:09 +0000 (+0000) Subject: Fix ADC configurations. X-Git-Tag: 2.1.0~130 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=70a451db3b503f9984d31e247400fb0dd810e691;p=bertos.git Fix ADC configurations. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2552 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cfg/cfg_adc.h b/bertos/cfg/cfg_adc.h index 0931b8c4..6172d032 100644 --- a/bertos/cfg/cfg_adc.h +++ b/bertos/cfg/cfg_adc.h @@ -30,7 +30,7 @@ * * --> * - * \brief Configuration file for ADC module. + * \brief Configuration file for the ADC module. * * \version $Id$ * \author Daniele Basile @@ -48,7 +48,7 @@ #define ADC_LOG_LEVEL LOG_LVL_INFO /** - * module logging format. + * Module logging format. * * $WIZ$ type = "enum" * $WIZ$ value_list = "log_format" @@ -56,41 +56,52 @@ #define ADC_LOG_FORMAT LOG_FMT_VERBOSE /** - * Frequency clock for ADC conversion. + * Clock Frequency for ADC conversion. * * $WIZ$ type = "int" + * $WIZ$ supports = "at91" */ #define CONFIG_ADC_CLOCK 4800000UL /** - * Minimum time for startup a conversion in micro second. + * Minimum time for starting up a conversion [us]. * * $WIZ$ type = "int" + * $WIZ$ min = "0" + * $WIZ$ supports = "at91" */ #define CONFIG_ADC_STARTUP_TIME 20 /** - * Minimum time for sample and hold in nano second. + * Minimum time for sample and hold [us]. * * $WIZ$ type = "int" + * $WIZ$ min = "0" + * $WIZ$ supports = "at91" */ #define CONFIG_ADC_SHTIME 834 /** - * ADC setting for AVR target. + * ADC Voltage Reference. * - * $WIZ$ type = "int" + * $WIZ$ type = "enum" + * $WIZ$ value_list = "avr_adc_refs" + * $WIZ$ supports = "avr" */ -#define CONFIG_ADC_AVR_REF 1 -/* - * ADC setting for AVR target. +#define CONFIG_ADC_AVR_REF ADC_AVR_AVCC + +/** + * ADC clock divisor from main crystal. * * $WIZ$ type = "int" + * $WIZ$ min = "2" + * $WIZ$ max = "128" + * $WIZ$ supports = "avr" */ #define CONFIG_ADC_AVR_DIVISOR 2 /** - * Enable ADS strobe. + * Enable ADC strobe for debugging ADC ISR. * * $WIZ$ type = "boolean" */ diff --git a/bertos/cpu/avr/drv/adc_avr.c b/bertos/cpu/avr/drv/adc_avr.c index 8c3217e7..2ba5982f 100644 --- a/bertos/cpu/avr/drv/adc_avr.c +++ b/bertos/cpu/avr/drv/adc_avr.c @@ -37,6 +37,8 @@ * This module is automatically included so no need to include * in test list. * notest: avr + * + * $WIZ$ */ #include "adc_avr.h" @@ -54,9 +56,16 @@ #include #include +/** + * ADC voltage referencese. + * + * $WIZ$ avr_adc_refs = "ADC_AVR_AREF", "ADC_AVR_AVCC", "ADC_AVR_INT256" + * \{ + */ #define ADC_AVR_AREF 0 #define ADC_AVR_AVCC 1 #define ADC_AVR_INT256 2 +/* \} */ #if CONFIG_KERN #include @@ -65,7 +74,7 @@ #if !CONFIG_KERN_SIGNALS - #error Signals must be active to use ADC with kernel + #error Signals must be active to use the ADC with kernel #endif /* Signal adc convertion end */