41 lines
1,010 B
C
41 lines
1,010 B
C
#ifndef _TABBY_PRINTER_H
|
|
#define _TABBY_PRINTER_H
|
|
|
|
#define TABBY_PRINTER_MAX_PACKET_SIZE 640
|
|
|
|
typedef enum {
|
|
TABBY_PRINTER_LOWBAT = (1 << 7),
|
|
TABBY_PRINTER_ER2 = (1 << 6),
|
|
TABBY_PRINTER_ER1 = (1 << 5),
|
|
TABBY_PRINTER_ER0 = (1 << 4),
|
|
TABBY_PRINTER_UNTRAN = (1 << 3),
|
|
TABBY_PRINTER_FULL = (1 << 2),
|
|
TABBY_PRINTER_BUSY = (1 << 1),
|
|
TABBY_PRINTER_SUM = (1 << 0)
|
|
} tabby_printer_status;
|
|
|
|
/*
|
|
* Data definitions for packets sent from Game Boy to printer
|
|
*/
|
|
typedef struct _tabby_printer_packet {
|
|
union {
|
|
struct {
|
|
uint8_t preamble[2],
|
|
type,
|
|
compression;
|
|
|
|
uint16_t size;
|
|
};
|
|
|
|
uint8_t data[6];
|
|
};
|
|
} tabby_printer_packet;
|
|
|
|
/*
|
|
* Methods for communicating with Game Boy as a printer
|
|
*/
|
|
int tabby_printer_packet_recv(int fd, tabby_printer_packet *header,
|
|
void *body,
|
|
uint16_t *checksum);
|
|
|
|
#endif /* _TABBY_PRINTER_H */
|