26254a41573899b5b6834a8829e81b8566172514
[bertos.git] / bertos / cfg / cfg_adc.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2008 Develer S.r.l. (http://www.develer.com/)
30  * All Rights Reserved.
31  * -->
32  *
33  * \brief Configuration file for ADC module.
34  *
35  * \version $Id$
36  *
37  * \author Daniele Basile <asterix@develer.com>
38  */
39
40 #ifndef CFG_ADC_H
41 #define CFG_ADC_H
42
43 /**
44  * Logging level definition.
45  *
46  * Use 0 to log only the error messages
47  * Use 1 to log the error and warning messages
48  * Use 2 to log all messages
49  */
50 #define ADC_LOG_LEVEL      2
51
52 /**
53  * Set logging verbosity.
54  *
55  * If verbosity is zero print short log messages.
56  */
57 #define ADC_LOG_VERBOSITY    1
58
59
60 /**
61  * ADC timing setting parameter
62  *
63  * - CONFIG_ADC_CLOCK is frequency clock for ADC conversion.
64  * - CONFIG_ADC_STARTUP_TIME  minimum time for startup a conversion in micro second.
65  * - CONFIG_ADC_SHTIME minimum time for sample and hold in nano second.
66  * \{
67  */
68 #define CONFIG_ADC_CLOCK          4800000UL
69 #define CONFIG_ADC_STARTUP_TIME        20
70 #define CONFIG_ADC_SHTIME             834
71 /* \ * } */
72
73 /// ADC setting for AVR target
74 #define CONFIG_ADC_AVR_REF      1
75 #define CONFIG_ADC_AVR_DIVISOR  2
76
77 /// Enable ADS strobe.
78 #define CONFIG_ADC_STROBE  0
79
80 #endif /* CFG_ADC_H */
81