lpc_pwm.hpp
Go to the documentation of this file.
1 /*
2  * SocialLedge.com - Copyright (C) 2013
3  *
4  * This file is part of free software framework for embedded processors.
5  * You can use it and/or distribute it as long as this copyright header
6  * remains unmodified. The code is free for personal use and requires
7  * permission to use in a commercial product.
8  *
9  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
10  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
12  * I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
13  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
14  *
15  * You can reach the author of this software at :
16  * p r e e t . w i k i @ g m a i l . c o m
17  */
18 
23 #ifndef LPC_PWM_HPP__
24 #define LPC_PWM_HPP__
25 
26 
27 
37 class PWM
38 {
39  public :
40  typedef enum {
41  pwm1=0,
42  pwm2=1,
43  pwm3=2,
44  pwm4=3,
45  pwm5=4,
46  pwm6=5
47  } pwmType;
48 
55  PWM(pwmType pwm, unsigned int frequencyHz=50);
56 
58  ~PWM();
59 
70  bool set(float percent);
71 
72  private:
73  PWM();
74  const pwmType mPwm;
75  static unsigned int msTcMax;
76 };
77 
78 
79 
80 #endif /* LPC_PWM_HPP__ */
P2.4.
Definition: lpc_pwm.hpp:45
pwmType
Definition: lpc_pwm.hpp:40
Definition: lpc_pwm.hpp:37
P2.2.
Definition: lpc_pwm.hpp:43
P2.3.
Definition: lpc_pwm.hpp:44
~PWM()
Destructor that will destroy PWM configuration.
Definition: lpc_pwm.cpp:62
P2.1.
Definition: lpc_pwm.hpp:42
P2.5.
Definition: lpc_pwm.hpp:46
P2.0.
Definition: lpc_pwm.hpp:41