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.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Get_IMD/IMD.h@12:e0adb697fcdb, 2014-10-21 (annotated)
- Committer:
- martydd3
- Date:
- Tue Oct 21 23:44:15 2014 +0000
- Revision:
- 12:e0adb697fcdb
- Parent:
- 8:ecf68db484af
Added Error update thread, changed CAN message IDs
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| martydd3 | 8:ecf68db484af | 1 | // copied idea from http://developer.mbed.org/forum/mbed/topic/466/?page=1#comment-2457 |
| martydd3 | 8:ecf68db484af | 2 | |
| martydd3 | 8:ecf68db484af | 3 | #ifndef _FILE_IMD_H |
| martydd3 | 8:ecf68db484af | 4 | #define _FILE_IMD_H |
| martydd3 | 8:ecf68db484af | 5 | |
| martydd3 | 8:ecf68db484af | 6 | #include "mbed.h" |
| martydd3 | 8:ecf68db484af | 7 | #include "CANBuffer.h" |
| martydd3 | 8:ecf68db484af | 8 | #include "rtos.h" |
| martydd3 | 8:ecf68db484af | 9 | |
| martydd3 | 12:e0adb697fcdb | 10 | const int TX_IMD_ID = ((0x4 << 8) | 0x20); |
| martydd3 | 8:ecf68db484af | 11 | |
| martydd3 | 8:ecf68db484af | 12 | class IMD{ |
| martydd3 | 8:ecf68db484af | 13 | public: |
| martydd3 | 8:ecf68db484af | 14 | IMD(CANBuffer *can); |
| martydd3 | 8:ecf68db484af | 15 | void start_update(); |
| martydd3 | 8:ecf68db484af | 16 | float frequency(); |
| martydd3 | 8:ecf68db484af | 17 | float pulse_width(); |
| martydd3 | 8:ecf68db484af | 18 | float duty(); |
| martydd3 | 8:ecf68db484af | 19 | |
| martydd3 | 8:ecf68db484af | 20 | private: |
| martydd3 | 8:ecf68db484af | 21 | InterruptIn _p; |
| martydd3 | 8:ecf68db484af | 22 | Timer _t; |
| martydd3 | 8:ecf68db484af | 23 | float _pulsewidth, _period; |
| martydd3 | 8:ecf68db484af | 24 | void rise(); |
| martydd3 | 8:ecf68db484af | 25 | void fall(); |
| martydd3 | 8:ecf68db484af | 26 | }; |
| martydd3 | 8:ecf68db484af | 27 | |
| martydd3 | 8:ecf68db484af | 28 | #endif |
