Thomas Hamilton / Mbed 2 deprecated MB1210

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PwmIn.h Source File

PwmIn.h

00001 //mbed Microcontroller Library
00002 //Pulse Width Modulation Input Interface
00003 //Copyright 2010
00004 //Thomas Hamilton
00005 
00006 #ifndef PwmInLibrary
00007 #define PwmInLibrary
00008 
00009 #include "stdint.h"
00010 #include "mbed.h"
00011 
00012 class PwmIn : private InterruptIn, Timer
00013 {
00014     private:
00015         unsigned int PeriodMeasurement;
00016         unsigned int PulseWidthMeasurement;
00017 
00018         void PulseStart();
00019         void PulseStop();
00020 
00021     public:
00022         PwmIn(PinName pwi);
00023         float read();
00024         float period();
00025         int period_ms();
00026         int period_us();
00027         float pulsewidth();
00028         int pulsewidth_ms();
00029         int pulsewidth_us();
00030 };
00031 
00032 #endif