Gruppe 3
/
PES4
xx
Fork of PES1 by
EncoderCounter/EncoderCounter.h@18:6547e54ac803, 2017-05-09 (annotated)
- Committer:
- itslinear
- Date:
- Tue May 09 13:21:49 2017 +0000
- Revision:
- 18:6547e54ac803
f?r holdi;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
itslinear | 18:6547e54ac803 | 1 | /* |
itslinear | 18:6547e54ac803 | 2 | * EncoderCounter.h |
itslinear | 18:6547e54ac803 | 3 | * Copyright (c) 2016, ZHAW |
itslinear | 18:6547e54ac803 | 4 | * All rights reserved. |
itslinear | 18:6547e54ac803 | 5 | */ |
itslinear | 18:6547e54ac803 | 6 | |
itslinear | 18:6547e54ac803 | 7 | #ifndef ENCODER_COUNTER_H_ |
itslinear | 18:6547e54ac803 | 8 | #define ENCODER_COUNTER_H_ |
itslinear | 18:6547e54ac803 | 9 | |
itslinear | 18:6547e54ac803 | 10 | #include <cstdlib> |
itslinear | 18:6547e54ac803 | 11 | #include <mbed.h> |
itslinear | 18:6547e54ac803 | 12 | |
itslinear | 18:6547e54ac803 | 13 | /** |
itslinear | 18:6547e54ac803 | 14 | * This class implements a driver to read the quadrature |
itslinear | 18:6547e54ac803 | 15 | * encoder counter of the STM32 microcontroller. |
itslinear | 18:6547e54ac803 | 16 | */ |
itslinear | 18:6547e54ac803 | 17 | class EncoderCounter { |
itslinear | 18:6547e54ac803 | 18 | |
itslinear | 18:6547e54ac803 | 19 | public: |
itslinear | 18:6547e54ac803 | 20 | |
itslinear | 18:6547e54ac803 | 21 | EncoderCounter(PinName a, PinName b); |
itslinear | 18:6547e54ac803 | 22 | virtual ~EncoderCounter(); |
itslinear | 18:6547e54ac803 | 23 | void reset(); |
itslinear | 18:6547e54ac803 | 24 | void reset(short offset); |
itslinear | 18:6547e54ac803 | 25 | short read(); |
itslinear | 18:6547e54ac803 | 26 | operator short(); |
itslinear | 18:6547e54ac803 | 27 | |
itslinear | 18:6547e54ac803 | 28 | private: |
itslinear | 18:6547e54ac803 | 29 | |
itslinear | 18:6547e54ac803 | 30 | TIM_TypeDef* TIM; |
itslinear | 18:6547e54ac803 | 31 | }; |
itslinear | 18:6547e54ac803 | 32 | |
itslinear | 18:6547e54ac803 | 33 | #endif /* ENCODER_COUNTER_H_ */ |