Helvijs Kiselis
/
Micromouse
Algorithmus
EncoderCounter.h@35:5a4e1a87b3da, 2018-06-30 (annotated)
- Committer:
- luethale
- Date:
- Sat Jun 30 09:49:06 2018 +0000
- Revision:
- 35:5a4e1a87b3da
- Parent:
- 1:2b5f79285a3e
Nacht_der_Technik
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Helvis | 1:2b5f79285a3e | 1 | /* |
Helvis | 1:2b5f79285a3e | 2 | * EncoderCounter.h |
Helvis | 1:2b5f79285a3e | 3 | * Copyright (c) 2018, ZHAW |
Helvis | 1:2b5f79285a3e | 4 | * All rights reserved. |
Helvis | 1:2b5f79285a3e | 5 | */ |
Helvis | 1:2b5f79285a3e | 6 | |
Helvis | 1:2b5f79285a3e | 7 | #ifndef ENCODER_COUNTER_H_ |
Helvis | 1:2b5f79285a3e | 8 | #define ENCODER_COUNTER_H_ |
Helvis | 1:2b5f79285a3e | 9 | |
Helvis | 1:2b5f79285a3e | 10 | #include <cstdlib> |
Helvis | 1:2b5f79285a3e | 11 | #include <mbed.h> |
Helvis | 1:2b5f79285a3e | 12 | |
Helvis | 1:2b5f79285a3e | 13 | /** |
Helvis | 1:2b5f79285a3e | 14 | * This class implements a driver to read the quadrature |
Helvis | 1:2b5f79285a3e | 15 | * encoder counter of the STM32 microcontroller. |
Helvis | 1:2b5f79285a3e | 16 | */ |
Helvis | 1:2b5f79285a3e | 17 | class EncoderCounter { |
Helvis | 1:2b5f79285a3e | 18 | |
Helvis | 1:2b5f79285a3e | 19 | public: |
Helvis | 1:2b5f79285a3e | 20 | |
Helvis | 1:2b5f79285a3e | 21 | EncoderCounter(PinName a, PinName b); |
Helvis | 1:2b5f79285a3e | 22 | virtual ~EncoderCounter(); |
Helvis | 1:2b5f79285a3e | 23 | void reset(); |
Helvis | 1:2b5f79285a3e | 24 | void reset(short offset); |
Helvis | 1:2b5f79285a3e | 25 | short read(); |
Helvis | 1:2b5f79285a3e | 26 | operator short(); |
Helvis | 1:2b5f79285a3e | 27 | |
Helvis | 1:2b5f79285a3e | 28 | private: |
Helvis | 1:2b5f79285a3e | 29 | |
Helvis | 1:2b5f79285a3e | 30 | TIM_TypeDef* TIM; |
Helvis | 1:2b5f79285a3e | 31 | }; |
Helvis | 1:2b5f79285a3e | 32 | |
Helvis | 1:2b5f79285a3e | 33 | #endif /* ENCODER_COUNTER_H_ */ |