trennfix/sw: Single timer version
[eisenbahn.git] / trennfix / sw / mm_switch.h
diff --git a/trennfix/sw/mm_switch.h b/trennfix/sw/mm_switch.h
new file mode 100644 (file)
index 0000000..c307766
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef MM_SWITCH_H
+#define MM_SWITCH_H
+
+#include <stdint.h>
+
+/*
+ * mm_switch_command - Callback function!
+ *
+ * This function must be defined whenever the mm_switch module is used.
+ * It will be called from interrupt context whenever a new valid command
+ * has arrived.
+ *
+ * decoder is in the range from 1 to 25. Other values will not occur.
+ * 
+ * key is in the range from 0 to 8:
+ *
+ *   1 - key1 green pressed
+ *   2 - key1 red pressed
+ *   3 - key2 green pressed
+ *   4 - key2 red pressed
+ *   ...
+ *   0 - all keys up
+ * 
+ */
+void mm_switch_command(uint8_t decoder, uint8_t key);
+
+void mm_pinchange_handler(void);
+
+void mm_init(void);
+
+
+
+
+
+#endif