Fork of Smoothie to port to mbed non-LPC targets.

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

libs/Pwm.h

Committer:
Bigcheese
Date:
2014-03-02
Revision:
3:f151d08d335c
Parent:
2:1df0b61d3b5a

File content as of revision 3:f151d08d335c:

#ifndef _PWM_H
#define _PWM_H

#include <stdint.h>

#include "Pin.h"
#include "Module.h"

class Pwm : public Module, public Pin {
public:
    Pwm();

    void     on_module_load(void);
    uint32_t on_tick(uint32_t);

    Pwm*     max_pwm(int);
    int      max_pwm(void);

    void     pwm(int);
    void     set(bool);

    int  _max;
    int  _pwm;
    int  _sd_accumulator;
    bool _sd_direction;
};

#endif /* _PWM_H */