summaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/c_input.h
diff options
context:
space:
mode:
authorNicolas Schodet2009-10-18 23:32:54 +0200
committerNicolas Schodet2010-08-19 23:23:56 +0200
commitba78bd9ba834260d035a9830726afc34fdad2a15 (patch)
tree01f85348fef84daea81f012b57d8ba5b602d5726 /AT91SAM7S256/Source/c_input.h
import firmware from LEGO v1.05lego-1.05
Diffstat (limited to 'AT91SAM7S256/Source/c_input.h')
-rw-r--r--AT91SAM7S256/Source/c_input.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/AT91SAM7S256/Source/c_input.h b/AT91SAM7S256/Source/c_input.h
new file mode 100644
index 0000000..dfa981b
--- /dev/null
+++ b/AT91SAM7S256/Source/c_input.h
@@ -0,0 +1,53 @@
+//
+// Date init 14.12.2004
+//
+// Revision date $Date:: 16-05-06 10:06 $
+//
+// Filename $Workfile:: c_input.h $
+//
+// Version $Revision:: 9 $
+//
+// Archive $Archive:: /LMS2006/Sys01/Main/Firmware/Source/c_input.h $
+//
+// Platform C
+//
+
+#ifndef C_INPUT
+#define C_INPUT
+
+#ifdef INCLUDE_OS
+extern const HEADER cInput;
+#endif
+
+#include "c_input.iom"
+
+#define ACTUAL_AD_RES 1023L
+#define SENSOR_RESOLUTION 1023L
+#define DEBOUNCERELOAD 100
+#define THRESHOLD_FALSE (UWORD)(ACTUAL_AD_RES * 45L / 100L)
+#define THRESHOLD_TRUE (UWORD)(ACTUAL_AD_RES * 55L / 100L)
+
+#define ANGLELIMITA (UWORD)(ACTUAL_AD_RES * 4400L / 10000L)
+#define ANGLELIMITB (UWORD)(ACTUAL_AD_RES * 6600L / 10000L)
+#define ANGLELIMITC (UWORD)(ACTUAL_AD_RES * 8900L / 10000L)
+
+#define FWDDIR 1
+#define RWDDIR 2
+#define MAXSAMPLECNT 5
+
+typedef struct
+{
+ UWORD InvalidTimer[NO_OF_INPUTS];
+ UBYTE InputDebounce[NO_OF_INPUTS];
+ UBYTE EdgeCnt[NO_OF_INPUTS];
+ UBYTE LastAngle[NO_OF_INPUTS];
+ UBYTE OldSensorType[NO_OF_INPUTS];
+ UBYTE SampleCnt[NO_OF_INPUTS];
+}VARSINPUT;
+
+void cInputInit(void* pHeader);
+void cInputCtrl(void);
+void cInputExit(void);
+
+
+#endif