Pascal Keller
/
GRT_VC_PIDT1
Regler von Kellep15
EncoderCounter.h@2:394782101261, 2019-05-16 (annotated)
- Committer:
- kellep15
- Date:
- Thu May 16 15:34:29 2019 +0000
- Revision:
- 2:394782101261
- Parent:
- 0:05dd1de8cc3f
rEGLER TUT NICHT
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 0:05dd1de8cc3f | 1 | /* |
altb2 | 0:05dd1de8cc3f | 2 | * EncoderCounter.h |
altb2 | 0:05dd1de8cc3f | 3 | * Copyright (c) 2017, ZHAW |
altb2 | 0:05dd1de8cc3f | 4 | * All rights reserved. |
altb2 | 0:05dd1de8cc3f | 5 | */ |
altb2 | 0:05dd1de8cc3f | 6 | |
altb2 | 0:05dd1de8cc3f | 7 | #ifndef ENCODER_COUNTER_H_ |
altb2 | 0:05dd1de8cc3f | 8 | #define ENCODER_COUNTER_H_ |
altb2 | 0:05dd1de8cc3f | 9 | |
altb2 | 0:05dd1de8cc3f | 10 | #include <cstdlib> |
altb2 | 0:05dd1de8cc3f | 11 | #include <mbed.h> |
altb2 | 0:05dd1de8cc3f | 12 | |
altb2 | 0:05dd1de8cc3f | 13 | /** |
altb2 | 0:05dd1de8cc3f | 14 | * This class implements a driver to read the quadrature |
altb2 | 0:05dd1de8cc3f | 15 | * encoder counter of the STM32 microcontroller. |
altb2 | 0:05dd1de8cc3f | 16 | */ |
altb2 | 0:05dd1de8cc3f | 17 | class EncoderCounter { |
altb2 | 0:05dd1de8cc3f | 18 | |
altb2 | 0:05dd1de8cc3f | 19 | public: |
altb2 | 0:05dd1de8cc3f | 20 | |
altb2 | 0:05dd1de8cc3f | 21 | EncoderCounter(PinName a, PinName b); |
altb2 | 0:05dd1de8cc3f | 22 | virtual ~EncoderCounter(); |
altb2 | 0:05dd1de8cc3f | 23 | void reset(); |
altb2 | 0:05dd1de8cc3f | 24 | void reset(short offset); |
altb2 | 0:05dd1de8cc3f | 25 | short read(); |
altb2 | 0:05dd1de8cc3f | 26 | operator short(); |
altb2 | 0:05dd1de8cc3f | 27 | |
altb2 | 0:05dd1de8cc3f | 28 | private: |
altb2 | 0:05dd1de8cc3f | 29 | |
altb2 | 0:05dd1de8cc3f | 30 | TIM_TypeDef* TIM; |
altb2 | 0:05dd1de8cc3f | 31 | }; |
altb2 | 0:05dd1de8cc3f | 32 | |
altb2 | 0:05dd1de8cc3f | 33 | #endif /* ENCODER_COUNTER_H_ */ |
altb2 | 0:05dd1de8cc3f | 34 |