diff --git a/avr/send.c b/avr/send.c index 96590ee..aa65eb3 100644 --- a/avr/send.c +++ b/avr/send.c @@ -12,20 +12,10 @@ static tabby_printer_response response; static uint8_t body[TABBY_PRINTER_PACKET_MAX_SIZE]; +static uint8_t sheet[TABBY_PRINTER_SHEET_SIZE]; + static uint16_t sum; -/* - * So like, we're abusing pins here. So badly, it's beyond. So here's - * what's going down: We want to retain the same physical I/O connections - * between both the sending and receiving flavors of the whole Game Boy - * Printer endeavor, and that mean/s that we must absolutely bit bang MOSI - * and MISO opposite from their ordinary roles. The reason being: There is - * no notion of MISO or MOSI from the Game Boy's (nor its peripherals') - * point of view. The SI and SO pins over a link cable are crossed over, so - * SI on one end always connects to SO on the other, and vice-versa. The SI - * and SO pins do not switch roles based on role, unlike on AVR SPI - * implementations. - */ static void spi_init() { SC_OUTPUT(); SO_OUTPUT(); diff --git a/include/tabby/avr.h b/include/tabby/avr.h index 1b1d5bb..733d3eb 100644 --- a/include/tabby/avr.h +++ b/include/tabby/avr.h @@ -1,6 +1,19 @@ #ifndef _TABBY_AVR_H #define _TABBY_AVR_H +/* + * So like, we're abusing pins here. So badly, it's beyond. So here's + * what's going down: We want to retain the same physical I/O connections + * between both the sending and receiving flavors of the whole Game Boy + * Printer endeavor, and that mean/s that we must absolutely bit bang MOSI + * and MISO opposite from their ordinary roles. The reason being: There is + * no notion of MISO or MOSI from the Game Boy's (nor its peripherals') + * point of view. The SI and SO pins over a link cable are crossed over, so + * SI on one end always connects to SO on the other, and vice-versa. The SI + * and SO pins do not switch roles based on role, unlike on AVR SPI + * implementations. + */ + #define SPI_PULSE_USEC 61 /*