5 #include <config/hardware.h>
7 #define MM_FLAVOR_DRIVE 0
8 #define MM_FLAVOR_SWITCH 1
10 #ifdef MM_USE_REGISTER_VARS
12 uint8_t register shift_command
asm("r2");
13 uint8_t register shift_function
asm("r3");
14 uint8_t register shift_address
asm("r4");
15 uint8_t register mm_polarity
asm("r5");
16 uint8_t register mm_bitno
asm("r6");
17 uint8_t register mm_last_was_short
asm("r8");
18 uint8_t register mm_time_h
asm("r9");
19 uint8_t register mm_time_l
asm("r10");
20 uint8_t register mm_bit_val
asm("r11");
21 uint8_t register mm_flavor
asm("r14");
23 static void inline __attribute((unused
)) mm_init(void)
29 mm_last_was_short
= 0;
41 * mm_switch_command - Callback function!
43 * This function must be defined whenever the mm_switch module is used.
44 * It will be called from interrupt context whenever a new valid command
47 * decoder is in the range from 1 to 25. Other values will not occur.
49 * key is in the range from 0 to 8:
51 * 1 - key1 green pressed
52 * 2 - key1 red pressed
53 * 3 - key2 green pressed
54 * 4 - key2 red pressed
59 void mm_switch_command(uint8_t decoder
, uint8_t key
);
64 void mm_switch_drive_cb(uint8_t address
, uint8_t speed
, uint8_t functions
, uint8_t flags
);
66 void mm_switch_drive(uint8_t decoder
, uint8_t function
, uint8_t command
);
68 void mm_switch_pinchange_callback(void);