mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
series development board. These boards can be picked up for less than $11, coupled with a 10DOF sensor board they make a great development platform or cheap expandable FC. Pretty much all pins are available to be used, unlike on the less capable and more expensive OLIMEXINO.
79 lines
2.3 KiB
C
Executable file
79 lines
2.3 KiB
C
Executable file
/*
|
|
* This file is part of Cleanflight.
|
|
*
|
|
* Cleanflight is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Cleanflight is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#define MAX_PWM_MOTORS 12
|
|
#define MAX_PWM_SERVOS 8
|
|
|
|
#define MAX_MOTORS 12
|
|
#define MAX_SERVOS 8
|
|
#define MAX_PWM_OUTPUT_PORTS MAX_PWM_MOTORS // must be set to the largest of either MAX_MOTORS or MAX_SERVOS
|
|
|
|
#if MAX_PWM_OUTPUT_PORTS < MAX_MOTORS || MAX_PWM_OUTPUT_PORTS < MAX_SERVOS
|
|
#error Invalid motor/servo/port configuration
|
|
#endif
|
|
|
|
|
|
#define PULSE_1MS (1000) // 1ms pulse width
|
|
|
|
#define MAX_INPUTS 8
|
|
|
|
#define PWM_TIMER_MHZ 1
|
|
|
|
typedef struct drv_pwm_config_t {
|
|
bool useParallelPWM;
|
|
bool usePPM;
|
|
bool useRSSIADC;
|
|
#ifdef STM32F10X
|
|
bool useUART2;
|
|
#endif
|
|
bool useSoftSerial;
|
|
bool useLEDStrip;
|
|
bool useServos;
|
|
bool extraServos; // configure additional 4 channels in PPM mode as servos, not motors
|
|
bool airplane; // fixed wing hardware config, lots of servos etc
|
|
uint16_t motorPwmRate;
|
|
uint16_t servoPwmRate;
|
|
uint16_t idlePulse; // PWM value to use when initializing the driver. set this to either PULSE_1MS (regular pwm),
|
|
// some higher value (used by 3d mode), or 0, for brushed pwm drivers.
|
|
uint16_t servoCenterPulse;
|
|
} drv_pwm_config_t;
|
|
|
|
|
|
typedef struct pwmOutputConfiguration_s {
|
|
uint8_t servoCount;
|
|
uint8_t motorCount;
|
|
} pwmOutputConfiguration_t;
|
|
|
|
// This indexes into the read-only hardware definition structure, timerHardware_t, as well as into pwmPorts structure with dynamic data.
|
|
enum {
|
|
PWM1 = 0,
|
|
PWM2,
|
|
PWM3,
|
|
PWM4,
|
|
PWM5,
|
|
PWM6,
|
|
PWM7,
|
|
PWM8,
|
|
PWM9,
|
|
PWM10,
|
|
PWM11,
|
|
PWM12,
|
|
PWM13,
|
|
PWM14
|
|
};
|