Line data Source code
1 : /*
2 : This program is free software: you can redistribute it and/or modify
3 : it under the terms of the GNU General Public License as published by
4 : the Free Software Foundation, either version 3 of the License, or
5 : (at your option) any later version.
6 :
7 : This program is distributed in the hope that it will be useful,
8 : but WITHOUT ANY WARRANTY; without even the implied warranty of
9 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 : GNU General Public License for more details.
11 :
12 : You should have received a copy of the GNU General Public License
13 : along with this program. If not, see <http://www.gnu.org/licenses/>.
14 : */
15 :
16 : #include <AP_RPM/AP_RPM_Params.h>
17 :
18 : // table of user settable parameters
19 : const AP_Param::GroupInfo AP_RPM_Params::var_info[] = {
20 : // @Param: TYPE
21 : // @DisplayName: RPM type
22 : // @Description: What type of RPM sensor is connected
23 : // @RebootRequired: True
24 : // @Values: 0:None,1:Not Used,2:GPIO,3:EFI,4:Harmonic Notch,5:ESC Telemetry Motors Bitmask,6:Generator,7:DroneCAN
25 : // @User: Standard
26 : AP_GROUPINFO_FLAGS("TYPE", 1, AP_RPM_Params, type, 0, AP_PARAM_FLAG_ENABLE),
27 : // Note, 1 was previously for type = PWM. This has been removed from docs to make setup less confusing for users.
28 : // However, 1 is reserved as it does still fallthrough to type = GPIO.
29 :
30 : // @Param: SCALING
31 : // @DisplayName: RPM scaling
32 : // @Description: Scaling factor between sensor reading and RPM.
33 : // @Increment: 0.001
34 : // @User: Standard
35 : AP_GROUPINFO("SCALING", 2, AP_RPM_Params, scaling, 1.0f),
36 :
37 : // @Param: MAX
38 : // @DisplayName: Maximum RPM
39 : // @Description: Maximum RPM to report. Only used on type = GPIO.
40 : // @Increment: 1
41 : // @User: Standard
42 : AP_GROUPINFO("MAX", 3, AP_RPM_Params, maximum, 100000),
43 :
44 : // @Param: MIN
45 : // @DisplayName: Minimum RPM
46 : // @Description: Minimum RPM to report. Only used on type = GPIO.
47 : // @Increment: 1
48 : // @User: Standard
49 : AP_GROUPINFO("MIN", 4, AP_RPM_Params, minimum, 10),
50 :
51 : // @Param: MIN_QUAL
52 : // @DisplayName: Minimum Quality
53 : // @Description: Minimum data quality to be used
54 : // @Increment: 0.1
55 : // @User: Advanced
56 : AP_GROUPINFO("MIN_QUAL", 5, AP_RPM_Params, quality_min, 0.5),
57 :
58 : // @Param: PIN
59 : // @DisplayName: Input pin number
60 : // @Description: Which digital GPIO pin to use. Only used on type = GPIO. Some common values are given, but see the Wiki's "GPIOs" page for how to determine the pin number for a given autopilot.
61 : // @Values: -1:Disabled,50:AUX1,51:AUX2,52:AUX3,53:AUX4,54:AUX5,55:AUX6
62 : // @Range: -1 127
63 : // @User: Standard
64 : AP_GROUPINFO("PIN", 6, AP_RPM_Params, pin, -1),
65 :
66 : // @Param: ESC_MASK
67 : // @DisplayName: Bitmask of ESC telemetry channels to average
68 : // @Description: Mask of channels which support ESC rpm telemetry. RPM telemetry of the selected channels will be averaged
69 : // @Bitmask: 0:Channel1,1:Channel2,2:Channel3,3:Channel4,4:Channel5,5:Channel6,6:Channel7,7:Channel8,8:Channel9,9:Channel10,10:Channel11,11:Channel12,12:Channel13,13:Channel14,14:Channel15,15:Channel16
70 : // @User: Advanced
71 : AP_GROUPINFO("ESC_MASK", 7, AP_RPM_Params, esc_mask, 0),
72 :
73 : #if AP_RPM_ESC_TELEM_OUTBOUND_ENABLED
74 : // @Param: ESC_INDEX
75 : // @DisplayName: ESC Telemetry Index to write RPM to
76 : // @Description: ESC Telemetry Index to write RPM to. Use 0 to disable.
77 : // @Range: 0 10
78 : // @Increment: 1
79 : // @User: Advanced
80 : AP_GROUPINFO("ESC_INDEX", 8, AP_RPM_Params, esc_telem_outbound_index, 0),
81 : #endif
82 :
83 : #if AP_RPM_DRONECAN_ENABLED || AP_RPM_STREAM_ENABLED
84 : // @Param: DC_ID
85 : // @DisplayName: DroneCAN Sensor ID
86 : // @Description: DroneCAN sensor ID to assign to this backend
87 : // @Description{AP_Periph}: DroneCAN sensor ID to send as on AP-Periph -1 disables
88 : // @Range: -1 10
89 : // @Increment: 1
90 : // @User: Advanced
91 : AP_GROUPINFO("DC_ID", 9, AP_RPM_Params, dronecan_sensor_id, -1),
92 : #endif
93 :
94 : AP_GROUPEND
95 : };
96 :
97 4196 : AP_RPM_Params::AP_RPM_Params(void)
98 : {
99 4196 : AP_Param::setup_object_defaults(this, var_info);
100 4196 : }
|