Committer:
YSI
Date:
Fri Jul 10 14:10:46 2015 +0000
Revision:
2:4673fac2ae7f
Parent:
1:8067d51d66bd
Child:
3:1d1669e8c9b1
Am?lioration de la pr?cision du PWM pour les p?riodes en dessous de 100us.

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 1:8067d51d66bd 26 Ticker TickerPeriod;
YSI 0:0e01d184dbab 27
YSI 2:4673fac2ae7f 28 float Pwm_Duty_Cycle;
YSI 1:8067d51d66bd 29 int Pwm_period_us;
YSI 1:8067d51d66bd 30 int TimeDown;
YSI 1:8067d51d66bd 31
YSI 0:0e01d184dbab 32 void DigitalUp(void);
YSI 0:0e01d184dbab 33 void DigitalDown(void);
YSI 0:0e01d184dbab 34 void UsePwm(void);
YSI 0:0e01d184dbab 35 };
YSI 0:0e01d184dbab 36
YSI 0:0e01d184dbab 37 #endif