WeChat_20230720162800
#include "dsc_config.h"
#include <syscalls.h>
#include "IQmathLib.h"
#include "gpio.h"
int main(void)
{
InitSysCtrl();
LEDInit();
BeepInit();
DINT;
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
InitCpuTimers();
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
int v;
while(1)
{
for ( v = 80; v > 40 ; v
{
ConfigCpuTimer(&CpuTimer1, 120, 2000);
CpuTimer1Regs.TCR.bit.TSS = 0;
ConfigCpuTimer(&CpuTimer2, 120, 18000);
CpuTimer2Regs.TCR.bit.TSS = 0;
CpuTimer1Regs.TCR.bit.TIF = 1;
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
while(CpuTimer1Regs.TCR.bit.TIF != 1)
{
}
CpuTimer2Regs.TCR.bit.TIF = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
//GpioDataRegs.GPBTOGGLE.bit.GPIO32 = 1;
while(CpuTimer2Regs.TCR.bit.TIF != 1)
{
}
}
for ( v = 80; v > 40 ; v
{
ConfigCpuTimer(&CpuTimer1, 120, 1000);
CpuTimer1Regs.TCR.bit.TSS = 0;
ConfigCpuTimer(&CpuTimer2, 120, 19000);
CpuTimer2Regs.TCR.bit.TSS = 0;
CpuTimer1Regs.TCR.bit.TIF = 1;
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
while(CpuTimer1Regs.TCR.bit.TIF != 1)
{
}
CpuTimer2Regs.TCR.bit.TIF = 1;
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
//GpioDataRegs.GPBTOGGLE.bit.GPIO41 = 1;
while(CpuTimer2Regs.TCR.bit.TIF != 1)
{
}
}
}
return 0;
}
中科昊芯自研的套件上手非常快,工具完善,功能齐全,反应灵敏,定时器测试非常爽, GPIO功能非常棒!
接下来再用这套DSP开发板做一些游戏类的小项目。
中科昊芯 国产良心!非常棒!DSP数字信号处理的骄傲!
|