From 56a07f2d54911b40c6f14e25a342e0a8742a6938 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 16 Jan 2008 16:40:57 +0000 Subject: [PATCH] Remove CVS logs. Write convert macro for adc module. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1052 38d2e660-2303-0410-9eaa-f027e97ec537 --- drv/adc.h | 28 ++++++++++++++-------------- drv/eeprom.h | 33 --------------------------------- drv/kbd.c | 31 ------------------------------- drv/kbd.h | 21 --------------------- drv/pwm.c | 28 ---------------------------- drv/pwm.h | 21 --------------------- 6 files changed, 14 insertions(+), 148 deletions(-) diff --git a/drv/adc.h b/drv/adc.h index b1e587ed..91f1ebd6 100644 --- a/drv/adc.h +++ b/drv/adc.h @@ -38,32 +38,32 @@ * \author Francesco Sacchi */ -/*#* - *#* $Log$ - *#* Revision 1.3 2006/09/20 17:32:46 marco - *#* Use MOD_* macros instead of DB. - *#* - *#* Revision 1.2 2006/07/19 12:56:25 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.1 2005/06/27 21:28:31 bernie - *#* Import ADC driver. - *#* - *#*/ #ifndef DRV_ADC_H #define DRV_ADC_H -#include #include #include +#include +#include CPU_HEADER(adc) /** Type for ADC return value. */ typedef uint16_t adcread_t; +/** Type for channel */ +typedef uint8_t adc_ch_t; + #define adc_bits() ADC_BITS -adcread_t adc_read(uint16_t ch); +adcread_t adc_read(adc_ch_t ch); void adc_init(void); +/** + * Macro used to convert data from adc range (0...(2 ^ADC_BITS - 1)) to + * \a y1 ... \a y2 range. + * \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)) + #endif /* DRV_ADC_H */ diff --git a/drv/eeprom.h b/drv/eeprom.h index e23cd138..5e3f78a2 100644 --- a/drv/eeprom.h +++ b/drv/eeprom.h @@ -38,39 +38,6 @@ * \brief Driver for the 24xx16 and 24xx256 I2C EEPROMS (interface) */ -/*#* - *#* $Log$ - *#* Revision 1.10 2006/09/13 18:29:54 bernie - *#* e2addr(): New macro. - *#* - *#* Revision 1.9 2006/07/19 12:56:25 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.8 2005/11/27 23:33:40 bernie - *#* Use appconfig.h instead of cfg/config.h. - *#* - *#* Revision 1.7 2005/11/04 16:20:02 bernie - *#* Fix reference to README.devlib in header. - *#* - *#* Revision 1.6 2005/04/11 19:10:27 bernie - *#* Include top-level headers from cfg/ subdir. - *#* - *#* Revision 1.5 2004/11/02 17:50:02 bernie - *#* CONFIG_EEPROM_VERIFY: New config option. - *#* - *#* Revision 1.4 2004/08/25 14:12:08 rasky - *#* Aggiornato il comment block dei log RCS - *#* - *#* Revision 1.3 2004/08/10 06:57:22 bernie - *#* eeprom_erase(): New function. - *#* - *#* Revision 1.2 2004/07/29 22:57:09 bernie - *#* Add 24LC16 support. - *#* - *#* Revision 1.1 2004/07/20 17:11:18 bernie - *#* Import into DevLib. - *#* - *#*/ #ifndef DRV_EEPROM_H #define DRV_EEPROM_H diff --git a/drv/kbd.c b/drv/kbd.c index e235737a..f54ebf91 100644 --- a/drv/kbd.c +++ b/drv/kbd.c @@ -40,37 +40,6 @@ * \brief Keyboard driver (implementation) */ -/*#* - *#* $Log$ - *#* Revision 1.9 2006/09/13 18:25:45 bernie - *#* Merge CONFIG_KBD_LONGPRESS. - *#* - *#* Revision 1.8 2006/07/19 12:56:25 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.7 2006/06/03 13:57:36 bernie - *#* Make keyboard repeat mask run-time configurable. - *#* - *#* Revision 1.6 2006/03/20 17:50:17 bernie - *#* Add FreeRTOS and Observers support. - *#* - *#* Revision 1.5 2006/02/27 22:39:45 bernie - *#* Misc build and doc fixes from project_grl. - *#* - *#* Revision 1.4 2006/02/24 00:27:14 bernie - *#* Use new naming convention for list macros. - *#* - *#* Revision 1.3 2006/02/17 21:15:42 bernie - *#* Add MOD_CHECK() checks. - *#* - *#* Revision 1.2 2006/02/10 12:36:20 bernie - *#* Add preliminary FreeRTOS support; Enforce CONFIG_* definitions. - *#* - *#* Revision 1.1 2005/06/27 21:28:45 bernie - *#* Import generic keyboard driver. - *#* - *#*/ - #include #include diff --git a/drv/kbd.h b/drv/kbd.h index 801b77a1..c1904716 100644 --- a/drv/kbd.h +++ b/drv/kbd.h @@ -39,27 +39,6 @@ * \author Francesco Sacchi */ -/*#* - *#* $Log$ - *#* Revision 1.6 2006/07/19 12:56:25 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.5 2006/06/03 13:57:36 bernie - *#* Make keyboard repeat mask run-time configurable. - *#* - *#* Revision 1.4 2006/03/20 17:50:17 bernie - *#* Add FreeRTOS and Observers support. - *#* - *#* Revision 1.3 2006/02/27 22:39:45 bernie - *#* Misc build and doc fixes from project_grl. - *#* - *#* Revision 1.2 2006/02/10 12:38:16 bernie - *#* Add preliminary FreeRTOS support; Enforce CONFIG_* definitions. - *#* - *#* Revision 1.1 2005/06/27 21:28:45 bernie - *#* Import generic keyboard driver. - *#* - *#*/ #ifndef DRV_KBD_H #define DRV_KBD_H diff --git a/drv/pwm.c b/drv/pwm.c index 7cc36876..6a44e33c 100644 --- a/drv/pwm.c +++ b/drv/pwm.c @@ -37,34 +37,6 @@ * \author Francesco Sacchi */ -/*#* - *#* $Log$ - *#* Revision 1.2 2006/07/19 12:56:26 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.1 2005/11/04 18:08:49 bernie - *#* Import into DevLib. - *#* - *#* Revision 1.2 2005/05/24 13:35:01 batt - *#* Add missing; reformat. - *#* - *#* Revision 1.1 2005/05/24 09:17:58 batt - *#* Move drivers to top-level. - *#* - *#* Revision 1.4 2005/05/09 16:36:12 batt - *#* Change some function names to accomplish coding standard. - *#* - *#* Revision 1.3 2005/05/02 16:35:47 batt - *#* Add some comments. - *#* - *#* Revision 1.2 2005/05/02 16:02:58 batt - *#* Remove unusefull interrupt saving. - *#* - *#* Revision 1.1 2005/05/02 12:36:39 batt - *#* Add pwm driver. - *#* - *#*/ - #include #include #include diff --git a/drv/pwm.h b/drv/pwm.h index 30f5b4d4..03d98453 100644 --- a/drv/pwm.h +++ b/drv/pwm.h @@ -37,27 +37,6 @@ * \author Francesco Sacchi */ -/*#* - *#* $Log$ - *#* Revision 1.2 2006/07/19 12:56:26 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.1 2005/11/04 18:08:49 bernie - *#* Import into DevLib. - *#* - *#* Revision 1.1 2005/05/24 09:17:58 batt - *#* Move drivers to top-level. - *#* - *#* Revision 1.3 2005/05/09 16:36:12 batt - *#* Change some function names to accomplish coding standard. - *#* - *#* Revision 1.2 2005/05/02 16:03:08 batt - *#* Remove unusefull interrupt saving. - *#* - *#* Revision 1.1 2005/05/02 12:36:39 batt - *#* Add pwm driver. - *#* - *#*/ #ifndef DRV_PWM_H #define DRV_PWM_H -- 2.25.1