#include "xparameters.h"
#include "xil_macroback.h"
#include "xtmrctr.h"
#include "xio.h"
char buffer[0x400000];
void StartTimer ()
{
//Reset and Start Timer
XTmrCtr_mSetLoadReg(XPAR_XPS_TIMER_0_BASEADDR, XPAR_XPS_TIMER_0_DEVICE_ID, 0);
XTmrCtr_mSetControlStatusReg(XPAR_XPS_TIMER_0_BASEADDR, XPAR_XPS_TIMER_0_DEVICE_ID,XTC_CSR_LOAD_MASK);
XTmrCtr_mSetControlStatusReg(XPAR_XPS_TIMER_0_BASEADDR, XPAR_XPS_TIMER_0_DEVICE_ID, 0x00);
XTmrCtr_mEnable (XPAR_XPS_TIMER_0_BASEADDR, XPAR_XPS_TIMER_0_DEVICE_ID);
}
int StopTimer ()
{
int timer;
//Disable and read timer
XTmrCtr_mDisable(XPAR_XPS_TIMER_0_BASEADDR, XPAR_XPS_TIMER_0_DEVICE_ID);
timer = XIo_In32(XPAR_XPS_TIMER_0_BASEADDR + XPAR_XPS_TIMER_0_DEVICE_ID + XTC_TCR_OFFSET);
return (timer);
}
'edk' 카테고리의 다른 글
2개 MB가 DDR3에 있는 비트 파일을 BRAM을 통해 전달 (0) | 2011.12.06 |
---|---|
shell (0) | 2011.12.02 |
i2c read / write by gpio (0) | 2011.11.24 |
타이머인터럽트, External 인터럽트 (0) | 2011.11.19 |
bit 파일과 elf를 합치는 명령어.. (0) | 2011.11.19 |