シーケンサ内蔵のステッピングモータドライバを制御します。
STM_seq.h@0:f270cfef9a60, 2019-01-10 (annotated)
- Committer:
- Akito914
- Date:
- Thu Jan 10 08:01:00 2019 +0000
- Revision:
- 0:f270cfef9a60
- Child:
- 1:6054a5d05fb3
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Akito914 | 0:f270cfef9a60 | 1 | |
Akito914 | 0:f270cfef9a60 | 2 | #ifndef __STM_SEQ_H__ |
Akito914 | 0:f270cfef9a60 | 3 | #define __STM_SEQ_H__ |
Akito914 | 0:f270cfef9a60 | 4 | |
Akito914 | 0:f270cfef9a60 | 5 | #include "mbed.h" |
Akito914 | 0:f270cfef9a60 | 6 | |
Akito914 | 0:f270cfef9a60 | 7 | |
Akito914 | 0:f270cfef9a60 | 8 | class stepMotor{ |
Akito914 | 0:f270cfef9a60 | 9 | |
Akito914 | 0:f270cfef9a60 | 10 | public: |
Akito914 | 0:f270cfef9a60 | 11 | |
Akito914 | 0:f270cfef9a60 | 12 | stepMotor(PinName pinName_CLK , PinName pinName_DIR , PinName pinName_Sleep , PinName pinName_Fault); |
Akito914 | 0:f270cfef9a60 | 13 | |
Akito914 | 0:f270cfef9a60 | 14 | ~stepMotor(); |
Akito914 | 0:f270cfef9a60 | 15 | |
Akito914 | 0:f270cfef9a60 | 16 | void oneStep(bool direction); |
Akito914 | 0:f270cfef9a60 | 17 | |
Akito914 | 0:f270cfef9a60 | 18 | void setSleep(bool enable); |
Akito914 | 0:f270cfef9a60 | 19 | |
Akito914 | 0:f270cfef9a60 | 20 | bool getSleep(); |
Akito914 | 0:f270cfef9a60 | 21 | |
Akito914 | 0:f270cfef9a60 | 22 | bool getFault(); |
Akito914 | 0:f270cfef9a60 | 23 | |
Akito914 | 0:f270cfef9a60 | 24 | |
Akito914 | 0:f270cfef9a60 | 25 | private: |
Akito914 | 0:f270cfef9a60 | 26 | |
Akito914 | 0:f270cfef9a60 | 27 | DigitalOut pin_CLK; |
Akito914 | 0:f270cfef9a60 | 28 | DigitalOut pin_DIR; |
Akito914 | 0:f270cfef9a60 | 29 | DigitalOut pin_Sleep; |
Akito914 | 0:f270cfef9a60 | 30 | DigitalIn pin_Fault; |
Akito914 | 0:f270cfef9a60 | 31 | |
Akito914 | 0:f270cfef9a60 | 32 | }; |
Akito914 | 0:f270cfef9a60 | 33 | |
Akito914 | 0:f270cfef9a60 | 34 | |
Akito914 | 0:f270cfef9a60 | 35 | #endif |