ddd
Fork of stepper by
a4988.h@0:173936452e07, 2018-05-02 (annotated)
- Committer:
- glintligo
- Date:
- Wed May 02 10:48:23 2018 +0000
- Revision:
- 0:173936452e07
- Child:
- 1:88f743f3e7a7
fsdaf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
glintligo | 0:173936452e07 | 1 | #ifndef __A4988_H |
glintligo | 0:173936452e07 | 2 | #define __A4988_H |
glintligo | 0:173936452e07 | 3 | #endif |
glintligo | 0:173936452e07 | 4 | |
glintligo | 0:173936452e07 | 5 | #include "mbed.h" |
glintligo | 0:173936452e07 | 6 | //class Stepper; |
glintligo | 0:173936452e07 | 7 | //typedef void (Stepper::*pClassFun)(); |
glintligo | 0:173936452e07 | 8 | class Stepper |
glintligo | 0:173936452e07 | 9 | { |
glintligo | 0:173936452e07 | 10 | public: |
glintligo | 0:173936452e07 | 11 | Stepper(PinName _en,PinName _stepPin, PinName _direction); |
glintligo | 0:173936452e07 | 12 | void step(int dir, int frequency ,volatile int _remain); |
glintligo | 0:173936452e07 | 13 | void enable(); |
glintligo | 0:173936452e07 | 14 | void disable(); |
glintligo | 0:173936452e07 | 15 | private: |
glintligo | 0:173936452e07 | 16 | DigitalOut en; |
glintligo | 0:173936452e07 | 17 | DigitalOut stepPin; |
glintligo | 0:173936452e07 | 18 | DigitalOut direction; |
glintligo | 0:173936452e07 | 19 | volatile int remain; |
glintligo | 0:173936452e07 | 20 | Ticker step_ticker; |
glintligo | 0:173936452e07 | 21 | void step_control(); |
glintligo | 0:173936452e07 | 22 | // pClassFun fun; |
glintligo | 0:173936452e07 | 23 | }; |