/ Mbed 2 deprecated Rome_P1

Dependencies:   mbed

Committer:
wengefa1
Date:
Wed Feb 26 14:20:16 2020 +0000
Revision:
2:f381fc3a8eaf
Motor Controller added

Who changed what in which revision?

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