PM2_Lib

Dependencies:   LSM9DS1 RangeFinder FastPWM

Committer:
pmic
Date:
Tue Apr 06 11:21:54 2021 +0000
Revision:
4:9c003c402033
Parent:
0:86129f1b4a93
Update Libary via copy+past, no idea why it is not working via mbed studio.

Who changed what in which revision?

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