/*
 * web_cam.h
 *
 *  Created on: 31.3.2010
 *      Author: hudo
 */

#ifndef WEB_CAM_H_
#define WEB_CAM_H_

//*****************************************************************************
// PRIDANE DEKLARACIE A Premenne
//*****************************************************************************

		//*****************************************************************************
		// RAM FAT struktura
		//*****************************************************************************
		typedef struct
		{
			char					file_name[50];		// Nazov suboru aj z adresarom
			unsigned long			file_type;		// File Type
		   	unsigned long			file_size;		// Overall File size in bytes
			void					*file_pointer;	// Pointer to start data - do not change
			char					locked;			// Flag ci je subor uzavrety

		} RAM_FAT_STRUCT;


		//*****************************************************************************
		// Kamera prikazy a nastavenia
		//*****************************************************************************
		//Inicializacia:
			//Nastavenia farby
			#define _2_gray 		0x01
			#define _4_gray 		0x02
			#define _8_gray 		0x03
			#define _12_color 	0x05
			#define _16_color 	0x06
			#define jpeg 		0x07
			// Rozlisenie preview
			#define _80na60		0x01
			#define _160na120	0x03
			// JPEG rozlisenie
			#define _80na64		0x01
			#define _160na128	0x03
			#define _320na240	0x05
			#define _640na480	0x07
		// Get picture:
			#define snap		0x01
			#define prev		0x02
			#define JPEG_prev	0x05
		// Snapshot:
			#define compress	0x00
			#define uncompress	0x01
		// 	ID cisla
			#define ID_init			0xaa01
			#define ID_get_pic		0xaa04
			#define ID_snap			0xaa05
			#define ID_set_size		0xaa06
			#define ID_set_bd		0xaa07
			#define ID_reset		0xaa08
			#define ID_power_off	0xaa09
			#define ID_data			0xaa0A
			#define ID_ack			0xaa0E
			#define ID_nak			0xaa0F
		// Baudrate
			#define	_57600bd		0x1f01
			#define ID_sync 0xAA0D00000000
			#define size_of_packet 64

#define MAX_POCET_SUBOROV 2 //Maximalny pocet suborov
void form_serial_function2( char *data );
//---------------------------------------------------------------------------------
// MOJA FUNKCIA:
// Funkcia v tasku, ktora nacitava obrazok s kamery a uklada ho do ramky.
void web_kamera_task();
void cam_sync();
int test_cmd_ack(char *cmd1,char *cmd2,int pocet,char cmd);





#endif /* WEB_CAM_H_ */
