TR-mbed 1.0
Loading...
Searching...
No Matches
PwmIn.h
Go to the documentation of this file.
1/* mbed PwmIn Library
2 * Copyright (c) 2008-2010, sford
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#ifndef MBED_PWMIN_H
24#define MBED_PWMIN_H
25
26#include "mbed.h"
27
35class PwmIn {
36public:
41 PwmIn(PinName p);
42
47 float period();
48
53 float pulsewidth();
54
59 float dutycycle();
60
61protected:
62 void rise();
63 void fall();
64
65 InterruptIn _p;
66 Timer _t;
68};
69
70#endif
Definition PwmIn.h:35
void fall()
Definition PwmIn.cpp:53
InterruptIn _p
Definition PwmIn.h:65
Timer _t
Definition PwmIn.h:66
float dutycycle()
Definition PwmIn.cpp:41
float pulsewidth()
Definition PwmIn.cpp:37
void rise()
Definition PwmIn.cpp:48
float _pulsewidth
Definition PwmIn.h:67
float period()
Definition PwmIn.cpp:33
float _period
Definition PwmIn.h:67
IMU::EulerAngles p
Definition imuExampleAllData.cpp:21