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

📄 drvge2.h

📁 mstar 776 开发的车载dvd
💻 H
📖 第 1 页 / 共 3 页
字号:
#define GEDIR_NEGATIVE        1

/// GE Direction
typedef struct
{
    U8 dir_x: 1;
    U8 dir_y: 1;
} GEDir;

/**************************************************/
/// GE Rotate Angle
/**************************************************/
#if 0
typedef U8 GEROTATE_ANGLE;
#define GEROTATE_0      0x1 ///< ROTATE 0 degree
#define GEROTATE_90     0x2 ///< ROTATE 90 degree
#define GEROTATE_180    0x3 ///< ROTATE 180 degree
#define GEROTATE_270    0x4 ///< ROTATE 270 degree
#endif

/**************************************************/
/// GE Block information
/**************************************************/
typedef struct
{
    U32 BlockSrc0Address;
    U32 BlockSrc1Address;
    U16 V0_x;
    U16 V0_y;
    U16 V1_x;
    U16 V1_y;

    U8 Char_Width;
    U8 Char_Height;

    U8 FGColorIndex : 5;
    U8 BGColorIndex : 5;
    U8 BG_Blink     : 1;
    U8 TOPRSV_Lines : 2;
    U8 BTMRSV_Lines : 2;
    U8 BGFlashMode : 1;     // 1: for transparent color ; 0: for window's color
} BlinkBlock_Info;
/**************************************************/
/// GE DTVCC Character information
/**************************************************/
typedef enum
{
    EDGE_NONE = 0,
    EDGE_RAISED,
    EDGE_DEPRESSED,
    EDGE_UNIFORM,
    EDGE_LEFT_DROP_SHADOW,
    EDGE_RIGHT_DROP_SHADOW,
} EDGE_EFFECT_TYPE;

typedef struct
{
    U16 TextCode;
    U8 fHandle;     // Reference to MAX_FONT
    U8 FGColorIndex : 5;
    U8 EdgeColorIdx : 5;
    U8 EdgeType     : 3;
    U8 BGColorIndex : 5;
    U8 CharSize     : 2;
    U8 FG_Blink     : 1;
    U8 BG_Blink     : 1;
    U8 Italic       : 1;
    U8 Underline    : 1;
    U8 HeadBlock    : 1;
    U8 TailBlock    : 1;
} BlinkChar_Info;
/**************************************************/
/// GE Font information
/**************************************************/
// ATSC fonts: 2 for OSD (normal and large), 24 for CC.
// DVB fonts:  2 for OSD (normal and large), 1 for TT
// Reserved fonts for other use

/// Font table information
typedef struct
{
    U32 start_addr;         ///< start address of glyph data. For the use of reload font.
    U32 glyph_addr;         ///< address of glyph data
    U32 codemap_addr;       ///< address of codemap block data. Each codemap block is a tuple of (start code, end code, glyph start index)
    U16 char_num;           ///< Character number
    U16 codemap_block_num;  ///< number of codemap block.
    U8  width;              ///< font size: width
    U8  pitch;              ///< pitch
    U8  hw_pitch;           ///< pitch
    U8  height;             ///< font size: height
    U8  bpp;                ///< bits per pixel: I1 and I2 are currently supported.
    U32 bbox_addr;            ///< glyph bounding box address. BBox is in tuple of (x, width, y, height).
    U16 char_glyph_bytes;   ///< Size of each character glyph including possible paddings. Value 0 indicates to be calculated by driver.
    U8  memory_type;        ///< Memory type: MIU_FLASH and MIU_SDRAM
} FONT_INFO;

/// Glyph display information
typedef struct
{
    U8  u8X0;               ///< Left position to display
    U8  u8Width;            ///< Width of the glyph to display
    U16 u16Index;           ///< Glyph index in the font table
} GLYPH_DISP_INFO;

/// Bounding box (BBox) of a glyph
typedef struct
{
    U8  u8X0;       ///< Position of the left edge of the bounding box
    U8  u8Width;    ///< Width of the bounding box
    U8  u8Y0;       ///< Position of the top edge of the bounding box
    U8  u8Height;   ///< Height of the bounding box
} GLYPH_BBOX;

/// X-direction information of the bounding box of a glyph
typedef struct
{
    U8  u8X0;       ///< Position of the left edge of the bounding box
    U8  u8Width;    ///< Width of the bounding box
} GLYPH_BBOX_X;

/// Y-direction information of the bounding box of a glyph
typedef struct
{
    U8  u8Y0;       ///< Position of the top edge of the bounding box
    U8  u8Height;   ///< Height of the bounding box
} GLYPH_BBOX_Y;

/// Codemap block
typedef struct
{
    U16  u16StartCode;      ///< Start code of this block
    U16  u16EndCode;        ///< End code of this block
    U16  u16StartIndex;     ///< Glyph start index of this block
} CHAR_CODEMAP_BLOCK;

//#if (sizeof(CHAR_CODEMAP_BLOCK) != 6)
//#error "sizeof(CHAR_CODEMAP_BLOCK) != 6"
//#endif

typedef struct
{
    U8 Render;
    U16 CharCode;
    U16 x;
    U16 y;
    GERGBColor FgColor;
    GERGBColor BgColor;
    U8 FgColorBlink;
    U8 BgColorBlink;
    U16 Flag;        // scale or italic
    U8 HoriMag;
    U8 VertMag;
} GE_CHAR;

 /// Font width takes 1byte
#define ONE_BYTE_CHAR     0
 /// Font width takes 2bytes
 #define TWO_BYTE_CHAR     1
//=============================================================================
// Bitmap information
//=============================================================================
typedef struct
{
    U32 addr;       // flat address of whole memory map
    //U32 reladdr;    // offset address start from 0
    U32 size;
    U8 dstloc;      // flash, sram or sdram
    U16 width;
    U16 height;
    U16 pitch;
    GE_Buffer_Format fmt;
} Bitmap_Info;

#define FONT_COMPACT_X0                     (0)
#define FONT_COMPACT_WIDTH              (1)

#define FB_FMT_AS_DEFAULT   0xFFFF

//#define GE_DMA_WIDTH    32
//#define GE_DMA_PITCH    16
#define GE_MAX_DMA_BLK  (0x40000)
#define GE_DMA_PITCH    512              // Max: 512
#define GE_DMA_WIDTH    (512)

#define GE_CLEAR_PITCH  512 // Max: 512
#define GE_CLEAR_WIDTH  (512 )

//=============================================================================
// GE Driver Function Parameter Data
//=============================================================================
typedef struct
{
    FONTHANDLE  fhandle;
    GE_CHAR*    GeRowChar;
    U8              length;
    U16         RTFWidth;
    U16         RTFHeight;
} GE_DRAWCHARROWDATA;

/// GE Frame buffer information
typedef struct
{
    U32 adr;    ///< frame buffer address
    U16 width; ///< width
    U16 height; ///< height
    U16 pitch; ///< pitch
    U16 fmt; ///< memory format
} GE_FB_INFO;

//=============================================================================
// GE Driver Function
//=============================================================================

//start of Jeff code test-------------------------------------------------//

#define GE_PE_FLAG_DEFAULT     0x00
#define GE_FLAG_DEFAULT     0x00

//Funtion_Enable_Flag
#define GE_PE_FLAG_DITHER                       0x02
#define GE_PE_FLAG_ALPHABLENDING        0x04
//#define GE_PE_FLAG_BITMASK                     0x10
#define GE_PE_FLAG_ROP                             0x20
#define GE_PE_FLAG_SCK                              0x40
#define GE_PE_FLAG_DCK                              0x80
#define GE_PE_FLAG_LPT                              0x100
//#define GE_PE_FLAG_LNAA                            0x200

//Font bitblt Flag
#define GE_I1_FONT_BITBLT                 0x01
#define GE_I2_FONT_BITBLT                 0x02
#define GE_BLINK_FONT_BITBLT           0x04
#define GE_FONT_FLAG_STBB                0x08
#define GE_FONT_FLAG_STBB_SFT        0x10
#define GE_FONT_FLAG_ITC                  0x20
#define GE_FONT_FLAG_VARWIDTH       0x40    // variable width
#define GE_FONT_FLAG_GAP                 0x80    // gap (specified by font_tab) between fonts

//BitBlt_Flag
#define GEBBT_FLAG_STBB                                0x01
#define GEBBT_FLAG_STBB_SFT                        0x02
#define GEBBT_FLAG_STBB_ITC                         0x04
#define GEROTATE_FLAG_0                               0x00
#define GEROTATE_FLAG_90                             0x10
#define GEROTATE_FLAG_180                           0x20
#define GEROTATE_FLAG_270                           0x30
#define GEMIRROR_FLAG_X                               0x40
#define GEMIRROR_FLAG_Y                               0x80

//Blink_SCK_Flag
#define GEBLINK_FLAG_BOTHOFF                     0x01
#define GEBLINK_FLAG_BLINKFORE                  0x02
#define GEBLINK_FLAG_BLINKBACK                  0x03
#define GEBLINK_FLAG_BLINKBOTH                  0x04
#define GEBLINK_FLAG_MASK                           0x07
#define GEBLINK_FLAG_TURNON                       0x08
#define GESCK_FLAG_SELE_FOREGROUND        0x40
#define GESCK_FLAG_SELE_BACKGROUND        0x50
#define GESCK_FLAG_SELE_BOTHON                 0x60
#define GESCK_FLAG_SELE_BOTHOFF                0x70
#define GESCK_FLAG_SELE_TURNON                 0x80
#define GESCK_FLAG_MASK                               0x70

//Gradient_Color_Flag
#define GECOLOR_FLAG_CONSTANT           0x0
#define GECOLOR_FLAG_GRADIENT_X        0x1
#define GECOLOR_FLAG_GRADIENT_Y        0x2
#define GECOLOR_FLAG_GRADIENT_LINE   0x4
#define GECOLOR_FLAG_NONCHANGE         0x8

//Blink Type Flag
#define GEBLINK_TYPE_BOTHNOT                           0x00
#define GEBLINK_TYPE_BLINKFORE                        0x01
#define GEBLINK_TYPE_BLINKBACK                        0x02
#define GEBLINK_TYPE_BLINKBOTH                        0x03
#define GEBLINK_TYPE_BLINKMASK                        0x0f

//Font Bitblt Type
#define GEFONT_OSD_TYPE                     0x00
#define GEFONT_SIMPLE_TYPE                0x01
#define GEFONT_TRIPLE_TYPE                0x02
#define GEFONT_TELETXT_TYPE              0x04
#define GEFONT_STRETCH_CAL                0x08


//Engine Primitive
#define LineDraw           0x0010
#define RectDraw           0x0030
#define BitBlt             0x0040

#define PE_MSK_ROT                      0x03
#define PE_VAL_ROT_DEGREE_0             0
#define PE_VAL_ROT_DEGREE_90            1
#define PE_VAL_ROT_DEGREE_180           2
#define PE_VAL_ROT_DEGREE_270           3


typedef struct
{
    U16  v0_x;
    U16  v0_y;
    U16  width;    // same when drawing line
    U16  height;  // same when drawing line
    //U16  v1_x;
    //U16  v1_y;
    U16  v2_x;
    U16  v2_y;
    U8    direction; // direction[0] = x direction, direction[1] = y direction
}GECoordinate;

typedef struct
{
    U16  v0_x;
    U16  v0_y;
    U16  v1_x;
    U16  v1_y;
    U8    direction; // direction[0] = x direction, direction[1] = y direction
}GECoordinate2;

typedef struct
{
    U16  v0_x;
    U16  v0_y;
    U16  v1_x;
    U16  v1_y;
    U8    direction; // direction[0] = x direction, direction[1] = y direction
}GEDstCoordinate;

typedef struct
{
    U16  v2_x;
    U16  v2_y;
}GESrcCoordinate;

typedef struct
{
    U16 dst_width;
    U16 dst_height;
    U16 src_width;
    U16 src_height;
}GEStretchRatio;

typedef struct
{
    U8 HoriMag;
    U8 VertMag;
}GEStrRatio_TT;

typedef struct
{
    U32 ForeGroundColor;
    U32 BackGroundColor;
    U8   ForeIndex;
    U8   BackIndex;
    BOOLEAN EnableBlink;
} GEFontColor;

typedef struct
{
    LONG32_BYTE ForeGroundColor;   //also equal I1 color
    LONG32_BYTE BackGroundColor;  //also equal I0 color
    LONG32_BYTE GradientXColor;  //also equal I2 color, in gradient color it should be 4.4 format
    LONG32_BYTE GradientYColor;  //also equal I3 color, in gradient color it should be 4.4 format
}GEColorInfo;

typedef struct
{
    U16 Sb_pit;
    U16 Db_pit;
    U16 Sb_base;
    U16 Db_base;
}GEPitBase;

typedef struct
{
    FONTHANDLE  fhandle;
    U8 blinkfg;
    U8 blinkbg;
    U8 ifont_gap;  // inter-font gap, only valid for GEFONT_FLAG_GAP
    U8 HoriMag;
    U8 VertiMag;
    U16     out_char;
} GEFontFmt2;

///GE Line or Rectangle information
typedef struct
{
    GECoordinate2 LineRectCoordinate;       ///< Coordinate
    GEColorInfo     ARGBClr;                ///< Color information
    U8 Gradient_Color_Flag;                 ///< Gradient or not
    U8 fmt;                                 ///< Color format
}GELineRectInfo;

///@internal GE Font information, For future use
typedef struct
{
    GECoordinate  FontCoordinate;
    GEColorInfo    ARGBClr;
    GEFontFmt2     BasicFontInfo;
    U8                  Font_Bitblt_Flag;
    U8                  Font_SCK_Flag;
    U8                  Blink_Flag;
    U8                  Font_Type_Flag;
}GEFontInfo;

///@internal GE Bitmap information, For future use
typedef struct
{
    U8                 BitBltTypeFlag;      ///< bitblt type
    U8                 BmpFlag;             ///< Option for drawing effect(italic, mirror, rotate...etc)
    U8                 dst_fm;              ///< destination format
    U8                 src_fm;              ///< source format
    BMPHANDLE          bmphandle;           ///< handle for bitmap
    U16                src_width;           ///< source width (pixel)
    U16                src_height;          ///< source height (pixel)
    GECoordinate BitbltCoordinate;
} GEBitBltInfo;

typedef struct
{
    U16               sb_pit;       ///< source pitch in bytes
    U16               db_pit;       ///< destination pitch in bytes
    U32               sb_base;      ///< source buffer base in bytes
    U32               db_base;      ///< destination buffer base in bytes
}GEPitBaseInfo;

///GE Line pattern (Will be obsoleted)
typedef struct
{
    U8 lpt_rst; ///< 0/1:Line pattern reset
    U8 lpt; ///< type
}GELinePattern;

///GE Destination Color key settings (Will be obsoleted)
typedef struct
{
    U8                 dck_mode;        ///< DCK OP mode
    U8                 dck_index;       ///< obsoleted
    LONG32_BYTE   dck_hth;              ///< DCK high threshold
    LONG32_BYTE   dck_lth;              ///< DCK low threshold
}GEDCKSetting;

///GE Source Color key settings (Will be obsoleted)
typedef struct
{
    U8                 sck_mode;        ///< SCK OP mode
    U8                 sck_index;       ///< obsoleted
    LONG32_BYTE   sck_hth;              ///< SCK high threshold
    LONG32_BYTE   sck_lth;              ///< SCK low threshold
}GESCKSetting;

///GE Alpha blending parameters (Will be obsoleted)
typedef struct
{
    U8 scoef;                           ///< source coeffient
    U8 dcoef;                           ///< destination coeffient
    U32 abl_const;                      ///< constant alpha value
}GEABLSet;

///GE ROP information  (Will be obsoleted)
typedef struct
{
    U8 rop3_seletion;                   ///< ROP OP
    U8 rop3_r;                          ///< Operand for Red
    U8 rop3_g;                          ///< Operand for Green
    U8 rop3_b;                          ///< Operand for Blye
} GEROPInfo;

///GE Bit mask  (Will be obsoleted)
typedef struct
{
    U32 bitmask;                        ///< bitmask value
}GEBitmask;

///GE Pixel engine settings (Will be obsoleted)
typedef struct
{
    U16                PE_Enable_Flag;      ///< Whether enable the engine
    GEDCKSetting dck_set;                   ///< DCK information
    GESCKSetting sck_set;                   ///< SCK information
    GELinePattern line_pt;                  ///< line pattern information
    GEABLSet  ABL;                          ///< Alplha Blending information
    GEROPInfo ROP;                          ///< ROP information
    GEBitmask bitmask;                      ///< Bitmask information
}GEPESettings;


#ifdef WORDS_BIGENDIAN
typedef struct
{
    U8 a;
    U8 r;
    U8 g;
    U8 b;
} GE_RGB_COLOR;
#else
/// Define color
typedef struct

⌨️ 快捷键说明

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