Thundersoft
/
ReedSwitch_for_TT_Mxx
Creating a project for TT_Mxx
DoorStatus/DoorStatus.h@0:a0f5041497e4, 2019-03-21 (annotated)
- Committer:
- ThunderSoft
- Date:
- Thu Mar 21 10:08:02 2019 +0000
- Revision:
- 0:a0f5041497e4
Add DoorStatus code for TT_Mxx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThunderSoft | 0:a0f5041497e4 | 1 | #ifndef DOORSTATUS_H |
ThunderSoft | 0:a0f5041497e4 | 2 | #define DOORSTATUS_H |
ThunderSoft | 0:a0f5041497e4 | 3 | |
ThunderSoft | 0:a0f5041497e4 | 4 | #include "mbed.h" |
ThunderSoft | 0:a0f5041497e4 | 5 | |
ThunderSoft | 0:a0f5041497e4 | 6 | |
ThunderSoft | 0:a0f5041497e4 | 7 | |
ThunderSoft | 0:a0f5041497e4 | 8 | class DoorStatus { |
ThunderSoft | 0:a0f5041497e4 | 9 | |
ThunderSoft | 0:a0f5041497e4 | 10 | |
ThunderSoft | 0:a0f5041497e4 | 11 | public: |
ThunderSoft | 0:a0f5041497e4 | 12 | /** |
ThunderSoft | 0:a0f5041497e4 | 13 | * @brief |
ThunderSoft | 0:a0f5041497e4 | 14 | */ |
ThunderSoft | 0:a0f5041497e4 | 15 | DoorStatus(PinName pin); |
ThunderSoft | 0:a0f5041497e4 | 16 | |
ThunderSoft | 0:a0f5041497e4 | 17 | DoorStatus(); |
ThunderSoft | 0:a0f5041497e4 | 18 | |
ThunderSoft | 0:a0f5041497e4 | 19 | /** |
ThunderSoft | 0:a0f5041497e4 | 20 | * @brief Handle the event about door status. |
ThunderSoft | 0:a0f5041497e4 | 21 | * @param func handle of function. |
ThunderSoft | 0:a0f5041497e4 | 22 | */ |
ThunderSoft | 0:a0f5041497e4 | 23 | void handleCallback(Callback<void()> func); |
ThunderSoft | 0:a0f5041497e4 | 24 | private: |
ThunderSoft | 0:a0f5041497e4 | 25 | InterruptIn *interruptPin; |
ThunderSoft | 0:a0f5041497e4 | 26 | |
ThunderSoft | 0:a0f5041497e4 | 27 | }; |
ThunderSoft | 0:a0f5041497e4 | 28 | |
ThunderSoft | 0:a0f5041497e4 | 29 | |
ThunderSoft | 0:a0f5041497e4 | 30 | |
ThunderSoft | 0:a0f5041497e4 | 31 | |
ThunderSoft | 0:a0f5041497e4 | 32 | |
ThunderSoft | 0:a0f5041497e4 | 33 | |
ThunderSoft | 0:a0f5041497e4 | 34 | #endif |