资源简介
DSP利用GPIO口扩展 扫描LED屏,显示字库
代码片段和文件信息
#include “ExternList.h“
#define GPIODIR (*(volatile ioport Uint16*)(0x3400))
#define GPIODATA (*(volatile ioport Uint16*)(0x3401))
/* Define and initialize the GPT module configuration structure */
GPT_Config MyGptConfig = {
0 //Emulation management register
0 //GPIO interrupt control register
0 //GPIO enable register
0 //GPIO direction register
0 //GPIO data register
0xB9EF //Timer period register 1
0x05F5 //Timer period register 2
0 //Timer period register 3
0 //Timer period register 4
GPT_GPTCTL1_RMK( //Timer control register 1
GPT_GPTCTL1_TIEN_NOT_GATED
GPT_GPTCTL1_CLKSRC_VBUS
GPT_GPTCTL1_ENAMODE_CONTINUOUS
GPT_GPTCTL1_PWID_INACTIVE_1CYCLE
GPT_GPTCTL1_CP_CLOCK_MODE
GPT_GPTCTL1_INVIN_DONT_INVERT_OUTPUT
GPT_GPTCTL1_INVOUT_DONT_INVERT_OUTPUT
)
GPT_GPTCTL2_RMK( //Timer control register 2
GPT_GPTCTL2_TIEN_NOT_GATED
GPT_GPTCTL2_CLKSRC_VBUS
GPT_GPTCTL2_ENAMODE_CONTINUOUS
GPT_GPTCTL2_PWID_INACTIVE_1CYCLE
GPT_GPTCTL2_CP_CLOCK_MODE
GPT_GPTCTL2_INVIN_DONT_INVERT_OUTPUT
GPT_GPTCTL2_INVOUT_DONT_INVERT_OUTPUT
)
GPT_GPTGCTL1_RMK( //Global timer control register
GPT_GPTGCTL1_PSC34_DEFAULT
GPT_GPTGCTL1_TIMMODE_DEFAULT
GPT_GPTGCTL1_TIM34RS_NOT_IN_RESET
GPT_GPTGCTL1_TIM12RS_NOT_IN_RESET
)
};
/* Function/ISR prototypes */
interrupt void Timer0Isr(void);
/* Define the power-off time length of LED */
#define TIMECONST 60000
Uint16 LEDMARK = 0;
Uint16 i = 0;
Uint16 j = 0;
unsigned char sbit[8]={0x010x020x040x080x100x200x400x80};
/*定时器0的中断程序*/
interrupt void Timer0Isr(void)
{/*
if(LEDMARK==0)
{
GPIODATA = 0x00;
LEDMARK = 1;
}
else
{
GPIODATA = 0x80; //D2 GPIO7
LEDMARK = 0;
for(i=0;i {
for(j=0;j<100;j++)
{
CHIP_FSET(ST1_55XF0); //D1 shut
}
}
}*/
}
void SetGPIODIR(unsigned dir)
{
GPIODIR = dir;
}
void Set_GPIODATA(unsigned val)
{
GPIODATA = val;
}
unsigned char GetGPIODATA(void)
{
return GPIODATA;
}
void SetGPIORow(unsigned char val) //GPIO1 GPIO2
{
if (val&1) GPIODATA |= sbit[1];
else GPIODATA &= ~sbit[1];
if (val&2) GPIODATA |= sbit[2];
else GPIODATA &= ~sbit[2];
}
void SetGPIOCLK(unsigned char val)
{
if (val) GPIODATA |= sbit[4];
else GPIODATA &= ~sbit[4];
}
void SetGPIOSTB(unsigned char val)
{
if (val) GPIODATA |= sbit[6];
else GPIODATA &= ~sbit[6];
}
void SetGPIODATA(unsigned char val)
{
if (val) GPIODATA |= sbit[7];
else GPIODATA &= ~sbit[7];
}
void SetGPIOSDA(unsigned char val)
{
if (val) GPIODATA |= sbit[1];
else GPIODATA &= ~sbit[1];
}
unsigned char GetGPIOSDA(void)
{
if (GPIODATA & sbit[1]) return 1;
else return 0;
}
unsigned char GetGPIOSCL(void)
{
if (GPIODATA & sbit[2]) re
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1644 2007-11-08 14:07 DEC5502_GPIO扫描\5502.cmd
文件 3616 2010-04-30 15:30 DEC5502_GPIO扫描\5502_GPIO.c
文件 135 2010-05-28 18:26 DEC5502_GPIO扫描\cc_build_Debug.log
文件 162082 2004-01-20 17:54 DEC5502_GPIO扫描\csl5502x.lib
文件 552 2010-04-19 09:58 DEC5502_GPIO扫描\DataType.h
文件 6039 2010-05-24 16:52 DEC5502_GPIO扫描\Debug\5502_GPIO.obj
文件 25535 2010-05-28 18:23 DEC5502_GPIO扫描\Debug\DEC5502_GPIO.map
文件 52715 2010-05-28 18:23 DEC5502_GPIO扫描\Debug\DEC5502_GPIO.out
文件 7796 2010-04-16 11:03 DEC5502_GPIO扫描\Debug\disp.obj
文件 11997 2010-05-24 16:52 DEC5502_GPIO扫描\Debug\DS1302.obj
文件 5714 2010-05-24 16:52 DEC5502_GPIO扫描\Debug\I2C.obj
文件 10458 2010-05-24 16:53 DEC5502_GPIO扫描\Debug\IIC.obj
文件 14563 2010-05-28 18:23 DEC5502_GPIO扫描\Debug\Sc0104.obj
文件 5128 2010-05-24 16:53 DEC5502_GPIO扫描\Debug\UserMain.obj
文件 3228 2010-05-24 16:53 DEC5502_GPIO扫描\Debug\vectors.obj
文件 685 2010-05-28 18:23 DEC5502_GPIO扫描\Debug.lkf
文件 685 2010-05-28 18:23 DEC5502_GPIO扫描\Debug.lkv
文件 9789 2010-05-28 19:34 DEC5502_GPIO扫描\DEC5502_GPIO.paf
文件 1077 2010-05-24 10:37 DEC5502_GPIO扫描\DEC5502_GPIO.pjt
文件 7710 2010-04-10 08:58 DEC5502_GPIO扫描\disp.c
文件 7161 2010-05-12 10:03 DEC5502_GPIO扫描\DS1302.c
文件 170 2010-04-19 09:42 DEC5502_GPIO扫描\ExternList.h
文件 3558 2010-04-30 08:46 DEC5502_GPIO扫描\I2C.c
文件 9362 2010-04-22 13:57 DEC5502_GPIO扫描\IIC.c
文件 22 2010-04-08 09:08 DEC5502_GPIO扫描\Macro.h
文件 188996 2003-01-08 13:19 DEC5502_GPIO扫描\rts55x.lib
文件 9165 2010-05-28 18:23 DEC5502_GPIO扫描\Sc0104.c
文件 2290 2010-05-24 09:38 DEC5502_GPIO扫描\UserMain.c
文件 2386 2007-10-31 14:23 DEC5502_GPIO扫描\vectors.s55
文件 9 2007-05-14 10:46 DEC5502_GPIO扫描\_desktop.ini
............此处省略5个文件信息
- 上一篇:RepMailDel
- 下一篇:H5 漂亮的登录页
评论
共有 条评论