LPC800-MAX RGB demo using SCT and MRT
LPC800-MAX RGB demo using State-Configurable Timer(SCT) and Multi-Rate Timer(MRT).
http://www.youtube.com/watch?v=PABxoWZB0YM
Diff: MRT.h
- Revision:
- 1:4e19f154ec21
diff -r f86c572491c3 -r 4e19f154ec21 MRT.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MRT.h Mon Oct 14 03:59:30 2013 +0000 @@ -0,0 +1,26 @@ +#pragma once +#include "LPC8xx.h" + +class MRT { +public: + MRT(int channel = 0); + /** write down counter + * @param interval start count + */ + void write(uint32_t interval); + /** read down counter + */ + uint32_t read(); + enum STAT { + IDLE, + RUNNING, + }; + int status(); + void wait_ms(uint32_t timeout_ms); + void wait_us(uint32_t timeout_us); + void wait_raw(uint32_t timeout); +protected: + void inst(); + MRT_Channel_cfg_Type* _ch; + int us_clk; +};