動作確認済み
GMD.hpp@6:d538802e8a4e, 2016-08-11 (annotated)
- Committer:
- inst
- Date:
- Thu Aug 11 04:17:19 2016 +0000
- Revision:
- 6:d538802e8a4e
- Parent:
- 5:b3c1c5db8489
- Child:
- 7:c849d9255551
???
Who changed what in which revision?
User | Revision | Line number | New 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 | 5:b3c1c5db8489 | 27 | typedef GMD<0, 95> basic_motor_driver; |
inst | 1:b85088467ae0 | 28 | |
inst | 0:010c6f6ac7c0 | 29 | #endif |
inst | 6:d538802e8a4e | 30 | |
inst | 6:d538802e8a4e | 31 | |
inst | 6:d538802e8a4e | 32 | |
inst | 6:d538802e8a4e | 33 | |
inst | 6:d538802e8a4e | 34 | |
inst | 6:d538802e8a4e | 35 | |
inst | 6:d538802e8a4e | 36 | |
inst | 6:d538802e8a4e | 37 | |
inst | 6:d538802e8a4e | 38 | |
inst | 6:d538802e8a4e | 39 | |
inst | 6:d538802e8a4e | 40 | |
inst | 6:d538802e8a4e | 41 | |
inst | 6:d538802e8a4e | 42 | |
inst | 6:d538802e8a4e | 43 | |
inst | 6:d538802e8a4e | 44 | |
inst | 6:d538802e8a4e | 45 | |
inst | 6:d538802e8a4e | 46 | |
inst | 6:d538802e8a4e | 47 | |
inst | 6:d538802e8a4e | 48 | |
inst | 6:d538802e8a4e | 49 | |
inst | 6:d538802e8a4e | 50 | |
inst | 6:d538802e8a4e | 51 | |
inst | 6:d538802e8a4e | 52 | |
inst | 6:d538802e8a4e | 53 | |
inst | 6:d538802e8a4e | 54 | |
inst | 6:d538802e8a4e | 55 | |
inst | 6:d538802e8a4e | 56 | |
inst | 6:d538802e8a4e | 57 | |
inst | 6:d538802e8a4e | 58 | |
inst | 6:d538802e8a4e | 59 | |
inst | 6:d538802e8a4e | 60 | |
inst | 6:d538802e8a4e | 61 | |
inst | 6:d538802e8a4e | 62 | |
inst | 6:d538802e8a4e | 63 | /* |
inst | 6:d538802e8a4e | 64 | _ __ / `i |
inst | 6:d538802e8a4e | 65 | /  ̄`丶、 〈 `丶、 / | |
inst | 6:d538802e8a4e | 66 | ヽ /  ̄`丶、丶、 ヽ `丶、 / | |
inst | 6:d538802e8a4e | 67 | \゙、 _ _ ) `丶、 \ / L |
inst | 6:d538802e8a4e | 68 | \  ̄ `ヽ、 l| _゙、-‐./_ _,..‐< ̄ |
inst | 6:d538802e8a4e | 69 | \ < `ヽ、 _ |l_,..- '"´ ヽヽ / 丶、 |
inst | 6:d538802e8a4e | 70 | \ `ヽ、`ヽ、 _, - ''"ヽ_L>、 _ || _,.> 、,_ ヽ、 |
inst | 6:d538802e8a4e | 71 | \ `ヽ、, へ _. l'"_L.-''" / ヽ ノノ' `'‐ 、,_ \ |
inst | 6:d538802e8a4e | 72 | \ハ _, -' "く_∠Ll.-''" l. ノ /´ `' 一' |
inst | 6:d538802e8a4e | 73 | l |、, -'"::\,-, _ l. ‐" ,ニ '" |
inst | 6:d538802e8a4e | 74 | /| l'::::::_,:::::::''":i | _ / |
inst | 6:d538802e8a4e | 75 | rイ_」 ノヽ".:::::::::::::::| | _. 二 -‐< \ |
inst | 6:d538802e8a4e | 76 | , - ‐ァ´ ¨ `、):::::::::::::::/ / `丶、 \ |
inst | 6:d538802e8a4e | 77 | `ー-へ _ _rく:::::::_;:.へく ヽ、 \ |
inst | 6:d538802e8a4e | 78 | └へ\ `丶、 `'< \ |
inst | 6:d538802e8a4e | 79 | ヽ\ `丶、 \ |
inst | 6:d538802e8a4e | 80 | \) | l i`丶、 , -‐- 、\ |
inst | 6:d538802e8a4e | 81 | ノノ | `丶、 l `ヽ \ |
inst | 6:d538802e8a4e | 82 | / / ノ `丶、゙、 ) \ |
inst | 6:d538802e8a4e | 83 | ゙ー ´ `ヽ、ー-‐ '" `、 |
inst | 6:d538802e8a4e | 84 | > 、 _.ノ |
inst | 6:d538802e8a4e | 85 | ´ `  ̄ |
inst | 6:d538802e8a4e | 86 | Our MD was named 'Zeek'! |
inst | 6:d538802e8a4e | 87 | KILL THEM ALL! |
inst | 6:d538802e8a4e | 88 | |
inst | 6:d538802e8a4e | 89 | 二六七六年 葉月 命名 |
inst | 6:d538802e8a4e | 90 | |
inst | 6:d538802e8a4e | 91 | 七六式電動機駆動基板 |
inst | 6:d538802e8a4e | 92 | */ |
inst | 6:d538802e8a4e | 93 | |
inst | 6:d538802e8a4e | 94 | |
inst | 6:d538802e8a4e | 95 | |
inst | 6:d538802e8a4e | 96 | |
inst | 6:d538802e8a4e | 97 | |
inst | 6:d538802e8a4e | 98 | |
inst | 6:d538802e8a4e | 99 | |
inst | 6:d538802e8a4e | 100 | |
inst | 6:d538802e8a4e | 101 | |
inst | 6:d538802e8a4e | 102 | |
inst | 6:d538802e8a4e | 103 | |
inst | 6:d538802e8a4e | 104 | |
inst | 6:d538802e8a4e | 105 | |
inst | 6:d538802e8a4e | 106 | |
inst | 6:d538802e8a4e | 107 | |
inst | 6:d538802e8a4e | 108 | |
inst | 6:d538802e8a4e | 109 | |
inst | 6:d538802e8a4e | 110 | |
inst | 6:d538802e8a4e | 111 | |
inst | 6:d538802e8a4e | 112 | |
inst | 6:d538802e8a4e | 113 | |
inst | 6:d538802e8a4e | 114 | /* |
inst | 6:d538802e8a4e | 115 | Created by T and F... |
inst | 6:d538802e8a4e | 116 | */ |