ピン変化割り込み拡張しよう的な
Dependents: inte_mod_test test_irm2121 BallCheck_IRM2121_InterrputInAdd CatPot_SensorRight
interruptin_mod.h@3:1cc9d9e3cf8c, 2014-12-03 (annotated)
- Committer:
- bousiya03
- Date:
- Wed Dec 03 07:31:00 2014 +0000
- Revision:
- 3:1cc9d9e3cf8c
- Parent:
- 2:9f98488efd06
0?NULL????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bousiya03 | 0:fa2477ffef50 | 1 | #ifndef INTE_MOD |
bousiya03 | 0:fa2477ffef50 | 2 | #define INTE_MOD |
bousiya03 | 0:fa2477ffef50 | 3 | |
bousiya03 | 0:fa2477ffef50 | 4 | |
bousiya03 | 0:fa2477ffef50 | 5 | #include"mbed.h" |
bousiya03 | 0:fa2477ffef50 | 6 | |
bousiya03 | 1:c63d872cfdb7 | 7 | class interruptin_mod: public InterruptIn{ |
bousiya03 | 0:fa2477ffef50 | 8 | |
bousiya03 | 0:fa2477ffef50 | 9 | public: |
bousiya03 | 0:fa2477ffef50 | 10 | |
bousiya03 | 0:fa2477ffef50 | 11 | interruptin_mod(PinName pin); |
bousiya03 | 0:fa2477ffef50 | 12 | |
bousiya03 | 0:fa2477ffef50 | 13 | void fall_disable(void (*fptr)(void)); |
bousiya03 | 0:fa2477ffef50 | 14 | void rise_disable(void (*fptr)(void)); |
bousiya03 | 2:9f98488efd06 | 15 | |
bousiya03 | 2:9f98488efd06 | 16 | template<typename T> |
bousiya03 | 2:9f98488efd06 | 17 | void rise_disable(T* tptr, void (T::*mptr)(void)) { |
bousiya03 | 2:9f98488efd06 | 18 | _rise.attach(tptr, mptr); |
bousiya03 | 3:1cc9d9e3cf8c | 19 | gpio_irq_set(&gpio_irq, IRQ_RISE, NULL); |
bousiya03 | 2:9f98488efd06 | 20 | } |
bousiya03 | 2:9f98488efd06 | 21 | template<typename T> |
bousiya03 | 2:9f98488efd06 | 22 | void fall_disable(T* tptr, void (T::*mptr)(void)) { |
bousiya03 | 2:9f98488efd06 | 23 | _fall.attach(tptr, mptr); |
bousiya03 | 3:1cc9d9e3cf8c | 24 | gpio_irq_set(&gpio_irq, IRQ_RISE, NULL); |
bousiya03 | 2:9f98488efd06 | 25 | } |
bousiya03 | 2:9f98488efd06 | 26 | |
bousiya03 | 1:c63d872cfdb7 | 27 | |
bousiya03 | 0:fa2477ffef50 | 28 | }; |
bousiya03 | 0:fa2477ffef50 | 29 | |
bousiya03 | 0:fa2477ffef50 | 30 | #endif |