2 #ifndef libpropeller_vnh2sp30_h__
3 #define libpropeller_vnh2sp30_h__
59 waitcnt(CLKFREQ / 10 + CNT);
92 pwmPin =
Pin(new_pwmPin);
117 pwmPin =
Pin(new_pwmPin);
127 channel = new_channel;
131 }
else if (channel ==
Y) {
145 void Set(
const int power){
174 }
else if (power > 100) {
177 adjustedSpeed = power;
182 SetSpeedPwm32(adjustedSpeed);
183 }
else if (pwm2 != NULL) {
184 SetSpeedPwm2(adjustedSpeed);
205 Pin inA, inB, pwmPin;
211 static const int kFrequency = 1000;
214 static const int kResolution = 10;
215 static const int kScale = 2147483647 / (1 << (kResolution - 1));
217 void SetSpeedPwm2(
const int speed) {
221 }
else if (channel ==
Y) {
226 void SetSpeedPwm32(
const int speed) {
227 pwm32->
Duty(pwmPin.
getPin(), speed, 1000000 / kFrequency);
243 #endif // libpropeller_vnh2sp30_h__