Remove CVS logs. Write convert macro for adc module.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 16 Jan 2008 16:40:57 +0000 (16:40 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 16 Jan 2008 16:40:57 +0000 (16:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1052 38d2e660-2303-0410-9eaa-f027e97ec537

drv/adc.h
drv/eeprom.h
drv/kbd.c
drv/kbd.h
drv/pwm.c
drv/pwm.h

index b1e587ed3e8fb9de000a8bb569d9d27b0d662d00..91f1ebd68d7f5ace94725300d0beec24b07c8066 100644 (file)
--- a/drv/adc.h
+++ b/drv/adc.h
  * \author Francesco Sacchi <batt@develer.com>
  */
 
-/*#*
- *#* $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 <hw_adc.h>
 #include <cfg/compiler.h>
 #include <cfg/debug.h>
+#include <cpu/attr.h>
+#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 */
index e23cd138371da8bda3a624a5fc7061cd041bfb2c..5e3f78a280aa090c580ae1ba8667ebca827a4042 100644 (file)
  * \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
 
index e235737a0acfe8e25365261cc436e4c0db75930d..f54ebf91f06ebf9a2b66f334d950fdcaa1961805 100644 (file)
--- a/drv/kbd.c
+++ b/drv/kbd.c
  * \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 <hw_kbd.h>
 
 #include <drv/timer.h>
index 801b77a1978067bb67c03c0abc47e074dd959c3d..c1904716bb9e7190da20f35f9dbeea04cf0bb371 100644 (file)
--- a/drv/kbd.h
+++ b/drv/kbd.h
  * \author Francesco Sacchi <batt@develer.com>
  */
 
-/*#*
- *#* $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
 
index 7cc36876ee7d59e8193a2beef3e51f4cebbb6d70..6a44e33c565de73a64975ddd7f52cd8fe641e186 100644 (file)
--- a/drv/pwm.c
+++ b/drv/pwm.c
  * \author Francesco Sacchi <batt@develer.com>
  */
 
-/*#*
- *#* $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 <hw_pwm.h>
 #include <drv/pwm.h>
 #include <cfg/macros.h>
index 30f5b4d4408edf1f838467135b080c7a6c2a32d9..03d98453499af5f23a6fb4643a414acfefebc1b9 100644 (file)
--- a/drv/pwm.h
+++ b/drv/pwm.h
  * \author Francesco Sacchi <batt@develer.com>
  */
 
-/*#*
- *#* $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