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

📄 core_vga.h

📁 嵌入式开发 嵌入式开发 嵌入式开发
💻 H
字号:
/********************
 Filename: CORE_VGA.H
********************/
// follow const defination place to ST3000.C
/*
const _tagMenuAttr MenuAttr={10, 88, 160, 40, 500, 650};
const _tagInstAttr InstAttr={100, 20, 35, 8};
const _tagSizeAttr SizeAttrB={80, 35};
const _tagSizeAttr SizeAttrE={150,35};
const _tagSizeAttr SizeConfig={350, 415};
*/

#ifndef _CORE_CAN_INC
#define _CORE_CAN_INC
typedef struct {
    unsigned id;
    unsigned char rtr; //remote transmition request (RTR)
    unsigned char dlen;
    unsigned char data[8];
} MSG_STRUCT;
#endif

#ifndef _CORE_VGA_INC
#define _CORE_VGA_INC
#include "BT848.H"

/***
Func: GetVESA Mode Information
Return:
    1-success; 0-failed
***/
//int GetVESAMode(int mode);

/***
Func: GetVESA  Head Information
Return:
    1-success; 0-failed
***/
//int GetVESAInfo(void);

/***
Func: Set VESA-Graphcs to Special MODE
Parameters:
    -mode; mode index
***/
//void SetVESAMode(int mode);

/***
Func: Initialize SVGA 1024x768x32 TureColor
***/
int InitVESA(void);

/***
Func: End VESA-Graphics mode
***/
void EndVESA(void);

/***
Func: Set MemBank for VESA Graphics
Parameters:
    -bank ; bank index;
***/
//void SetBANK(int bank);

/***
Func: Pixel
Parameters:
    -x,y ;  position of pixel;
    -r,g,b ;    color of pixel;
***/
void PutPixel(int x, int y, int r, int g, int b);

/***
Func: fill pixel sub for FillPoly
Parameters:
    -r,g,b; color of pixel.
***/
//void _FillPixel(int r, int g, int b);

/***
Func: Draw Line
Parameters:
    -x1,y1 ; position of start point
    -x2,y2 ; position of end point
    -r,g,b  ; color of line.
***/
void Line(int x1, int y1, int x2, int y2, int r, int g, int b);

/***
 Func: Rectangle
 Parameters:
    x0,y0 :  left-top corner position.
    x1,y1 :  right-bottom corner position.
    r,g,b  :  color of Rectangle lines.
 Returns:
    NULL
***/
void Rectangle(int x0, int y0, int x1, int y1, int r, int g, int b);

/***
 Func: Square Area
 Parameters:
    x0,y0 :  left-top corner position.
    x1,y1 :  right-bottom corner position.
    r,g,b  :  color of filled area.
 Returns:
    NULL
***/
void Bar(int x0, int y0, int x1, int y1, int r, int g, int b);

/***
 Func: Move Paint-Pencil Position
 Parameters:
    x,y :  the cordiation that you wanna.
 Returns:
    NULL
***/
void MoveTo(int x, int y);

/***
 Func: Line 2
 Parameters:
    x,y : the cordiation of destination.
    r,g,b : color of line.
 Returns:
    NULL
***/
void LineTo(int x, int y, int r, int g, int b);

/***
 Func: line of FillPoly
 Parameters:
    x1,y1 : the start point cordiation.
    x2,y2 : the end point cordiation.
    r,g,b  : color of line.
 Returns:
    NULL
***/
//void _Line4Poly(int x1, int y1, int x2, int y2, int r, int g, int b);

/***
 Func: Fill Polygon Area
 Paramters:
    numpoint : number of count-corner.
    points : points-cordiation of each corner.
    r,g,b : filled color.
 Returns:
    NULL
***/
void FillPoly(int numpoint, int far *points, int r, int g, int b);

/***
 Func: memory's data copy
 Paramters:
    *src : source memory data.
    *dest: destination memory data.
    len : data-length
 Returns:
    NULL
***/
void CopyMem(unsigned char far *src, unsigned char far *dest, unsigned len);

/***
 Func: Get ImgData of One HorzLine.
 Parameters: 
    -x,y:  line's start point position.
    -imgLineBytes: bytes counter of this ImgData Area.
    -*ptr:  destination buffer;
 Returns:
    NULL
***/
void GetHorzLine(int x, int y, int imgLineBytes, unsigned char far * ptr1);

/***
 Func: GetImage
 Parameters:
    -x1,y1; start point position
    -x2,y2; end point position
    -*buf; the buffer of image save.
 Returns:
    NULL
***/
void GetImage(int x1, int y1, int x2, int y2, unsigned char far * buf);

/***
 Func: PutHorzLine
 Parameters:
    -x,y; position of start point
    -imgLineBytes; bytes counter of LineImage
    -*buf; buffers.
 Returns:
    NULL
***/
void PutHorzLine(int x, int y, int imgLineBytes, unsigned char far * buf);

/***
 Func: put image on screen
 Parameters:
    -x1,y1; start point
    -x2,y2; end point
    -*buf; buffers.
 Returns:
    NULL
***/
void PutImage(int x1, int y1, int x2, int y2, unsigned char far * buf);

/***
 Func: Circle
 Parameters:
    -x,y; center point position
    -ri; R of Circle.
    -r,g,b; color of circle.
 Returns:
    NULL
***/
void Circle(int x, int y, int ri, int r, int g, int b);

/***
 Func: PutHorzLineImg to Screen from XMS
 Parameters:
    -x,y; start point position
    -imgLineBytes; bytes of one imageline.
    -h_xms; handle of xms block
    -xms_off; offset of xms block
 Returns:
    NULL
***/
void PutHLine_xms(int x, int y, int imgLineBytes, unsigned h_xms, long xms_off);

/***
 Func: GetHorzLineImg to XMS from Screen
 Parameters:
    -x,y; start point position
    -imgLineBytes; bytes of one imageline.
    -hXms; handle of xms block
    -XmsOffset; offset of xms block
 Returns:
    NULL
***/
void GetHLine_xms(int x, int y, int imgLineBytes, unsigned int h_xms, long xms_off);

/***
 Func: frame of box
 Parameters:
    -x1,y1; position of startpoint
    -x2,y2; position of endpoint
 Returns:
    NULL
***/
void box_frame(int x1, int y1, int x2, int y2);

/***
 Func: GetImageData to Xms
 Parameters:
    -x,y, startpoint position
    -w,h; sizeof image area.
    -h_xms; handle of xms block
    -xms_off; offset of xms block
 Returns:
    NULL
***/
void GetImage_xms(int x, int y, int w, int h, unsigned h_xms, long xms_off);

/***
 Func: put imagedata from xms
 Parameters:
    -x,y, startpoint position
    -w,h; sizeof image area.
    -h_xms; handle of xms block
    -xms_off; offset of xms block
 Returns:
    NULL
***/
void PutImage_xms(int x, int y, int w, int h, unsigned int h_xms, long xms_off);

/***
 Func: SquareBar of XP-Style.
 Parameters:
    x,y,w,h; startpoint of left-top & size of squarebar.
    style : 1=press-down; 0=press-up.
 Returns:
    NULL
***/
void xpbar(int x, int y, int w, int h, unsigned char style);

/***
 Func: Mouse Cursor Drawing.
 Paramters:
    x,y : the cordiation on screen.
 Returns:
    NULL
***/
//void PaintCursor(const int x, const int y);

/***
 Func: ShowMouse Cursor.
 Parameters:
    NULL
 Returns:
    NULL
***/
void ShowMouse(void);

/***
 Func: HideMouse Cursor.
 Parameters:
    NULL
 Returns:
    NULL
***/
void HideMouse(void);

/***
 Func: Mouse Affair Routine of Interrupt-TSR
 Parameters:
    NULL
 Returns:
    NULL
***/
//void MouseMaskProc(void);

/***
 Func: Mouse Click Test.
 Parameters:
    NULL
 Returns:
    1=MouseClicked; 0=MouseNotClicked.
***/
int MouseKeyClick(void);

/***
 Func: Initialize Mouse & Install TSR of Mouse.
 Parameters:
    NULL
 Returns:
    NULL
***/
void InitialMouse(void);

/***
 Func: Release Mouse TSR part for this Application.
 Paramters:
    NULL
 Returns:
    NULL
***/
void ReleaseMouse(void);

/***
 Func: Get VECT of special IRQ
 Paramters:
    irq_nr : IRQ number
    Bvect : the variable for save VECT of (irq_nr); {be return value}
 Returns:
    NULL
***/
void GetVectIRQ(int irq_nr, unsigned char *Bvect);

/***
 Func: for time delay by program-command
 Paramters:
    tms : the delay max counter.
 Returns:
    NULL
***/
void wait(const int tms);

/***
 Func: write special register of A/D&CAN
 Parameters:
    addr: address of register's number.
    v : value of you wanna set this register.
 Returns:
    NULL
***/
//void can0w(unsigned char addr, unsigned char v);

/***
 Func: read special register of A/D&CAN
 Parameters:
    addr: address of register's number.
 Returns:
    the register's value.
***/
//unsigned char can0r(unsigned char addr);

/***
 Func: CAN Initialization.
 Parameters:
    irq_nr : IRQ of hardware.
 Returns:
    1=successful; 0=failed.
***/
int CAN_Init(int irq_nr);

/***
 Func: CAN Release.
 Parameters:
    irq_nr : IRQ of hardware.
 Returns:
    NULL
***/
void CAN_Exit(int irq_nr);

/***
 Func: CAN StartRunning.
 Parameters:
    NULL
 Returns:
    NULL
***/
void CAN_Run(void);

/***
 Func: Config CAN
 Parameters:
    NULL
 Returns:
    1=successful; 0=failed.
***/
int CAN_Config(void);

/***
 Func: CAN - TSR
 Parameters:
    NULL
 Returns:
    NULL
***/
//void interrupt can_isr0(void);

/***
 Func: CAN message receive. (Query mode)
 Paramters:
    msg_ptr : (type see MSG_STRUCT define).
 Returns:
    1=has message received; 0=no message received.
***/
int CAN_RecvMsg(MSG_STRUCT *msg_ptr);

/***
 Func: CAN message send. (synchronize-mode)
 Paramters:
    msg : (type see MSG_STRUCT define).
 Returns:
    NULL
***/
void CAN_SendMsg(MSG_STRUCT msg);

/***
 Func: Get Length of String buffer.
 Paramters:
    buff : string buffer.
 Returns:
    length of string buffer. (engligh is 1/1; chinese is 1/2)
***/
int GetBuffLen(BYTE *buff);

/***
 Func: show english font on screen. (0816)
 Parameters:
    x,y : start point coordinates
    ptr : the content of you wanna display.
    r,g,b : color of font.
 Returns:
    NULL
***/
void ShowASCMem(int x, int y, char *ptr, int r, int g, int b);

/***
放大显示内存字库中的半角字体
(主要应用于英文字母和数字显示)
size=(8*hX)*(15*vX).
***/
void ShowASCMemX(int x, int y, int hX, int vX, char *ptr, int r, int g, int b);

/***
显示字库文件中的全角字体
(主要应用于中文和全角表示的英文字母和数字显示)
size=16*16.
***/
void ShowGB2312(int x, int y, char *ptr, int r, int g, int b);

/***
放大显示字库文件中的全角字体
(主要应用于中文和全角表示的英文字母和数字显示)
size=(16*hX)*(16*vX).
***/
void ShowGB2312X(int x, int y, int hX, int vX, char *ptr, int r, int g, int b);

/***
显示24*24的图标
***/
void ShowICO2424(const int ID, const int x, const int y);

/***
 描述: 图标调度函数32*32 SIZE
 参数: i图标编号; x,y起点坐标
 ID描述: 
 	1 整机手动 ;2 整机自动
 	3 整机智能关 ;4 整机智能开
 	5 报警关 ;6 报警开
 	7 纵向手动 ;8 纵向自动
 	9 横向手动 ;10 横向自动
 	11 波门锁定 ;12 波门解锁
 	13 1倍比例放大 ;14 2倍比例放大 ;15 4倍比例放大
 	16 本组智能关 ;17 本组智能开
***/
void ShowICO3232(const int ID, const int x, const int y);

/***
图标调度函数
88*40 SIZE
***/
void ShowICO8840(const int ID, const int x, const int y);

/***
图标调度函数
w*h = 40*64
***/
void ShowICO4064(const int ID, const int x, const int y);

/***
3D外框线
不填充框线包围的区域
***/
void Rect(int x, int y, int w, int h, unsigned char inSTL);

/***
编辑框控件
特别声明: bSTL;
  bit7bit6 表示背景颜色
=    00白色; 01蓝色; 10灰色; 11浅蓝色.
  bit4表示字体的颜色
=    0黑色; 1红色 (但是如果背景颜色选择蓝色则字体默认成白色)
  bit3特别字体声明
=    0正常字体; 1全角表示的西文字体
  bit2内部字体对齐方式
=    0居中对齐; 1居右对齐
  bit1中文英文区别标志
=    0英文; 1中文
  bit0是否有文字显示
=    0没有文字; 1有文字显示 (为1时, 要求ptr尽量不为NULL)
***/
void Edit(int x, int y, int w, int h, const unsigned char bSTL, char *ptr);

/***
 Func: 按钮控件(XP-Style)
 Paramters:
    x,y : left-top coordinates of square bar.
    w,h: size of square bar.
    style: 1=press-down; 0=press-up.
 Returns:
    NULL
***/
void XPButton(int x, int y, int w, int h, const unsigned char style);

/***
 描述: 按钮控件
 参数: x,y控件起点坐标; w,h控件的宽度和高度; style显示风格和文本显示限制风格; ptr内部文本内容
 说明: 
    style风格包含如下定义: 
        bit7表示显示字体是否放大 1字体放大(此时要求bit1必须为0)
        bit4表示按钮属于按下还是弹起 0弹起 ; 1按下.
        bit2表示激活还是禁用 0激活 ; 1禁用.
        bit1中文英文区别标志 0英文 ; 1中文
        bit0是否有文字显示    0没有文字 1有文字显示 (为1时, 要求ptr尽量不为NULL)
***/
void Button(int x, int y, int w, int h, const unsigned char style, char *ptr, int r, int g, int b);

/***
 功能: 类似win3.1的窗口
***/
void Win32Dlg(int x, int y, int w, int h);

/***
 功能: 信息提示框
***/
void MessageBox(char *ptr);

/***
 描述: 工程师菜单控制页面选择处理函数
 参数: iPAGE页面编号; iFLAG是否选中(1选中 0失去焦点)
***/
void SubMenuPage(const int iPAGE, const unsigned char iFLAG);

/***
 功能: 单笔划
***/
//void _SimSTROKE(int x, int y, int iNUM0);

/******************************
 描述: 速度显示所用数码管字体显示
 参数: x,y起点坐标; ptr显示的数字信息内容
******************************/
void SimLED(int x, int y, char *ptr);

/***
 功能: 清除键盘缓冲区
***/
void ClearKBuffer(void);

/***
 功能: 在屏幕用户指定区域绘制数字键盘
***/
void DrawNumKBoard(const int Lx, const int Ty);

/***
 功能: 响应键盘用户点击测试
 返回:
    100=没有点击; 
    205=ENT按键
    其余的是各自按键的枚举ASCII值
***/
int RespNumKBoard(void);

/***
 描述: 对每个按键的返回值相应处理操作缓冲区内容 Tempbuf[20], Dispbuf[20]
 参数: val按键的返回值
***/
void ProcNumKBinp(const int iVAL);

/***
 功能: 保存界面
***/
void SaveScrRGB(const int mID, const int pID);

#endif

⌨️ 快捷键说明

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