encoder_tables_in_c
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | encoder_tables_in_c [2008/07/25 14:09] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Encoder Tables in C Applications ====== | ||
+ | |||
+ | ===== makefile ===== | ||
+ | |||
+ | Add the " | ||
+ | <code make> | ||
+ | # pass parameters to MIOS wrapper | ||
+ | MIOS_WRAPPER_DEFINES = -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f \ | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ===== main.c ===== | ||
+ | |||
+ | Add your table as such: | ||
+ | <code c> | ||
+ | ///////////////////////////////////////////////////////////////////////////// | ||
+ | // Application specific encoder table | ||
+ | // the default (dummy) table has been disabled via -DDONT_INCLUDE_MIOS_ENC_TABLE | ||
+ | ///////////////////////////////////////////////////////////////////////////// | ||
+ | MIOS_ENC_TABLE { | ||
+ | // sr pin mode | ||
+ | MIOS_ENC_ENTRY(1, | ||
+ | MIOS_ENC_EOT | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | ===== Reference ===== | ||
+ | |||
+ | Taken from mios wrapper | ||
+ | |||
+ | <code asm> | ||
+ | ;; ---[ configuration table for rotary encoders ]--- | ||
+ | #ifndef DONT_INCLUDE_MIOS_ENC_TABLE | ||
+ | ;; dummy table located in $MIOS_PATH/ | ||
+ | ;; If the application should use ENC entries, | ||
+ | ;; just add " | ||
+ | ;; and build the table within the C program with: | ||
+ | ;; | ||
+ | ;; MIOS_ENC_TABLE { | ||
+ | ;; // sr pin mode | ||
+ | ;; | ||
+ | ;; | ||
+ | ;; | ||
+ | ;; | ||
+ | ;; }; | ||
+ | ;; | ||
+ | ;; The MIOS_MT_* macros are defined in $MIOS_PATH/ | ||
+ | #include < | ||
+ | #endif | ||
+ | </ | ||
+ | |||
+ | Check out the clockbox app for a real world example. | ||
+ | |||
+ | Enjoy! |
encoder_tables_in_c.txt · Last modified: 2008/07/25 14:09 by 127.0.0.1