pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT
Dependencies: mbed MMA8451Q USBDevice WakeUp vt100
Fork of afero_node_suntory_2017_06_15 by
util/WatchDogWrapper.hpp@23:e4d2316383a1, 2017-10-18 (annotated)
- Committer:
- Rhyme
- Date:
- Wed Oct 18 00:31:13 2017 +0000
- Revision:
- 23:e4d2316383a1
- Parent:
- 21:d03c7bbb9f37
pwm period is now 200us from default 20ms; veml6040->setCOLORCOnf is now AF_BIT | TRIG_BIT from 0x00;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wataloh | 21:d03c7bbb9f37 | 1 | #ifndef _WATCH_DOG_WRAPPER_HPP_ |
wataloh | 21:d03c7bbb9f37 | 2 | #define _WATCH_DOG_WRAPPER_HPP_ |
wataloh | 21:d03c7bbb9f37 | 3 | |
wataloh | 21:d03c7bbb9f37 | 4 | #if defined(TARGET_KL25Z) |
wataloh | 21:d03c7bbb9f37 | 5 | |
wataloh | 21:d03c7bbb9f37 | 6 | #include "mbed.h" |
wataloh | 21:d03c7bbb9f37 | 7 | #include "DebugIO.hpp" |
wataloh | 21:d03c7bbb9f37 | 8 | |
wataloh | 21:d03c7bbb9f37 | 9 | /** |
wataloh | 21:d03c7bbb9f37 | 10 | * COP (Watch Dog Info) |
wataloh | 21:d03c7bbb9f37 | 11 | * SIM_COPC 0x4004_8100 |
wataloh | 21:d03c7bbb9f37 | 12 | * bit[3:2] COPT |
wataloh | 21:d03c7bbb9f37 | 13 | * 00 : COP disabled |
wataloh | 21:d03c7bbb9f37 | 14 | * 01 : COP timeout after 2^5 LPO cycles or 2^13 bus clock cycles |
wataloh | 21:d03c7bbb9f37 | 15 | * 10 : COP timeout after 2^8 LPO cycles or 2^16 bus clock cycles |
wataloh | 21:d03c7bbb9f37 | 16 | * 11 : COP timeout after 2^10 LPO (1024ms) cycles or 2^18 bus clock cycles |
wataloh | 21:d03c7bbb9f37 | 17 | * bit[1] COPCLKS |
wataloh | 21:d03c7bbb9f37 | 18 | * 0 : Internal 1kHz clock is source to COP |
wataloh | 21:d03c7bbb9f37 | 19 | * 1 : Bus clock source to COP |
wataloh | 21:d03c7bbb9f37 | 20 | * bit[0] COPW |
wataloh | 21:d03c7bbb9f37 | 21 | * 0 : Normal mode |
wataloh | 21:d03c7bbb9f37 | 22 | * 1 : Windowed mode |
wataloh | 21:d03c7bbb9f37 | 23 | * |
wataloh | 21:d03c7bbb9f37 | 24 | * SIM_SRVCOP 0x4004_8104 |
wataloh | 21:d03c7bbb9f37 | 25 | * bit[7:0] Service COP Register |
wataloh | 21:d03c7bbb9f37 | 26 | * Write 0x55 and then 0xAA (in that order) to reset COP timeout counter. |
wataloh | 21:d03c7bbb9f37 | 27 | * |
wataloh | 21:d03c7bbb9f37 | 28 | * NOTE: SIM->COPC register can be written only ONCE after each reset. |
wataloh | 21:d03c7bbb9f37 | 29 | */ |
wataloh | 21:d03c7bbb9f37 | 30 | |
wataloh | 21:d03c7bbb9f37 | 31 | #include "Singletoned.hpp" |
wataloh | 21:d03c7bbb9f37 | 32 | |
wataloh | 21:d03c7bbb9f37 | 33 | class WatchDogWrapper : |
wataloh | 21:d03c7bbb9f37 | 34 | public Singletoned<WatchDogWrapper> |
wataloh | 21:d03c7bbb9f37 | 35 | { |
wataloh | 21:d03c7bbb9f37 | 36 | void (WatchDogWrapper::*pReset)(); |
wataloh | 21:d03c7bbb9f37 | 37 | void empty(); |
wataloh | 21:d03c7bbb9f37 | 38 | void _reset(); |
wataloh | 21:d03c7bbb9f37 | 39 | friend class Signletoned; |
wataloh | 21:d03c7bbb9f37 | 40 | public: |
wataloh | 21:d03c7bbb9f37 | 41 | WatchDogWrapper(); |
wataloh | 21:d03c7bbb9f37 | 42 | void kick_the_bucket(); |
wataloh | 21:d03c7bbb9f37 | 43 | void reset(); |
wataloh | 21:d03c7bbb9f37 | 44 | }; |
wataloh | 21:d03c7bbb9f37 | 45 | |
wataloh | 21:d03c7bbb9f37 | 46 | #endif //TARGET_KL25Z |
wataloh | 21:d03c7bbb9f37 | 47 | |
wataloh | 21:d03c7bbb9f37 | 48 | #endif //_WATCH_DOG_WRAPPER_HPP_ |