ARM7学习---GPS练习
CD_xy(0,4);//LCD指针坐标
write_asicc(B);
write_asicc(Y);
write_asicc(0);
write_asicc(C);
write_asicc(L);
write_asicc(I);
write_asicc(M);
write_asicc(B);
write_asicc(E);
write_asicc(R);
write_asicc(W);
write_asicc(I);
write_asicc(N);
LCD_xy(0,5);//LCD指针坐标
write_asicc(2);
write_asicc(0);
write_asicc(1);
write_asicc(0);
write_hanzi(4);//年
write_asicc(0);
write_asicc(2);
write_hanzi(5);//月
write_asicc(1);
write_asicc(0);
write_hanzi(6);//日
LCD_xy(72,7);//LCD指针坐标
write_asicc(B);
write_asicc(A);
write_asicc(C);
write_asicc(K);
//////////显示手持式导航仪/////////////////
write_hanzi16(4,4,0,0);
write_hanzi16(5,1*16+4,0,0);
write_hanzi16(6,2*16+4,0,0);
write_hanzi16(7,3*16+4,0,0);
write_hanzi16(8,4*16+4,0,0);
write_hanzi16(9,5*16+4,0,0);
}
void PLL_Init(void)
{
/* 设置系统各部分时钟 */
PLLCON = 1;
#if ((Fcclk / 4) / Fpclk) == 1
VPBdiv = 0;
#endif
#if ((Fcclk / 4) / Fpclk) == 2
VPBdiv = 2;
#endif
#if ((Fcclk / 4) / Fpclk) == 4
VPBdiv = 1;
#endif
#if (Fcco / Fcclk) == 2
PLLCFG = ((Fcclk / Fosc) - 1) | (0 < 5);
#endif
#if (Fcco / Fcclk) == 4
PLLCFG = ((Fcclk / Fosc) - 1) | (1 < 5);
#endif
#if (Fcco / Fcclk) == 8
PLLCFG = ((Fcclk / Fosc) - 1) | (2 < 5);
#endif
#if (Fcco / Fcclk) == 16
PLLCFG = ((Fcclk / Fosc) - 1) | (3 < 5);
#endif
PLLFEED = 0xaa;
PLLFEED = 0x55;
while((PLLSTAT & (1 < 10)) == 0);
PLLCON = 3;
PLLFEED = 0xaa;
PLLFEED = 0x55;
}
/***********串口0初始化**********************/
void UART0_INT(void)
{ unsigned int U0DL;
U0LCR = 0x83; // DLAB = 1,可设置波特率;无奇偶校验 1位停止位 8位数据长度。
U0DL = (Fpclk/16)/baudrate;
U0DLM= U0DL/256; //高8位
U0DLL = U0DL%256; //低8位
U0LCR = 0x03; // DLAB = 0,设置好波特率;无奇偶校验 1位停止位 8位数据长度。
}
/***********串口发送字节**********************/
void UART0_SendByte(unsigned char da
{
U0THR = da
while( PE==0 ); //等待数据发送完毕 PE=1忙碌;PE=0;不忙绿
}
/***********串口发送字符串**********************/
void UART0_SendStr(unsigned char const *str)
{ while(1)
{ if( *str == \0 ) break;
UART0_SendByte(*str++); //发送数据
}
}
/*************串口接收字符*************************/
unsigned char UART0_GetChar(void)
{
while (!(U0LSR & 0x01));
return (U0RBR);
}
void __irq UART0_IRQ (void)
{
}
//////////////////////////////////////////////////////////////
void LCD_PORT_INI(void)
{
IO0DIR|=0x0000ff00; //配置P0.8-P1.5为输出
}
//////////////////////////////////////////////////////////////
void LCD_write_LCD(unsigned char da
{
unsigned char i=0;
LCD_CS_L();
if(cmd)LCD_A0_H();
else LCD_A0_L();
for (i=0;i<8;i++)
{
LCD_SCL_L();
if (da
da
LCD_SCL_H();
}
LCD_CS_H();
//delayms(1);
}
////////////////////////////////////////////////////////////
void LCD_RCU6093_Clear(void)
{
unsigned int i=0;
for ( i = 0 ; i < 918 ; i++ )
{
LCD_write_LCD(0x00,1);
}
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
void LCD_RCU6093_int(void)
{
LCD_PORT_INI();
LCD_RST_L();
LCD_CS_H();
LCD_A0_H();
LCD_SCL_H();
LCD_SD_H();
delayms(1);
LCD_RST_H();
LCD_write_LCD(0x21,0);//写Extend 指令 (H=1)
LCD_write_LCD(0xb0,0); //对比度调节
LCD_write_LCD(0x14,0);//LCD Duty设置
LCD_write_LCD(0x20,0);//写Basic 指令(H=0)
LCD_write_LCD(0x0c,0);//画面显示模式 0x08全白 0x09全黑 0x0c正常模式 0x0d反转显示模式
LCD_RCU6093_Clear();
}
///////////////////写asicc码//////////////////////////////////
void write_asicc(uchar assi)
{
uchar i;
for(i=0;i<8;i++)
{LCD_write_LCD( asicc[assi][i],1);}
//{LCD_write_LCD(32+i,1);}
}
///////////////////写8*8简单汉字//////////////////////////////////
void write_hanzi(uchar hz)
{
uchar i;
for(i=0;i<8;i++)
{LCD_write_LCD( hanzi1[hz][i],1);}
}
///////////////////写16*16简单汉字//////////////////////////////////
void write_hanzi16(uchar hz,uchar x,uchar y,uchar mirror)
{
uchar i;
LCD_write_LCD(0x80+x,0);//X轴地址
LCD_write_LCD(0x40+y,0);//Y轴地址
for(i=0;i<8;i++)
if(mirror==0)
{LCD_write_LCD(hanzi16[4*hz][i],1);}
else
{LCD_write_LCD(~hanzi16[4*hz][i],1);}
for(i=0;i<8;i++)
if(mirror==0)
{LCD_write_LCD(hanzi16[4*hz+1][i],1);}
else
{LCD_write_LCD(~hanzi16[4*hz+1][i],1);}
ARM7GP 相关文章:
- ARM7学习---GPIO笔记(11-18)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)