MAV'RIC
servos_default_config.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file servos.h
34  *
35  * \author MAV'RIC Team
36  * \author Julien Lecoeur
37  *
38  * \brief Default configuration for servos
39  *
40  ******************************************************************************/
41 
42 
43 #ifndef SERVOS_DEFAULT_CONFIG_H_
44 #define SERVOS_DEFAULT_CONFIG_H_
45 
46 #ifdef __cplusplus
47  extern "C" {
48 #endif
49 
50 #include "servos.h"
51 
52 
53 static const servo_entry_t servo_entry_default_standard =
54 {
55  .value = 0.0f,
56  .trim = 0.0f,
57  .min = -1.0f,
58  .max = 1.0f,
59  .failsafe = 0.0f,
60  .repeat_freq = 50,
61 };
62 
63 
64 static const servo_entry_t servo_entry_default_esc =
65 {
66  .value = 0.0f,
67  .trim = 0.0f,
68  .min = -0.9f,
69  .max = 1.0f,
70  .failsafe = -1.0f,
71  .repeat_freq = 200,
72 };
73 
74 
75 static const servo_entry_t servo_entry_default_custom =
76 {
77  .value = 0.0f,
78  .trim = 0.0f,
79  .min = -0.0f,
80  .max = 0.0f,
81  .failsafe = 0.0f,
82  .repeat_freq = 50,
83 };
84 
85 servos_conf_t servos_default_config =
86 {
87  .servos_count = 4,
88  .servo =
89  {
90  { //servo_entry_default_esc
91  .value = 0.0f,
92  .trim = 0.0f,
93  .min = -0.9f,
94  .max = 1.0f,
95  .failsafe = -1.1f,
96  .repeat_freq = 200,
97  },
98  { //servo_entry_default_esc
99  .value = 0.0f,
100  .trim = 0.0f,
101  .min = -0.9f,
102  .max = 1.0f,
103  .failsafe = -1.1f,
104  .repeat_freq = 200,
105  },
106  { //servo_entry_default_esc
107  .value = 0.0f,
108  .trim = 0.0f,
109  .min = -0.9f,
110  .max = 1.0f,
111  .failsafe = -1.1f,
112  .repeat_freq = 200,
113  },
114  { //servo_entry_default_esc
115  .value = 0.0f,
116  .trim = 0.0f,
117  .min = -0.9f,
118  .max = 1.0f,
119  .failsafe = -1.1f,
120  .repeat_freq = 200,
121  }
122  },
123 };
124 
125 
126 #ifdef __cplusplus
127  }
128 #endif
129 
130 #endif
Define the servos entry structure.
Definition: servos.h:60
Define the configuration servos structure.
Definition: servos.h:73
float value
Normalized value of the servo (between -1 and 1)
Definition: servos.h:62
uint32_t servos_count
Servos counter.
Definition: servos.h:75