動作確認済み

Dependents:   NewMD2 NewMD3

GMD.hpp

Committer:
inst
Date:
2016-08-11
Revision:
6:d538802e8a4e
Parent:
5:b3c1c5db8489
Child:
7:c849d9255551

File content as of revision 6:d538802e8a4e:

#ifndef INCLUDED_GMD_H
#define INCLUDED_GMD_H

#include "mbed.h"
#include "FastPWM.h"

template <size_t MIN, size_t MAX>
class GMD {
public:
    GMD(PinName p0, PinName p1, PinName shut_down);
    void set_frequency_kHz(float f_kHz);
    
    float operator=(float p);
    float set(float p);
    void release();
    
private:
    static const float _frequency_to_tick_coeff;
    static const uint32_t _default_frequency_kHz;

    FastPWM* _pwm[2];
    DigitalOut _shut_down;
};

#include "GMD_impl.hpp"

typedef GMD<0, 95> basic_motor_driver;

#endif

































/*
       _                              __             / `i
      /    ̄`丶、                        〈 `丶、       /  |
       ヽ /  ̄`丶、丶、                       ヽ    `丶、  /    |
       \゙、 _   _ ) `丶、                     \     /     L
         \  ̄        `ヽ、             l|     _゙、-‐./_ _,..‐< ̄
          \          < `ヽ、         _ |l_,..- '"´ ヽヽ /       丶、
           \       `ヽ、`ヽ、  _, - ''"ヽ_L>、 _   || _,.> 、,_      ヽ、
                 \          `ヽ、, へ _. l'"_L.-''"  / ヽ  ノノ'        `'‐ 、,_  \
                 \ハ     _, -' "く_∠Ll.-''"       l.  ノ /´            `' 一'
                l |、, -'"::\,-, _ l. ‐"        ,ニ '"
                  /| l'::::::_,:::::::''":i |         _ /
                  rイ_」 ノヽ".:::::::::::::::|  | _. 二 -‐<  \
           , - ‐ァ´ ¨ `、):::::::::::::::/ /         `丶、 \
             `ー-へ _ _rく:::::::_;:.へく               ヽ、  \
                 └へ\     `丶、           `'< \
                     ヽ\         `丶、              \
                       \)         | l i`丶、      , -‐- 、\
                              ノノ |    `丶、   l      `ヽ \
                            / / ノ      `丶、゙、       )  \
                            ゙ー ´             `ヽ、ー-‐ '"     `、
                                             > 、    _.ノ
                                           ´   `  ̄
    Our MD was named 'Zeek'!
    KILL THEM ALL!
    
    二六七六年 葉月 命名
    
    七六式電動機駆動基板
*/





















/*
    Created by T and F...
*/