基于 C8051F040 简易 GPS 导航仪的实现源程序
/***************************************************************************
** Project name: GPS_LCD Nvigation System Experiment
**
** Descriptions: Undergraduate Group Project of Navigation & Control
**
** Created by: GPS_LCD Nvigation System Design Group
**
** Major: Navigation & Control, Beihang University
**
** Supervisor: Professor Zhanghai, Zhang Liyong
**
** Created Date: 11 Jan 2007
**
****************************************************************************/
#include <C8051F040.h>
#include <stdio.h>
#include <stdlib.h>
#include<absacc.h>
#define baud rate 4800
#define N 100
#define HANG 20
#define LIE 12
#define dlcd XBYTE[0x8000]/*定义送数据的地址*/
#define clcd1 XBYTE[0xa000]/*定义送指令的地址,行地址*/
#define clcd2 XBYTE[0xc000]/*定义送指令的地址,列地址*/
#define clcd3 XBYTE[0xe000]/*定义送指令的地址,设置显示页和操作页*/
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long ulong;
typedef struct {uint x; uint y;}point;
sfr16 RCAP2=0xca;
sfr16 RCAP3=0xca;
sfr16 RCAP4=0xca;
sfr16 TMR2=0xcc;
xdata uchar GPS_infor[N];//处理缓冲区
xdata uchar GPS_buff[N];//接收区
xdata uchar GPS_sec[HANG][LIE];//2 维数组
xdata uchar GPS_sec_temp1[11];//中间变量 1
xdata uchar GPS_sec_temp2[5];//中间变量 2
xdata uchar mode[LIE];
xdata ulong longitude=0;//纬度
xdata ulong latitude=0;//经度