📄 spi_test.c
字号:
#include "DSP28_Device.h"
//Relative to spi_receive,not use rightnow
unsigned int Spi_VarRx[100];
unsigned int i,j;
//-------------------------
extern unsigned int Int_Flag;
void main(void)
{
unsigned int countnum,shownum;
countnum = 0;
/*初始化系统*/
InitSysCtrl();
/* 关中断 */
DINT;
IER = 0x0000;
IFR = 0x0000;
/* 初始化PIE控制寄存器 */
InitPieCtrl();
/* 初始化PIE参数表 */
InitPieVectTable();
/* 初始化外设寄存器 */
InitPeripherals();
#if Spi_Int
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.SPITXINTA = &SPITXINTA_ISR;
PieVectTable.SPIRXINTA = &SPIRXINTA_ISR;
EDIS; // This is needed to disable write to EALLOW protected registers
/* 设置IER寄存器 */
IER |= M_INT6;
#endif
/* 开中断 */
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
Intensity(11);
ScanLimit(7);
DisplayTest();
ShutDown(NO);
DecodeMode(0x0ff);
while(1)
{
if((Spi_TxReady() == 1))
{
shownum = BIN2BCD(countnum);
ShowBCD(shownum);
Delay(400000);
countnum++;
if(countnum==10000)
countnum = 0;
}
}
}
//===========================================================================
// No more.
//===========================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -