X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fadc.h;h=acc0786c9793d9a733a3dc1c8e831ed3d9a96460;hb=2053cc3e6aa26c20a8511ad7148dd704b8e0891e;hp=91f1ebd68d7f5ace94725300d0beec24b07c8066;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/drv/adc.h b/bertos/drv/adc.h index 91f1ebd6..acc0786c 100644 --- a/bertos/drv/adc.h +++ b/bertos/drv/adc.h @@ -30,12 +30,18 @@ * * --> * - * \version $Id$ + * \defgroup adc Generic ADC driver + * \ingroup drivers + * \{ + * \brief Analog to Digital Converter driver (ADC). * - * \brief ADC driver (interface) + * Configuration file: cfg_adc.h * - * \version $Id$ * \author Francesco Sacchi + * + * $WIZ$ module_name = "adc" + * $WIZ$ module_configuration = "bertos/cfg/cfg_adc.h" + * $WIZ$ module_supports = "not atmega103" */ @@ -64,6 +70,7 @@ void adc_init(void); * \note \a y1, \a y2 can be negative, and put in ascending or descending order as well. * \note \a data and \a y2 are evaluated only once, \a y1 twice. */ -#define ADC_RANGECONV(data, y1, y2) ((((data) * ((y2) - (y1))) / ((1 << ADC_BITS) - 1)) + (y1)) +#define ADC_RANGECONV(data, y1, y2) (((((int32_t)(data)) * ((y2) - (y1))) / ((1 << ADC_BITS) - 1)) + (y1)) +/** \} */ //defgroup adc #endif /* DRV_ADC_H */