Template for group 4

Dependencies:   mbed

Fork of RT2_P3_students by RT2_P3_students

Committer:
altb
Date:
Fri Apr 27 06:34:29 2018 +0000
Revision:
10:85840c065e00
Parent:
0:78ca29b4c49e
group 4, 1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
altb 0:78ca29b4c49e 1 /*
altb 0:78ca29b4c49e 2 * EncoderCounter.h
altb 0:78ca29b4c49e 3 * Copyright (c) 2017, ZHAW
altb 0:78ca29b4c49e 4 * All rights reserved.
altb 0:78ca29b4c49e 5 */
altb 0:78ca29b4c49e 6
altb 0:78ca29b4c49e 7 #ifndef ENCODER_COUNTER_H_
altb 0:78ca29b4c49e 8 #define ENCODER_COUNTER_H_
altb 0:78ca29b4c49e 9
altb 0:78ca29b4c49e 10 #include <cstdlib>
altb 0:78ca29b4c49e 11 #include <mbed.h>
altb 0:78ca29b4c49e 12
altb 0:78ca29b4c49e 13 /**
altb 0:78ca29b4c49e 14 * This class implements a driver to read the quadrature
altb 0:78ca29b4c49e 15 * encoder counter of the STM32 microcontroller.
altb 0:78ca29b4c49e 16 */
altb 0:78ca29b4c49e 17 class EncoderCounter {
altb 0:78ca29b4c49e 18
altb 0:78ca29b4c49e 19 public:
altb 0:78ca29b4c49e 20
altb 0:78ca29b4c49e 21 EncoderCounter(PinName a, PinName b);
altb 0:78ca29b4c49e 22 virtual ~EncoderCounter();
altb 0:78ca29b4c49e 23 void reset();
altb 0:78ca29b4c49e 24 void reset(short offset);
altb 0:78ca29b4c49e 25 short read();
altb 0:78ca29b4c49e 26 operator short();
altb 0:78ca29b4c49e 27
altb 0:78ca29b4c49e 28 private:
altb 0:78ca29b4c49e 29
altb 0:78ca29b4c49e 30 TIM_TypeDef* TIM;
altb 0:78ca29b4c49e 31 };
altb 0:78ca29b4c49e 32
altb 0:78ca29b4c49e 33 #endif /* ENCODER_COUNTER_H_ */