Miscellaneous Library, read Encoder etc.

Dependents:   My_Libraries

Committer:
altb
Date:
Wed Mar 06 14:38:04 2019 +0000
Revision:
2:1c5c71a6fac9
Parent:
0:3312872854c4
.....

Who changed what in which revision?

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