mbed with Nintendo DS touchpad, accelerometer & touchpad.

Dependencies:   mbed

Committer:
Clemo
Date:
Wed May 05 12:10:15 2010 +0000
Revision:
0:0a76ae27065b

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Clemo 0:0a76ae27065b 1 /*
Clemo 0:0a76ae27065b 2 mbed touchpad & accelerometer experiments.
Clemo 0:0a76ae27065b 3
Clemo 0:0a76ae27065b 4 CPV, 14/09/2009
Clemo 0:0a76ae27065b 5 */
Clemo 0:0a76ae27065b 6
Clemo 0:0a76ae27065b 7
Clemo 0:0a76ae27065b 8 #ifndef __MY_PWM_OUT_H__
Clemo 0:0a76ae27065b 9 #define __MY_PWM_OUT_H__
Clemo 0:0a76ae27065b 10
Clemo 0:0a76ae27065b 11
Clemo 0:0a76ae27065b 12 #include "PwmOut.h"
Clemo 0:0a76ae27065b 13 namespace mbed
Clemo 0:0a76ae27065b 14 {
Clemo 0:0a76ae27065b 15
Clemo 0:0a76ae27065b 16 class MyPwmOut : public PwmOut
Clemo 0:0a76ae27065b 17 {
Clemo 0:0a76ae27065b 18 public:
Clemo 0:0a76ae27065b 19 /* Constructor: PwmOut
Clemo 0:0a76ae27065b 20 * Create a PwmOut connected to the specified pin
Clemo 0:0a76ae27065b 21 *
Clemo 0:0a76ae27065b 22 * Variables:
Clemo 0:0a76ae27065b 23 * pin - PwmOut pin to connect to
Clemo 0:0a76ae27065b 24 */
Clemo 0:0a76ae27065b 25 MyPwmOut(PinName pin, const char *name = NULL);
Clemo 0:0a76ae27065b 26
Clemo 0:0a76ae27065b 27 /* Function: set
Clemo 0:0a76ae27065b 28 * Set the PWM period, specified in seconds (float)
Clemo 0:0a76ae27065b 29 * and the ouput duty-cycle, specified as a percentage (float)
Clemo 0:0a76ae27065b 30 *
Clemo 0:0a76ae27065b 31 * Variables:
Clemo 0:0a76ae27065b 32 * period - A floating-point value representing the output period,
Clemo 0:0a76ae27065b 33 * specified in seconds.
Clemo 0:0a76ae27065b 34 * duty_cycle - A floating-point value representing the output duty-cycle,
Clemo 0:0a76ae27065b 35 * specified as a percentage. The value should lie between
Clemo 0:0a76ae27065b 36 * 0.0f (representing on 0%) and 1.0f (representing on 100%).
Clemo 0:0a76ae27065b 37 * Values outside this range will be saturated to 0.0f or 1.0f.
Clemo 0:0a76ae27065b 38 */
Clemo 0:0a76ae27065b 39 void set(float period, float duty_cycle);
Clemo 0:0a76ae27065b 40
Clemo 0:0a76ae27065b 41 float get_pclk(void);
Clemo 0:0a76ae27065b 42
Clemo 0:0a76ae27065b 43 protected:
Clemo 0:0a76ae27065b 44 float m_pclk;
Clemo 0:0a76ae27065b 45 uint32_t m_channel;
Clemo 0:0a76ae27065b 46 uint32_t *m_p_mrx;
Clemo 0:0a76ae27065b 47 };
Clemo 0:0a76ae27065b 48
Clemo 0:0a76ae27065b 49 } // namespace mbed
Clemo 0:0a76ae27065b 50
Clemo 0:0a76ae27065b 51 #endif // __MY_PWM_OUT_H__