mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
implemented using one of RC inputs as ADC channel for power meter.
added MSP_ACC_TRIM stuff for android GUI. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@231 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
e59f639951
commit
23acf529d7
14 changed files with 3007 additions and 2936 deletions
|
@ -11,10 +11,39 @@ typedef struct drv_pwm_config_t {
|
|||
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
|
||||
uint8_t adcChannel; // steal one RC input for current sensor
|
||||
uint16_t motorPwmRate;
|
||||
uint16_t servoPwmRate;
|
||||
} drv_pwm_config_t;
|
||||
|
||||
// This indexes into the read-only hardware definition structure in drv_pwm.c, 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,
|
||||
MAX_PORTS
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
TIM_TypeDef *tim;
|
||||
GPIO_TypeDef *gpio;
|
||||
uint32_t pin;
|
||||
uint8_t channel;
|
||||
uint8_t irq;
|
||||
uint8_t outputEnable;
|
||||
} pwmHardware_t;
|
||||
|
||||
bool pwmInit(drv_pwm_config_t *init); // returns whether driver is asking to calibrate throttle or not
|
||||
void pwmWriteMotor(uint8_t index, uint16_t value);
|
||||
void pwmWriteServo(uint8_t index, uint16_t value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue