8 /* addresses of these set at link time
9 * to add more addresses, define them here with buffered_addr_h, in helpers.c
10 * with buffered_addr, and also in LDFLAGS in the Makefile
12 #define buffered_addr(a) \
13 extern volatile u8* _##a; \
15 extern inline void set_##a(u8 b) { a = *_##a = b; } \
16 extern inline void bset_##a(const u8 m) { bset(&a, m); *_##a = a; } \
17 extern inline void bclr_##a(const u8 m) { bclr(&a, m); *_##a = a; }
19 buffered_addr(switch_input);
20 buffered_addr(misc_input);
21 buffered_addr(home_sensors);
22 buffered_addr(changer_output);
23 buffered_addr(misc_output);
25 extern inline void spi_enable() { bset((void*)&_io_ports[M6811_SPCR], M6811_SPE); }
26 extern inline void spi_disable() { bclr((void*)&_io_ports[M6811_SPCR], M6811_SPE); }
28 /******* from helpers.c *******/
31 /******** Some meaningful bits ******/
32 #define PORTA_DISP_RESET 0x80 /* active low */
33 #define PORTA_CHIME 0x10 /* chime is on when set */
34 #define PORTD_KEYPAD_ROW 0x20 /* clear for row 0, set for row 1 */
36 /* Address 3800 bits */
37 #define A3800_DISPLAY_WRITE 0x04
39 /******* from main.c *******/
40 int __attribute__((noreturn)) main (void);
41 void __attribute__((interrupt)) rti (void);