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