📄 kw.c
字号:
#include <stdio.h>
#include <c6x.h>
#include "head.h"
#include "reg.h"
unsigned volatile int counter_32;
unsigned volatile int counter_256;
unsigned volatile int wng_clk;
unsigned volatile int *wng_addr;
unsigned volatile int wng_data;
void randx()
{
*(unsigned volatile int *)GBLCTL = 0x00003798;
*(unsigned volatile int *)CECTL2 = 0x10410220;
counter_32 = 0x00;
counter_256= 0x00;
wng_clk = 0x00;
wng_addr = (unsigned volatile int *)0x8000D004;
// 打开TIMER1中断
ICR = IFR | 0x8000;
IER |= 0x8002; // enable int 15 (timer1)
CSR |= 1;
// timer11_init();
// timer1_start();
*(unsigned volatile int *)CTL1 &= 0xff3f;/* hold the timer */
*(unsigned volatile int *)CTL1 |= 0x200; /* use CPU CLK/4 */
*(unsigned volatile int *)PRD1 = 0x800; /* set for a short period*/
*(unsigned volatile int *)CTL1 |= 0x3C0; /* start the timer */
}
unsigned int erandx()
{
extern int peek();
extern void randx();
randx();
return peek(0x8000D004,2);
}
/*读出工
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -