X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=boards%2F__serial.h;fp=boards%2F__serial.h;h=05ebb3f2acc807e838c8bea3a3ab87c322bfe620;hp=0000000000000000000000000000000000000000;hb=43725da7349c85fa13e828fdbf20cc7ac8d298d6;hpb=386f5371eb984fb9c2860c83e740890a75cd45c1 diff --git a/boards/__serial.h b/boards/__serial.h new file mode 100644 index 0000000..05ebb3f --- /dev/null +++ b/boards/__serial.h @@ -0,0 +1,21 @@ +#ifndef __SERIAL_H +#define __SERIAL_H + +#include +#include +#include "../types.h" + +void SendCmd(uint8 *cmd, int size); +int ReadResp(uint8 *resp, int size); + +#define SEND(cmd) SendCmd((uint8 *)&cmd[0], sizeof(cmd)) +#define GET(buf, size) ReadResp((uint8 *)&buf, size) +#define SENDGET(cmd, buf, size) SEND(cmd); GET(buf, size) + +BOOL SerialOpen(int port, int baud); +void SerialClose(void); +BOOL SerialSendChar(int c); +int SerialIsOpen(void); +int SerialGetChar(void); + +#endif