2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
25 #include "drivers/io.h"
26 #include "drivers/dshot_bitbang.h"
29 DSHOT_BITBANGED_TIMER_AUTO
= 0,
30 DSHOT_BITBANGED_TIMER_TIM1
,
31 DSHOT_BITBANGED_TIMER_TIM8
,
32 } dshotBitbangedTimer_e
;
45 typedef struct motorDevConfig_s
{
46 uint16_t motorPwmRate
; // The update rate of motor outputs (50-498Hz)
47 uint8_t motorPwmProtocol
; // Pwm Protocol
48 uint8_t motorPwmInversion
; // Active-High vs Active-Low. Useful for brushed FCs converted for brushless operation
49 uint8_t useUnsyncedPwm
;
50 uint8_t useBurstDshot
;
51 uint8_t useDshotTelemetry
;
53 ioTag_t ioTags
[MAX_SUPPORTED_MOTORS
];
54 uint8_t motorTransportProtocol
;
55 uint8_t useDshotBitbang
;
56 uint8_t useDshotBitbangedTimer
;
57 uint8_t motorOutputReordering
[MAX_SUPPORTED_MOTORS
]; // Reindexing motors for "remap motors" feature in Configurator
60 typedef struct motorConfig_s
{
62 uint16_t motorIdle
; // When motors are idling, the percentage of the motor range added above the disarmed value, in percent * 100.
63 uint16_t maxthrottle
; // This is the maximum value for the ESCs at full power. This value can be increased up to 2000
64 uint16_t mincommand
; // This is the value for the ESCs when they are not armed. In some cases, this value must be lowered down to 900 for some specific ESCs
65 uint16_t kv
; // Motor velocity constant (Kv) to estimate RPM under no load (unloadedRpm = Kv * batteryVoltage)
66 uint8_t motorPoleCount
; // Number of magnetic poles in the motor bell for calculating actual RPM from eRPM provided by ESC telemetry
69 PG_DECLARE(motorConfig_t
, motorConfig
);