

/***************************** Include Files *******************************/
#include "IMX253_Timer.h"

/************************** Function Definitions ***************************/
unsigned int *TIMER_ADDR = XPAR_IMX253_TIMER_0_S00_AXI_BASEADDR;


int timer_enable(){
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 0, 0x0); //rst 0
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 1, 0xFF); //en 1

}
int timer_set_mode(int mode){
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 2, mode); //0 - normal mode, 1 - trigger mode
}
int timer_disable(){
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 0, 0x1); //rst 1
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 1, 0x0); //en 0
}
int timer_xtrig_width(u32 width){
	IMX253_TIMER_mWriteReg(TIMER_ADDR, 3, width); //xtrig pulse width
}
