]> oss.titaniummirror.com Git - rgblamp.git/blobdiff - tmr_defs.h
Incorporate new tmr and isr code
[rgblamp.git] / tmr_defs.h
diff --git a/tmr_defs.h b/tmr_defs.h
new file mode 100644 (file)
index 0000000..34ffda5
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * File:   tmr_defs.h
+ *
+ * User defines this file to create the timers it wishes.  This is a
+ * generic template.
+ */
+
+
+#ifndef _TMR_DEFS_H
+#define _TMR_DEFS_H
+
+/* Define the timers to use.  Last enum, TIMER_COUNT, is used by the
+ * tmr module to know the number of timers and allocate resources
+ * accordingly.
+ */
+enum {
+  TMR_AUTO_ONOFF = 0,
+  TMR_FADE,
+  TMR_DIM,
+  TMR_BTN,
+  TMR_ROCKER,
+
+  TMR_COUNT
+};
+
+/* The tmr module can support unsigned and unsigned long tmr_time_t.
+ * tmr_time_t is the timer value, which is incremented by one for
+ * each tick using Timer0.  When transitioned to Timer1, it will be
+ * the value of TMR1, likely extended to a larger width in software.
+ */
+typedef unsigned long tmr_time_t;
+
+/* The tmr module can support unsigned char, unsigned, and unsigned long
+ * tmr_bit_t.  The number of bits in tmr_bit_t must be >= TIMER_COUNT, as
+ * this type allocates a bit to each virtual timer.
+ */
+typedef unsigned char tmr_bitno_t;
+
+#endif