/*
 * uart.h
 *
 * Created: 14.3.2015 23:04:51
 *  Author: Matej
 */ 


#ifndef UART_H_
#define UART_H_

#include "CRC.h"
#include "global.h"
#include "matrix.h"

/*
* Define transmit CMD
*/
#define ACK	0xA0
#define NAK	0x05
/*
* Define recive packet CMD
*/
#define DATA	0x18
#define CMD		0x81


unsigned char checkPNO(unsigned char packetNumber);
unsigned char checkCMD(unsigned char command);
unsigned char checkLENGTH(unsigned char length);
unsigned char checkCRC(unsigned char crcMSB, unsigned char crcLSB);
unsigned char checkPACKET(void);
unsigned char doAnswer(void);
void setGlobalDataCmd(void);
void clearBuffer(unsigned char buff[], unsigned char size);

#endif /* UART_H_ */