Erste version der Software für der Prototyp

Committer:
borlanic
Date:
Thu Mar 29 07:02:09 2018 +0000
Revision:
0:380207fcb5c1
Encoder, IMU --> OK; Controller --> in bearbeitung

Who changed what in which revision?

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