Add handy functions for handling non recurrent timeouts.
[bertos.git] / bertos / drv / adc.h
index 91f1ebd68d7f5ace94725300d0beec24b07c8066..acc0786c9793d9a733a3dc1c8e831ed3d9a96460 100644 (file)
  *
  * -->
  *
- * \version $Id$
+ * \defgroup adc Generic ADC driver
+ * \ingroup drivers
+ * \{
+ * \brief Analog to Digital Converter driver (ADC).
  *
- * \brief ADC driver (interface)
+ * <b>Configuration file</b>: cfg_adc.h
  *
- * \version $Id$
  * \author Francesco Sacchi <batt@develer.com>
+ *
+ * $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 */