X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fvend.h;h=d3e6bf3b4876d02b7abcbe89f030409e5b908ef9;hb=2b2e02c163f430f0745e5d7ed081fb7c65f85fc3;hp=a1ea2cccdde32b09432bd58ab8ce090006023410;hpb=45c42e3e9f2149e45f6642ac3fbab9010bc05455;p=uccvend-snackrom.git diff --git a/ROM2/vend.h b/ROM2/vend.h index a1ea2cc..d3e6bf3 100644 --- a/ROM2/vend.h +++ b/ROM2/vend.h @@ -28,24 +28,33 @@ extern volatile u8 _home_sensors; /******* from helpers.c *******/ void delay(u16 ms); +void print_amount(u16 amt); /******** Some meaningful bits ******/ -#define PORTA_DISP_RESET 0x80 /* active low */ #define PORTA_CHIME 0x10 /* chime is on when set */ +#define PORTA_MOTOR_COL_DISABLE 0x40 +#define PORTA_DISP_RESET 0x80 /* active low */ + #define PORTD_KEYPAD_ROW 0x20 /* clear for row 0, set for row 1 */ +#define PORTE_MOTOR_OVERVOLTAGE 0x02 + +/* Address 3000 bits */ +#define A3000_MOTOR_ROW_ENABLE 0x80 + /* Address 1800 bits */ #define A1800_DOOR_OPEN 0x20 /* Address 3800 bits */ #define A3800_DISPLAY_WRITE 0x04 +#define A3800_MOTOR_COL8_ENABLE 0x20 +#define A3800_MOTOR_COL9_ENABLE 0x40 /******* from main.c *******/ int __attribute__((noreturn)) main (void); void __attribute__((interrupt)) rti (void); /* other one liners */ - extern inline bool door_open() { return switch_input & A1800_DOOR_OPEN; } extern inline void spi_enable() { bset((void*)&_io_ports[M6811_SPCR], M6811_SPE); } extern inline void spi_disable() { bclr((void*)&_io_ports[M6811_SPCR], M6811_SPE); }