⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpout.c

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 C
字号:
/*
******************************************************************
*                  XIAMEN YAXON NETWORK CO.LTD.  
*                   XINXI BUILDING,HULI,XIAMEN
*      (c) Copyright 2002,XIAMEN YAXON NETWORK CO.LTD. ,XIAMEN
*                     All Rights Reserved
*
* FileName     :  GPOUT.C
* Programmer(s):  WuJingYu
* Description  : 
******************************************************************
*/

/*
*****************************************************************
*                  REVISION HISTORY
*                 
* Date:    2002-10-23
*****************************************************************
*/ 
#define GPOUT_GLOBALS 

#include  "includes.h"
#include  "Lcd.h"

static  INT8U  Row_Dot,Col_Dot,LenRow,LenCol,Space_Row,Space_Col,BorderStyle;
static  INT8U  Lattice_Row,Lattice_Col;
static  INT8U  Curdraw_Row,Curdraw_Col,Draw_Row,Draw_Col;
static  INT8U  PosRow1,PosCol1,PosRow2,PosCol2;

void CheckGpOutSize(void)
{
     
}    

void GetGpDrawDot(void)
{
     INT8U rowwidth,colwidth;
     
     rowwidth = 2*(Space_Row) + Lattice_Row + 1;
     colwidth = 2*(Space_Col) + Lattice_Col+ 1;
     
     Draw_Row = Row_Dot + Curdraw_Row * rowwidth;
     Draw_Col = Col_Dot + Curdraw_Col * colwidth;
}
    
void LockGpOut(GPOUT *gpout)
{
     if (gpout == NULL) return;
     Row_Dot = gpout->row_dot;
     Col_Dot = gpout->col_dot;
     LenRow  = gpout->numrow;
     LenCol  = gpout->numcol;
     Lattice_Row = gpout->lat_row;
     Lattice_Col = gpout->lat_col;
     Space_Row = gpout->space_row;
     Space_Col = gpout->space_col;
     BorderStyle = gpout->borderstyle;
     CheckGpOutSize();
     Curdraw_Row = 0;
     Curdraw_Col = 0;
     Draw_Row = Row_Dot;
     Draw_Col = Col_Dot;
}
    
void MovDrawCursor(INT8U row,INT8U col)
{
     Curdraw_Row = row;
     Curdraw_Col = col;
     GetGpDrawDot();
}
    
void ClearGpOut(INT8U row,INT8U col)
{
     MovDrawCursor(row,col);
     ClearArea(Draw_Row,Draw_Col,Lattice_Row,Lattice_Col);
}    

void Print_Gpdata(INT8U row,INT8U col,INT8U *gpdata)
{
     MovDrawCursor(row,col);
     GraphiDraw(Draw_Row,Draw_Col,Lattice_Row,Lattice_Col,gpdata);
}

void Print_Gpdata_ROM(INT8U row,INT8U col, INT8U *gpdata)
{
     MovDrawCursor(row,col);
     GraphiDraw_FromROM(Draw_Row,Draw_Col,Lattice_Row,Lattice_Col,gpdata);
}    
    
void ReverseGpOut(INT8U row,INT8U col)
{
     MovDrawCursor(row,col);
     ReverseArea(Draw_Row,Draw_Col,Lattice_Row,Lattice_Col);
}
    
void GetGpOutBorderPara(void)
{
     if (Row_Dot < Space_Row+1) {
         PosRow1 = 0;
     } else {
        PosRow1 = Row_Dot - Space_Row - 1;    
     }
     if (Col_Dot < Space_Col+1) { 
        PosCol1 = 0;
     } else {
        PosCol1 = Col_Dot - Space_Col - 1;
     }   
     
     //PosRow2 = Row_Dot + (2*Space_Row + 1)*(LenRow - 1) + LenRow * Lattice_Row + Space_Row + 1;
     PosRow2 = PosRow1 + (2*Space_Row + Lattice_Row + 1)*LenRow ;//+ LenRow;
     PosCol2 = PosCol1 + (2*Space_Col + Lattice_Col + 1)*LenCol; //+ LenCol;
     //PosCol2 = Col_Dot + (2*Space_Col + 1)*(LenCol - 1) + LenCol * Lattice_Col + Space_Col + 1;
}    

void GrawGpOutBorder(void)
{
     INT8U i,posy1,posx1;
          
     if (BorderStyle != BORDER_NONE) {
        GetGpOutBorderPara();
        posy1 = PosRow1;
        posx1 = PosCol1;
        for (i=0;i<=LenRow;i++) {
           Line(posy1,posx1,posy1,PosCol2,LINE_COMPLETE);
           posy1 += 2*(Space_Row) + Lattice_Row + 1;
        }
        posy1 = PosRow1;
        posx1 = PosCol1;
        for (i=0;i<=LenCol;i++) {
           Line(posy1,posx1,PosRow2,posx1,LINE_COMPLETE);
           posx1 += 2*(Space_Col) + Lattice_Col + 1;
        }
     }    
}

void UpdateGpOut_LCD(void)
{
     INT8U lenrow_dot,lencol_dot;
     
     lenrow_dot = (2*Space_Row + 1)*(LenRow - 1) + Space_Row + LenRow * Lattice_Row;
     lencol_dot = (2*Space_Col + 1)*(LenCol - 1) + Space_Col + LenCol * Lattice_Col;
     LcdUpdate_dots(Row_Dot,Col_Dot,lenrow_dot,lencol_dot);
}    


void UpdateGpOut_PartLcd(INT8U row,INT8U col)
{
     MovDrawCursor(row,col);
     LcdUpdate_dots(Draw_Row,Draw_Col,Lattice_Row,Lattice_Col);
}    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -