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

SCT_PWM.h

Committer:
va009039
Date:
2013-10-14
Revision:
1:4e19f154ec21

File content as of revision 1:4e19f154ec21:

#pragma once
#include "LPC8xx.h"

class SCT_PWM {
public:
    SCT_PWM(int pin = 7, int channel = 0);
    void period(float seconds);
    void period_ms(int ms);
    void period_us(int us);
    void pulsewidth(float seconds);
    void pulsewidth_ms(int ms);
    void pulsewidth_us(int us);
    void write(float value);
    float read();
    void swm(int pin = 7);

    SCT_PWM& operator= (float value) {
        write(value);
        return *this;
    }

    SCT_PWM& operator= (SCT_PWM& rhs) {
        write(rhs.read());
        return *this;
    }

protected:
    void inst();
    int ch;
};