/*
 * OnePhaseBase.h
 *
 *  Created on: 09.01.2017
 *      Author: Justus_RETHEM
 */

#ifndef CLASSES_ONEPHASEBASE_H_
#define CLASSES_ONEPHASEBASE_H_

#include <stdint.h>
#include "F2837xS_device.h"        // F2837xS Headerfile Include File
#include "F2837xS_Examples.h"

#include "../globalDefines.h"
#include "SysCommons.h"
class OnePhaseBase: public SysCommons{
public:
	OnePhaseBase();
	virtual ~OnePhaseBase();

	void Run();
	void SetPwm(unsigned int pwmDyty);

	signed int GetZwKrsU();

	void PutUref(unsigned int* Uref);
	unsigned int GetU();
	unsigned int GetRawUadc();

	void PutIref(unsigned int* Iref);
	signed int GetIinPerc();
	unsigned int GetRawIadc();


	void PutDAC_I_Set(unsigned int* dacRef);
	void PutDAC_I_Band(unsigned int* dacRef);
	void PutDAC_I_Set_Val(signed int val);
	void PutDAC_I_Band_Val(unsigned int val);

	void PutPwmRegRef(volatile Uint32* pwmRegRef);
	volatile Uint32* GetPwmRegRef();
	//void PutPwmChnl(EPWM_REGS* pwmR, unsigned int ab);

private:
	unsigned int* myUref;
	unsigned int* myIref;


	unsigned int* myDAC_I_Set_Ref;
	unsigned int* myDAC_I_Band_Ref;
	volatile Uint32* myPwmRegRef;
	Uint32 myPwmVal;
	//pwmChnlLoc myPwmChnl;
};

#endif /* CLASSES_ONEPHASEBASE_H_ */
