📄 manager.c
字号:
#include <c6x.h>
#include "reg.h"
#include "head.h"
void ini()
{
unsigned volatile int *temp,j;
/* dsp and peripheral initialization */
CSR=0x100; /* disable all interrupts */
IER=1; /* disable all interrupts except NMI */
ICR=0xffff; /* clear all pending interrupts */
*(unsigned volatile int *)GBLCTL = 0x00003779;//设置GBLCTL寄存器,不使能clockout2
*(unsigned volatile int *)CECTL1 = 0x23b1d523;//设置CE1CTL寄存器,用于控制FLASH存储器
*(unsigned volatile int *)CECTL2 = 0x2AB22A23;//设置CE2CTL寄存器,用于控制加密芯片和串并转换器
// *(unsigned volatile int *)CECTL2 = 0x30a3c622;
*(unsigned volatile int *)AUXCTL = 0x00000010;//设置AUXCTL寄存器,用于确定DMA辅助通道的优先级。
//配置TIMER0,TIMER1为GPIO
*(unsigned volatile int *)CTL0 = 0x00000204;//ok
*(unsigned volatile int *)CTL1 = 0x00000204;//ok
// 配置MSBSP为GPIO
temp = (unsigned volatile int *)0x18C00008;
//*(unsigned volatile int *)SPCR0 = 0x00000000;//XRST=RRST=0
*(unsigned volatile int *)temp = 0x00000000;//XRST=RRST=0
*(unsigned volatile int *)SPCR1 = 0x00000000;//XRST=RRST=0
*(unsigned volatile int *)PCR0 = 0x00003fff;//XIOEN=RIOEN=1 其他输出置高
*(unsigned volatile int *)PCR1 = 0x00003fff;//XIOEN=RIOEN=1 其他输出置高
//复位SSP02 ,复位RSA
*(unsigned volatile int *)CTL0 = *(unsigned volatile int *)CTL0 & 0xfffffffb;//ssp02
*(unsigned volatile int *)PCR0 = *(unsigned volatile int *)PCR0 & 0xfffffffe;
for(j=0;j<0x20;j++)
{ asm("nop");
}
*(unsigned volatile int *)CTL0 = *(unsigned volatile int *)CTL0 | 0x04 ;//ssp02
*(unsigned volatile int *)PCR0 = *(unsigned volatile int *)PCR0 |0x01;
}
void int_host()
{
*(unsigned volatile int *)0x01A40008= 0xffffffff;
*(unsigned volatile int *)0x018C0024 = *(unsigned volatile int *)0x018C0024 | 0x02;
*(unsigned volatile int *)0x018C0024 = *(unsigned volatile int *)0x018C0024 & 0xfffffffd;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -