#define _VEND_H_
#include "ports.h"
-
-/* FIXME: are these typedefs right for m68hc11-gcc? */
-typedef unsigned char u8;
-typedef signed char s8;
-typedef unsigned short u16;
-typedef signed short s16;
-typedef unsigned long u32;
-typedef signed long s32;
-typedef u8 bool;
-typedef u16 addr_t;
+#include "types.h"
+#include "asm.h"
/* addresses of these set at link time */
/* to add more addresses, define them here with buffered_addr_h, in helpers.c
* with buffered_addr, and also in LDFLAGS in the Makefile
*/
-#define buffered_addr_h(a) \
+#define buffered_addr(a) \
extern volatile u8* _##a; \
- extern inline void set_##a(u8 b); \
- extern inline void bset_##a(u8 m); \
- extern inline void bclr_##a(u8 m); \
-
-buffered_addr_h(switch_input);
-buffered_addr_h(misc_input);
-buffered_addr_h(home_sensors);
-buffered_addr_h(changer_output);
-buffered_addr_h(misc_output);
-
-void spi_enable();
-void spi_disable();
-
-/******* from display.c *******/
+ u8 a; \
+ extern inline void set_##a(u8 b) { a = *_##a = b; } \
+ extern inline void bset_##a(u8 m) { a |= m; *_##a = a; } \
+ extern inline void bclr_##a(u8 m) { a &= ~m ; *_##a = a; }
-/* scrolling modes */
-#define WRAP_SCROLL_L 1 /* scroll to the left */
-#define WRAP_SCROLL_R 2 /* scroll to the right */
-#define WRAP_ALTERNATE 3 /* alternate between text */
+buffered_addr(switch_input);
+buffered_addr(misc_input);
+buffered_addr(home_sensors);
+buffered_addr(changer_output);
+buffered_addr(misc_output);
-extern char current_message[256];
+extern inline void spi_enable() { _io_ports[M6811_SPCR] |= M6811_SPE; }
+extern inline void spi_disable() { _io_ports[M6811_SPCR] &= ~M6811_SPE; }
-void display_init();
-void set_msg(char* newmsg);
-void set_wrap_mode(u8 new_wrap_mode);
-void display_refresh();
+/******* from helpers.c *******/
void delay(u16 ms);