liang brain / Mbed 2 deprecated Ex_IO_pwm

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IO_pwm.h Source File

IO_pwm.h

00001 /*
00002 h文件
00003 class 类名
00004 {
00005 public:
00006     类名::构造函数(变量参数);
00007     公有函数声明;
00008 protected:
00009     私有对象声明;
00010     私有变量声明;
00011     私有函数声明;
00012 };
00013 */
00014 
00015 #ifndef IO_pwm_H_
00016 #define IO_pwm_H_
00017 #include "mbed.h"
00018 class IO_pwm
00019 {
00020 public:
00021     IO_pwm(PinName n);
00022     void pwm_io(int p_us, float dc);
00023     
00024 protected:
00025     //PWM的周期=on_delay+off_delay,高电平时间=on_delay
00026     int on_delay;
00027     int off_delay;
00028     
00029     PinName _n;
00030    // DigitalOutr mypwm;
00031     Timeout timer;
00032     void toggleOn(void);
00033     void toggleOff(void);
00034 };
00035 #endif