#ifndef IDIBUS_1XGEN_H_
#define IDIBUS_1XGEN_H_

#include "IdiBusSlave.h"

typedef struct {
	uint8_t first_mode_time;
	uint16_t first_mode_pwm_value;
	uint8_t first_mode_f;
	uint8_t first_mode_invert;
	//uint8_t first_mode_R1;
	
	uint8_t second_mode_time;
	uint16_t second_mode_pwm_value;
	uint8_t second_mode_f;
	uint8_t second_mode_invert;
	//uint8_t second_mode_R1;
} Inputs;

enum IDIBUS_1xGen_MODULE_DEVICES_LIST {
	IDIBUS_1xGen_DEV = 0x00,
	IDIBUS_1xGen_DEVICES_NUMBER
};

typedef struct {
	uint8_t RXlen;
	uint8_t RXbuf[255];
	uint8_t MMES_Error;  //	Last error
} IDIBUS_1xGEN_DATA_TYPE;

class IdiBus_1xGen : public IdiBusSlave {
	public:
		IdiBus_1xGen (IdiBusSerialLine *SlaveLine, uint8_t SlaveAddress);
		IdiBus_1xGen();
		
		uint8_t start_SPI(uint8_t *buf);
		uint8_t reset_STM();

		//virtual IdiBusDevice *getDevice(uint8_t Num);  // !!!
		
		IDIBUS_1xGEN_DATA_TYPE getData();

	protected:
		IDIBUS_1xGEN_DATA_TYPE TMP;
};

#endif /* IDIBUS_1XGEN_H_ */