lib_PwmOutAllPin permet de créer des PwmOut sur toutes les DigitalOut du Mbed. YSI

Committer:
YSI
Date:
Fri Jul 10 08:44:52 2015 +0000
Revision:
0:0e01d184dbab
Child:
1:8067d51d66bd
lib_PwmOutAllPin

Who changed what in which revision?

UserRevisionLine numberNew contents of line
YSI 0:0e01d184dbab 1 #ifndef DEF_lib_PwmOutAllPin_H
YSI 0:0e01d184dbab 2 #define DEF_lib_PwmOutAllPin_H
YSI 0:0e01d184dbab 3
YSI 0:0e01d184dbab 4 #include "mbed.h"
YSI 0:0e01d184dbab 5
YSI 0:0e01d184dbab 6 class PwmOutAllPin : public Timeout
YSI 0:0e01d184dbab 7 {
YSI 0:0e01d184dbab 8 public:
YSI 0:0e01d184dbab 9 PwmOutAllPin(PinName pin);
YSI 0:0e01d184dbab 10
YSI 0:0e01d184dbab 11 void write(float value);
YSI 0:0e01d184dbab 12 float read(void);
YSI 0:0e01d184dbab 13 void period(float seconds);
YSI 0:0e01d184dbab 14 void period_ms(int ms);
YSI 0:0e01d184dbab 15 void period_us(int us);
YSI 0:0e01d184dbab 16 void pulsewidth(float seconds);
YSI 0:0e01d184dbab 17 void pulsewidth_ms(int ms);
YSI 0:0e01d184dbab 18 void pulsewidth_us(int us);
YSI 0:0e01d184dbab 19 PwmOutAllPin& operator= (float value);
YSI 0:0e01d184dbab 20 PwmOutAllPin& operator= (PwmOutAllPin& rhs);
YSI 0:0e01d184dbab 21 operator float();
YSI 0:0e01d184dbab 22
YSI 0:0e01d184dbab 23 protected:
YSI 0:0e01d184dbab 24 DigitalOut PwmOutPin;
YSI 0:0e01d184dbab 25 Timeout SwitchPin;
YSI 0:0e01d184dbab 26
YSI 0:0e01d184dbab 27 float Pwm_period_us;
YSI 0:0e01d184dbab 28 float Pwm_Duty_Cycle;
YSI 0:0e01d184dbab 29
YSI 0:0e01d184dbab 30 void DigitalUp(void);
YSI 0:0e01d184dbab 31 void DigitalDown(void);
YSI 0:0e01d184dbab 32 void UsePwm(void);
YSI 0:0e01d184dbab 33 };
YSI 0:0e01d184dbab 34
YSI 0:0e01d184dbab 35 #endif