STM32F1: Servo "soft" PWM via timer interrupt (#14187)

This commit is contained in:
Tanguy Pruvot
2019-06-07 14:11:48 +02:00
committed by Scott Lahteine
parent 66e22d9f5a
commit 764f0d9c1c
3 changed files with 124 additions and 7 deletions

View File

@@ -46,8 +46,15 @@ class libServo {
void move(const int32_t value);
int32_t read() const;
private:
void servoWrite(uint8_t pin, const uint16_t duty_cycle);
uint8_t servoIndex; // index into the channel data for this servo
int32_t pin = NOT_ATTACHED;
int32_t minAngle;
int32_t maxAngle;
int32_t angle;
bool setupSoftPWM(const int32_t pin);
void pauseSoftPWM();
void pwmSetDuty(const uint16_t duty_cycle);
};