//###########################################################################
//
// FILE:    init_front_end.c
//
// TITLE:
//
// NOTES:
//  1)
//###########################################################################
//
//  Ver  | dd mmm yyyy | Who  		| Description of changes
// ======|=============|============|========================================
//  00 	   05 04 2015 	 HPCS
//
//  Texas Instruments, Inc
//  Copyright Texas Instruments 2008. All rights reserved.
//###########################################################################
#include "system_defines.h"
#include "cyclone_device.h"
#include "variables.h"
#include "function_definitions.h"
#include "software_interrupts.h"
#include "cyclone_defines.h"
#include "pmbus_common.h"
#include "pmbus_topology.h"
#include "pmbus_constants.h"



void  init_front_end0()
{

	FeCtrl0Regs.EADCCTRL.bit.AFE_GAIN = 3;// Gain X8
	FeCtrl0Regs.EADCCTRL.bit.EADC_MODE = 1;
	FeCtrl0Regs.RAMPCTRL.bit.RAMP_EN = 1;
	FeCtrl0Regs.EADCCTRL.bit.SAMP_TRIG_SCALE= 15;
	FeCtrl0Regs.EADCCTRL.bit.AVG_MODE_SEL=2;
	FeCtrl0Regs.EADCCTRL.bit.AVG_SPATIAL_EN=1;
	FeCtrl0Regs.EADCCTRL.bit.EADC_ENA = 1;
}

void  init_front_end1()
{
	FeCtrl1Regs.EADCCTRL.bit.AFE_GAIN = 3;// Gain X8
	FeCtrl1Regs.EADCCTRL.bit.EADC_MODE = 0;
	FeCtrl1Regs.EADCCTRL.bit.SAMP_TRIG_SCALE= 0;
	FeCtrl1Regs.EADCCTRL.bit.EADC_ENA = 1;

}

void  init_front_end2()
{
	FeCtrl2Regs.EADCCTRL.bit.AFE_GAIN = 3;// Gain X8
	FeCtrl2Regs.EADCCTRL.bit.EADC_MODE = 0;
	FeCtrl2Regs.EADCCTRL.bit.SAMP_TRIG_SCALE= 0;
	FeCtrl2Regs.EADCCTRL.bit.EADC_ENA = 1;

}


void init_front_end(void)
{

	init_front_end0();
	init_front_end1();
	init_front_end2();

}

