xrocusOS_ADXL355 version
Dependencies: mbed SDFileSystem
include/DeviceRepeater.h@20:2f2687580ecb, 2019-07-05 (annotated)
- Committer:
- APS_Lab
- Date:
- Fri Jul 05 02:09:06 2019 +0000
- Revision:
- 20:2f2687580ecb
- Parent:
- 17:c2709a9c0a68
Ver0.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Inscape_ao | 7:9ab8809f9693 | 1 | #ifndef _DEVICEREPEATER_H_ |
Inscape_ao | 7:9ab8809f9693 | 2 | #define _DEVICEREPEATER_H_ |
Inscape_ao | 7:9ab8809f9693 | 3 | |
Inscape_ao | 7:9ab8809f9693 | 4 | #include "DeviceDriverInterface.h" |
Inscape_ao | 7:9ab8809f9693 | 5 | |
Inscape_ao | 7:9ab8809f9693 | 6 | class DeviceRepeater |
Inscape_ao | 7:9ab8809f9693 | 7 | { |
Inscape_ao | 7:9ab8809f9693 | 8 | public: |
Inscape_ao | 7:9ab8809f9693 | 9 | typedef enum device_attr_status { |
Inscape_ao | 7:9ab8809f9693 | 10 | DEV_FATAL = -2, |
Inscape_ao | 7:9ab8809f9693 | 11 | DEV_NOT_INIT = -1, |
Inscape_ao | 7:9ab8809f9693 | 12 | DEV_READY = 0, |
Inscape_ao | 7:9ab8809f9693 | 13 | DEV_RUNNING, |
Inscape_ao | 7:9ab8809f9693 | 14 | DEV_REQ_STOP, |
Inscape_ao | 7:9ab8809f9693 | 15 | } DevStatus; |
Inscape_ao | 7:9ab8809f9693 | 16 | private: |
Inscape_ao | 17:c2709a9c0a68 | 17 | static const bool DEFAULT_REPEAT_SINGLESHOT = false; |
Inscape_ao | 7:9ab8809f9693 | 18 | static const int DEFAULT_REPEAT_MAX_COUNT = 1; |
Inscape_ao | 7:9ab8809f9693 | 19 | static const int DEFAULT_REPEAT_STRIDE = 5; |
Inscape_ao | 7:9ab8809f9693 | 20 | static const int NOT_ID_SELECTED = -1; |
Inscape_ao | 7:9ab8809f9693 | 21 | private: |
Inscape_ao | 10:db2be22bc2f9 | 22 | int deviceID; |
Inscape_ao | 7:9ab8809f9693 | 23 | int selected_id; |
Inscape_ao | 7:9ab8809f9693 | 24 | DevStatus stat; |
Inscape_ao | 7:9ab8809f9693 | 25 | DeviceDriver *pDriver; |
Inscape_ao | 7:9ab8809f9693 | 26 | |
Inscape_ao | 7:9ab8809f9693 | 27 | /* Tick base class */ |
Inscape_ao | 7:9ab8809f9693 | 28 | Ticker *pClock; |
Inscape_ao | 7:9ab8809f9693 | 29 | /* members for repeating */ |
Inscape_ao | 17:c2709a9c0a68 | 30 | int repeat_singleshot; |
Inscape_ao | 7:9ab8809f9693 | 31 | int repeat_max_count; |
Inscape_ao | 7:9ab8809f9693 | 32 | int repeat_stride_sec; |
Inscape_ao | 7:9ab8809f9693 | 33 | int repeat_remain_cnt; |
Inscape_ao | 7:9ab8809f9693 | 34 | int repeat_remain_sec; |
Inscape_ao | 7:9ab8809f9693 | 35 | private: |
Inscape_ao | 7:9ab8809f9693 | 36 | DeviceRepeater(void); |
Inscape_ao | 7:9ab8809f9693 | 37 | public: |
Inscape_ao | 10:db2be22bc2f9 | 38 | DeviceRepeater(int deviceId, DeviceDriver *setDriver); |
Inscape_ao | 7:9ab8809f9693 | 39 | bool setRepeatCount(int maxcount); |
Inscape_ao | 7:9ab8809f9693 | 40 | bool setRepeatStride(int sec); |
Inscape_ao | 17:c2709a9c0a68 | 41 | bool setRepeatSingleShot(bool setMode); |
Inscape_ao | 7:9ab8809f9693 | 42 | bool setConfigId(int id); |
Inscape_ao | 7:9ab8809f9693 | 43 | bool setConfigValue(int setValue); |
Inscape_ao | 7:9ab8809f9693 | 44 | bool getConfigValue(int *retValue); |
Inscape_ao | 7:9ab8809f9693 | 45 | bool start(); |
Inscape_ao | 7:9ab8809f9693 | 46 | bool stop(); |
Inscape_ao | 7:9ab8809f9693 | 47 | bool readyToStart(); |
Inscape_ao | 7:9ab8809f9693 | 48 | void tick(); |
Inscape_ao | 7:9ab8809f9693 | 49 | bool resetAllStatus(void); |
Inscape_ao | 7:9ab8809f9693 | 50 | private: |
Inscape_ao | 7:9ab8809f9693 | 51 | bool init(); |
Inscape_ao | 7:9ab8809f9693 | 52 | }; |
Inscape_ao | 7:9ab8809f9693 | 53 | |
Inscape_ao | 7:9ab8809f9693 | 54 | #endif /* _DEVICEREPEATER_H_ */ |