動作確認済み

Dependents:   NewMD2 NewMD3

Committer:
inst
Date:
Sun Jul 03 01:25:10 2016 +0000
Revision:
2:3d70888e91c6
Parent:
1:b85088467ae0
Child:
3:6cf1d5d38ea3
set??duty????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
inst 0:010c6f6ac7c0 1 #ifndef INCLUDED_GMD_H
inst 0:010c6f6ac7c0 2 #define INCLUDED_GMD_H
inst 0:010c6f6ac7c0 3
inst 0:010c6f6ac7c0 4 #include "mbed.h"
inst 0:010c6f6ac7c0 5 #include "FastPWM.h"
inst 0:010c6f6ac7c0 6
inst 1:b85088467ae0 7 template <size_t MIN, size_t MAX>
inst 0:010c6f6ac7c0 8 class GMD {
inst 0:010c6f6ac7c0 9 public:
inst 0:010c6f6ac7c0 10 GMD(PinName p0, PinName p1, PinName shut_down);
inst 0:010c6f6ac7c0 11 void set_frequency_kHz(float f_kHz);
inst 0:010c6f6ac7c0 12
inst 0:010c6f6ac7c0 13 float operator=(float p);
inst 0:010c6f6ac7c0 14 float set(float p);
inst 0:010c6f6ac7c0 15 void release();
inst 0:010c6f6ac7c0 16
inst 0:010c6f6ac7c0 17 private:
inst 0:010c6f6ac7c0 18 static const float _frequency_to_tick_coeff;
inst 0:010c6f6ac7c0 19 static const uint32_t _default_frequency_kHz;
inst 0:010c6f6ac7c0 20
inst 0:010c6f6ac7c0 21 FastPWM* _pwm[2];
inst 0:010c6f6ac7c0 22 DigitalOut _shut_down;
inst 0:010c6f6ac7c0 23 };
inst 0:010c6f6ac7c0 24
inst 1:b85088467ae0 25 #include "GMD_impl.hpp"
inst 1:b85088467ae0 26
inst 2:3d70888e91c6 27 typedef GMD<20, 80> basic_motor_driver;
inst 1:b85088467ae0 28
inst 0:010c6f6ac7c0 29 #endif