#ifndef MAIN_H
#define MAIN_H
#include <stdint.h>

//FRAME
#define	START_FRAME	'a'
#define	END_FRAME		'U'

#define DOWN 	1
#define UP 		2

//PWM
#define PERIOD		500

#define MAX_VAL		340


//-----------------------
struct sdisplay {
    uint8_t     line;
    uint8_t     position;
};

struct sbuffer {
	uint8_t	data[100];
	uint8_t	index;
	uint8_t	save;
	uint8_t	flag;
};

struct soutputSettings {
    uint8_t     enableOutput;
    uint8_t     controlMode;		// 0 - nothing		1 - C.V.	2 - C.C.
};

struct smeasure {
	float fvoltage;
	float fcurrent;
	float fvoltage_req;
	float fcurrent_req;
};

//-----------------------
extern	struct sbuffer Buffer;

//-----------------------
void set_duty(uint32_t duty);

#endif

