![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
mit pathdingsbums
Dependencies: mbed
Fork of MicroMouse_MASTER_TWO by
EncoderCounter.h@8:1c8a747c49c8, 2018-05-16 (annotated)
- Committer:
- TheDarkDurzo
- Date:
- Wed May 16 12:15:23 2018 +0000
- Revision:
- 8:1c8a747c49c8
- Parent:
- 1:d9e840c48b1e
mit pathfinding
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ruesipat | 0:a9fe4ef404bf | 1 | /* |
ruesipat | 0:a9fe4ef404bf | 2 | * EncoderCounter.h |
ruesipat | 0:a9fe4ef404bf | 3 | * Copyright (c) 2018, ZHAW |
ruesipat | 0:a9fe4ef404bf | 4 | * All rights reserved. |
ruesipat | 0:a9fe4ef404bf | 5 | */ |
ruesipat | 0:a9fe4ef404bf | 6 | |
ruesipat | 0:a9fe4ef404bf | 7 | #ifndef ENCODER_COUNTER_H_ |
ruesipat | 0:a9fe4ef404bf | 8 | #define ENCODER_COUNTER_H_ |
ruesipat | 0:a9fe4ef404bf | 9 | |
ruesipat | 0:a9fe4ef404bf | 10 | #include <cstdlib> |
ruesipat | 0:a9fe4ef404bf | 11 | #include <mbed.h> |
ruesipat | 0:a9fe4ef404bf | 12 | |
ruesipat | 0:a9fe4ef404bf | 13 | /** |
ruesipat | 0:a9fe4ef404bf | 14 | * This class implements a driver to read the quadrature |
ruesipat | 0:a9fe4ef404bf | 15 | * encoder counter of the STM32 microcontroller. |
ruesipat | 0:a9fe4ef404bf | 16 | */ |
ruesipat | 1:d9e840c48b1e | 17 | class EncoderCounter |
ruesipat | 1:d9e840c48b1e | 18 | { |
ruesipat | 1:d9e840c48b1e | 19 | |
ruesipat | 1:d9e840c48b1e | 20 | public: |
ruesipat | 1:d9e840c48b1e | 21 | |
ruesipat | 1:d9e840c48b1e | 22 | EncoderCounter(PinName a, PinName b); |
ruesipat | 1:d9e840c48b1e | 23 | virtual ~EncoderCounter(); |
ruesipat | 1:d9e840c48b1e | 24 | void reset(); |
ruesipat | 1:d9e840c48b1e | 25 | void reset(short offset); |
ruesipat | 1:d9e840c48b1e | 26 | short read(); |
ruesipat | 1:d9e840c48b1e | 27 | operator short(); |
ruesipat | 1:d9e840c48b1e | 28 | |
ruesipat | 1:d9e840c48b1e | 29 | private: |
ruesipat | 1:d9e840c48b1e | 30 | |
ruesipat | 1:d9e840c48b1e | 31 | TIM_TypeDef* TIM; |
ruesipat | 0:a9fe4ef404bf | 32 | }; |
ruesipat | 0:a9fe4ef404bf | 33 | |
ruesipat | 0:a9fe4ef404bf | 34 | #endif /* ENCODER_COUNTER_H_ */ |