Telescope Control Library

Dependents:   PushToGo-F429

Revision:
0:6cb2eaf8b133
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AbsEncoder.h	Sun Aug 19 05:21:20 2018 +0000
@@ -0,0 +1,39 @@
+/*
+ * GenericAbsEncoder.h
+ *
+ *	Interface for reading position from an absolute encoder
+ *
+ *  Created on: 2018/2/7
+ *      Author: caoyuan9642
+ */
+
+#ifndef TELESCOPE_ABSENCODER_H_
+#define TELESCOPE_ABSENCODER_H_
+
+#include <stdint.h>
+/**
+* Interface of a generic Absolute Encoder
+*/
+template<uint32_t maxCount>
+class AbsEncoder
+{
+public:
+	AbsEncoder(){
+	}
+	virtual ~AbsEncoder(){
+	}
+
+	virtual uint32_t readPos() = 0;
+	virtual void zero()
+	{
+	}
+
+	uint32_t getMaxCount() const
+	{
+		return maxCount;
+	}
+};
+
+#endif /* TELESCOPE_ABSENCODER_H_ */
+
+