Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: triforce-control usbjoystick_prg
PwmIn.h@0:1ae106ada18a, 2014-04-30 (annotated)
- Committer:
- pHysiX
- Date:
- Wed Apr 30 06:37:19 2014 +0000
- Revision:
- 0:1ae106ada18a
- Child:
- 2:1f00548c2aa6
PwmIn: Moved to separate library, included lost signal control
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pHysiX | 0:1ae106ada18a | 1 | /* PWM In by Simon Ford */ |
pHysiX | 0:1ae106ada18a | 2 | |
pHysiX | 0:1ae106ada18a | 3 | #include "mbed.h" |
pHysiX | 0:1ae106ada18a | 4 | |
pHysiX | 0:1ae106ada18a | 5 | #ifndef _PWMIN_H_ |
pHysiX | 0:1ae106ada18a | 6 | #define _PWMIN_H_ |
pHysiX | 0:1ae106ada18a | 7 | |
pHysiX | 0:1ae106ada18a | 8 | class PwmIn |
pHysiX | 0:1ae106ada18a | 9 | { |
pHysiX | 0:1ae106ada18a | 10 | public: |
pHysiX | 0:1ae106ada18a | 11 | PwmIn(PinName p); |
pHysiX | 0:1ae106ada18a | 12 | |
pHysiX | 0:1ae106ada18a | 13 | void rise(); |
pHysiX | 0:1ae106ada18a | 14 | void fall(); |
pHysiX | 0:1ae106ada18a | 15 | |
pHysiX | 0:1ae106ada18a | 16 | float period(); |
pHysiX | 0:1ae106ada18a | 17 | float pulsewidth(); |
pHysiX | 0:1ae106ada18a | 18 | float dutycycle(); |
pHysiX | 0:1ae106ada18a | 19 | |
pHysiX | 0:1ae106ada18a | 20 | Timer stallTimer; |
pHysiX | 0:1ae106ada18a | 21 | |
pHysiX | 0:1ae106ada18a | 22 | protected: |
pHysiX | 0:1ae106ada18a | 23 | InterruptIn _p; |
pHysiX | 0:1ae106ada18a | 24 | Timer _t; |
pHysiX | 0:1ae106ada18a | 25 | int _pulsewidth, _period; |
pHysiX | 0:1ae106ada18a | 26 | bool stallInit; |
pHysiX | 0:1ae106ada18a | 27 | }; |
pHysiX | 0:1ae106ada18a | 28 | |
pHysiX | 0:1ae106ada18a | 29 | #endif |