
Example project
Dependencies: PM2_Libary Eigen
Diff: EncoderCounterROME2.h
- Revision:
- 37:698d6b73b50c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EncoderCounterROME2.h Tue May 10 10:04:51 2022 +0200 @@ -0,0 +1,33 @@ +/* + * EncoderCounterROME2.h + * Copyright (c) 2022, ZHAW + * All rights reserved. + */ + +#ifndef ENCODER_COUNTER_ROME2_H_ +#define ENCODER_COUNTER_ROME2_H_ + +#include <cstdlib> +#include <mbed.h> + +/** + * This class implements a driver to read the quadrature + * encoder counter of the STM32 microcontroller. + */ +class EncoderCounterROME2 { + + public: + + EncoderCounterROME2(PinName a, PinName b); + virtual ~EncoderCounterROME2(); + void reset(); + void reset(short offset); + short read(); + operator short(); + + private: + + TIM_TypeDef* TIM; +}; + +#endif /* ENCODER_COUNTER_ROME2_H_ */