* \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 */
* \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
* \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>
* \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
* \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>
* \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