Remove the long and the unsigned fields from the int parameter definitions
[bertos.git] / bertos / cfg / cfg_ramp.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  *
31  * -->
32  *
33  * \brief Configuration file Ramp algorithm module.
34  *
35  * \version $Id$
36  * \author Daniele Basile <asterix@develer.com>
37  */
38
39 #ifndef CFG_RAMP_H
40 #define CFG_RAMP_H
41
42 /**
43  * Define whether the ramp will use floating point calculation within ramp_evaluate().
44  * Otherwise, a less precise fixed point version will be used, which is faster on
45  * platforms which do no support floating point operations.
46  *
47  * \note Floating point operations will be always done within ramp_compute() to
48  * precalculate values, so there has to be at least a floating point emulation support.
49  *
50  * $WIZARD = { "type" : "boolean" }
51  */
52 #define RAMP_USE_FLOATING_POINT   0
53
54
55 #if !RAMP_USE_FLOATING_POINT
56
57         /**
58          * Number of least-significant bits which are stripped away during ramp evaluation.
59          * This setting allows to specify larger ramps at the price of less precision.
60          *
61          * The maximum ramp size allowed is 2^(24 + RAMP_CLOCK_SHIFT_PRECISION), in clocks.
62          * For instance, using RAMP_CLOCK_SHIFT_PRECISION 1, and a 8x prescaler, the maximum
63          * length of a ramp is about 6.7 secs. Raising RAMP_CLOCK_SHIFT_PRECISION to 2
64          * brings the maximum length to 13.4 secs, at the price of less precision.
65          *
66          * ramp_compute() will check that the length is below the maximum allowed through
67          * a runtime assertion.
68          *
69          * \note This macro is used only for the fixed-point version of the ramp.
70          * $WIZARD = { "type" : "int", "min" : "0", "max" : "32" }
71          */
72         #define RAMP_CLOCK_SHIFT_PRECISION 2
73 #endif
74
75
76 ///< Negative pulse width for ramp. $WIZARD = { "type" : "int", "min" : "0" }
77 #define RAMP_PULSE_WIDTH    50
78
79  /*
80   * Default ramp
81   */
82 #define RAMP_DEF_TIME     6000000UL ///< microsecs.                $WIZARD = { "type" : "int" }
83 #define RAMP_DEF_MAXFREQ       5000 ///< Hz.                       $WIZARD = { "type" : "int", "min" : "0" }
84 #define RAMP_DEF_MINFREQ        200 ///< Hz.                       $WIZARD = { "type" : "int", "min" : "0" }
85 #define RAMP_DEF_POWERRUN        10 ///< 10 deciampere (1 ampere). $WIZARD = { "type" : "int", "min" : "0" }
86 #define RAMP_DEF_POWERIDLE        1 ///< 1 deciampere.             $WIZARD = { "type" : "int", "min" : "0" }
87
88 #endif /* CFG_RAMP_H */