#ifndef __COMMON_H_
#define __COMMON_H_

#include <stdint.h>

typedef union bword
{
	uint16_t	w;
	int16_t		sw;
	uint8_t		lb;
	int8_t		slb;
	uint8_t		b[2];
	int8_t		sb[2];
} bword_t;

typedef enum mb_error_codes_enum
{
	MB_ERROR_NOTHING              = 0,
	MB_ERROR_TIMEOUT              = 1,
	MB_ERROR_CRC                  = 2,
	MB_ERROR_SLAVE_ADRESS         = 3,
	MB_ERROR_FUNCTION_CODE        = 4,
	MB_ERROR_BYTE_COUNT           = 5,
	MB_ERROR_START_ADRESS         = 6,
	MB_ERROR_UART_PE              = 7,											//Parity
	MB_ERROR_UART_NE              = 8,											//Noise
	MB_ERROR_UART_FE              = 9,											//Frame
	MB_ERROR_UART_ORE             = 10,											//Overrun
}
mb_error_codes_t;

#endif	// __COMMON_H_
