liang brain / Mbed 2 deprecated Ex_IO_pwm

Dependencies:   mbed

IO_pwm/IO_pwm.h

Committer:
brainliang
Date:
2019-03-16
Revision:
0:d0c188d2cd1c

File content as of revision 0:d0c188d2cd1c:

/*
h文件
class 类名
{
public:
    类名::构造函数(变量参数);
    公有函数声明;
protected:
    私有对象声明;
    私有变量声明;
    私有函数声明;
};
*/

#ifndef IO_pwm_H_
#define IO_pwm_H_
#include "mbed.h"
class IO_pwm
{
public:
    IO_pwm(PinName n);
    void pwm_io(int p_us, float dc);
    
protected:
    //PWM的周期=on_delay+off_delay,高电平时间=on_delay
    int on_delay;
    int off_delay;
    
    PinName _n;
   // DigitalOutr mypwm;
    Timeout timer;
    void toggleOn(void);
    void toggleOff(void);
};
#endif