#ifndef _ORCUTILS_H
#define _ORCUTILS_H

#include "orcd.h"

unsigned char checksum(void *c, int len);
unsigned char checksum(unsigned char chk, void *cin, int len);

void lcdHome(orcd_t *o);
void lcdFill(orcd_t *o, unsigned char a, unsigned char b);

void lcdPrint(orcd_t *o, int x, int y, char font, const char *format, ...);
void lcdTopPrint(orcd_t *o, int x, const char *format, ...);
void lcdRawWrite(orcd_t *o, int x, int y, char *buf, int buflen);
void lcdConsole(orcd_t *o, const char *format, ...);
void lcdConsoleGoto(orcd_t *o, int x, int y);

int keyPoll(orcd_t *orcd);
int keyWait(orcd_t *orcd);

void getMasterData(orcd_t *o);

#define KEY_UP 1
#define KEY_RIGHT 2
#define KEY_DOWN 3
#define KEY_LEFT 4
#define KEY_STICK 8
#define KEY_MENU 16
#define KEY_EXIT 32

#define HOSTMASTER 0x00
#define HOSTSLAVE  0x40
#define HOSTLCD    0x80


#endif
