A compilation of some hardware sensors and their shared programming interfaces.
SleepableSensor.h@0:8d34cc2ff388, 2014-03-16 (annotated)
- Committer:
- mgottscho
- Date:
- Sun Mar 16 01:48:59 2014 +0000
- Revision:
- 0:8d34cc2ff388
A compilation of various hardware sensors and some shared programming interfaces.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mgottscho | 0:8d34cc2ff388 | 1 | /* SleepableSensor.h |
mgottscho | 0:8d34cc2ff388 | 2 | * Tested with mbed board: FRDM-KL46Z |
mgottscho | 0:8d34cc2ff388 | 3 | * Author: Mark Gottscho |
mgottscho | 0:8d34cc2ff388 | 4 | * mgottscho@ucla.edu |
mgottscho | 0:8d34cc2ff388 | 5 | */ |
mgottscho | 0:8d34cc2ff388 | 6 | |
mgottscho | 0:8d34cc2ff388 | 7 | #ifndef SLEEPABLE_SENSOR_H |
mgottscho | 0:8d34cc2ff388 | 8 | #define SLEEPABLE_SENSOR_H |
mgottscho | 0:8d34cc2ff388 | 9 | |
mgottscho | 0:8d34cc2ff388 | 10 | class SleepableSensor { |
mgottscho | 0:8d34cc2ff388 | 11 | public: |
mgottscho | 0:8d34cc2ff388 | 12 | SleepableSensor(); |
mgottscho | 0:8d34cc2ff388 | 13 | ~SleepableSensor(); |
mgottscho | 0:8d34cc2ff388 | 14 | |
mgottscho | 0:8d34cc2ff388 | 15 | virtual void sleep() = 0; |
mgottscho | 0:8d34cc2ff388 | 16 | virtual void wake() = 0; |
mgottscho | 0:8d34cc2ff388 | 17 | |
mgottscho | 0:8d34cc2ff388 | 18 | bool isAsleep(); |
mgottscho | 0:8d34cc2ff388 | 19 | |
mgottscho | 0:8d34cc2ff388 | 20 | private: |
mgottscho | 0:8d34cc2ff388 | 21 | bool __sleeping; |
mgottscho | 0:8d34cc2ff388 | 22 | }; |
mgottscho | 0:8d34cc2ff388 | 23 | |
mgottscho | 0:8d34cc2ff388 | 24 | #endif |