#ifndef __COMUNICATION_H
#define __COMUNICATION_H

/**
 *
 */

#include "stdint.h"

#define MASKMES 0XF0

#define STATUS	 	0x00

#define WRITEACTUA	0x20

#define WRITEVENTIL	0x40
#define ACKERREUR	0x50
#define RESERVE2	0X60
#define DELAYBRASS	0x70
#define SYNCRTC		0x80

#define MASKOSMOLATEUR1	0x08
#define MASKOSMOLATEUR2	0x04
#define MASKSUP12V1		0x02
#define MASKSUP12V2		0x01
#define MASKBRASSAGE1	0x80
#define MASKBRASSAGE2	0x40
#define MASKCHAUFFAGE	0x20
#define MASKECUMEUR		0x10
#define	MASKRAH			0x08
#define MASKREMONTER	0x04
#define	MASK230V1		0x02
#define	MASK230V2		0x01

#define MASKDELAYBRASS	0x0F

#define MASKOSMO2TIMER 	0x02
#define MASKOSMO2ACTI	0x01

#define MASKVENT1		0x0F
#define MASKVENT2		0xF0
#define MASKVENT3		0x0F

extern uint8_t g_DBrassage;
extern uint8_t gl_osmo1,gl_osmo2;
extern uint16_t adcBuffer[3];

uint8_t Com_dispactch(uint8_t* mes);

void Com_Status();

void Com_WriteActuator(uint8_t* mes);

void Com_WriteVentil(uint8_t* mes);

void Com_ACKErreur(uint8_t* mes);

void Com_2Osmolateur(uint8_t* mes);

void Com_delayBrassage(uint8_t* mes);

void Com_SyncRTC(uint8_t* mes);

#endif

