SoftwarePWM.h
Go to the documentation of this file.
1 /* mbed Software PWM Library without using PWM pins
2  * Copyright (c) 2012 Takashi Kojo
3  * based and modified, Copyright (c) 2010 Jasper Denkers
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21  * THE SOFTWARE.
22 */
23 
24 #ifndef MBED_SOFTWAREPWM_H
25 #define MBED_SOFTWAREPWM_H
26 
27 #include "mbed.h"
28 
56 {
57 
58 public:
63  SoftwarePWM(PinName Pin);
64 
69  void SetPosition(int NewPos);
70 
76  void Enable(int StartPos, int Period);
77 
81  void Disable();
82 
83 private:
84  void StartPulse();
85  void EndPulse();
86 
87  int Position;
88  DigitalOut SoftwarePWMPin;
89  Ticker Pulse;
90  Timeout PulseStop;
91 };
92 
93 
94 extern SoftwarePWM Intensity[] ;
95 #define INTENSITY_FACTOR 10
96 
97 #endif
void Disable()
Definition: SoftwarePWM.cpp:35
SoftwarePWM(PinName Pin)
Definition: SoftwarePWM.cpp:4
Ticker Pulse
Definition: SoftwarePWM.h:89
void EndPulse()
Definition: SoftwarePWM.cpp:24
void Enable(int StartPos, int Period)
Definition: SoftwarePWM.cpp:29
void SetPosition(int NewPos)
Definition: SoftwarePWM.cpp:6
Timeout PulseStop
Definition: SoftwarePWM.h:90
SoftwarePWM Intensity[]
DigitalOut SoftwarePWMPin
Definition: SoftwarePWM.h:88
void StartPulse()
Definition: SoftwarePWM.cpp:11


rosserial_mbed
Author(s): Gary Servin
autogenerated on Mon Jun 10 2019 14:53:26