1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

rewritten and cleaned up PWM driver

this has been hover-tested.
all current functionality *should* work even though the driver has been rewritten.
please test carefully, especially servo configurations!

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@197 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop 2012-08-17 06:48:30 +00:00
parent 9b7e26b274
commit ee76242525
6 changed files with 2925 additions and 2844 deletions

View file

@ -5,11 +5,14 @@ typedef struct drv_pwm_config_t {
bool usePPM;
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;
} drv_pwm_config_t;
bool pwmInit(drv_pwm_config_t *init); // returns whether driver is asking to calibrate throttle or not
void pwmWrite(uint8_t channel, uint16_t value);
void pwmWriteMotor(uint8_t index, uint16_t value);
void pwmWriteServo(uint8_t index, uint16_t value);
uint16_t pwmRead(uint8_t channel);
uint8_t pwmGetNumOutputChannels(void);
// void pwmWrite(uint8_t channel, uint16_t value);