MATSU-bed(LPC1549)でPWMを4つ以上出すプログラム
Dependents: servo_controller_1549
Diff: PwmOut_all.h
- Revision:
- 4:49ee58dc8e4d
- Parent:
- 0:64b18a3829f1
--- a/PwmOut_all.h Fri Feb 16 09:06:32 2018 +0000 +++ b/PwmOut_all.h Sat Feb 17 07:23:48 2018 +0000 @@ -59,7 +59,7 @@ * @param pin PwmOut pin to connect to */ PwmOutAll(PinName pin) { - pwmout_init(&_pwm, pin); + pwmout_all_init(&_pwm, pin); } /** Set the ouput duty-cycle, specified as a percentage (float) @@ -70,7 +70,7 @@ * Values outside this range will be saturated to 0.0f or 1.0f. */ void write(float value) { - pwmout_write(&_pwm, value); + pwmout_all_write(&_pwm, value); } /** Return the current output duty-cycle setting, measured as a percentage (float) @@ -84,7 +84,7 @@ * This value may not match exactly the value set by a previous <write>. */ float read() { - return pwmout_read(&_pwm); + return pwmout_all_read(&_pwm); } /** Set the PWM period, specified in seconds (float), keeping the duty cycle the same. @@ -94,37 +94,37 @@ * will be set to zero. */ void period(float seconds) { - pwmout_period(&_pwm, seconds); + pwmout_all_period(&_pwm, seconds); } /** Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same. */ void period_ms(int ms) { - pwmout_period_ms(&_pwm, ms); + pwmout_all_period_ms(&_pwm, ms); } /** Set the PWM period, specified in micro-seconds (int), keeping the duty cycle the same. */ void period_us(int us) { - pwmout_period_us(&_pwm, us); + pwmout_all_period_us(&_pwm, us); } /** Set the PWM pulsewidth, specified in seconds (float), keeping the period the same. */ void pulsewidth(float seconds) { - pwmout_pulsewidth(&_pwm, seconds); + pwmout_all_pulsewidth(&_pwm, seconds); } /** Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same. */ void pulsewidth_ms(int ms) { - pwmout_pulsewidth_ms(&_pwm, ms); + pwmout_all_pulsewidth_ms(&_pwm, ms); } /** Set the PWM pulsewidth, specified in micro-seconds (int), keeping the period the same. */ void pulsewidth_us(int us) { - pwmout_pulsewidth_us(&_pwm, us); + pwmout_all_pulsewidth_us(&_pwm, us); } #ifdef MBED_OPERATORS @@ -149,7 +149,7 @@ #endif protected: - pwmout_t _pwm; + pwmout_all_t _pwm; }; //} // namespace mbed