tkernel_2/include/device/screen.h | bare source | permlink (0.03 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by T-Engine Forum at 2013/03/02. 11: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 12: * 13: *---------------------------------------------------------------------- 14: */ 15: 16: /* 17: * screen.h 18: * 19: * screen (display) driver 20: */ 21: 22: #ifndef __DEVICE_SCREEN_H__ 23: #define __DEVICE_SCREEN_H__ 24: 25: #include <basic.h> 26: #include <tk/devmgr.h> 27: 28: #ifdef __cplusplus 29: extern "C" { 30: #endif 31: 32: /* SCREEN data number */ 33: typedef enum { 34: /* common attribute */ 35: DN_SCRSPEC = TDN_DISPSPEC, /* DEV_SPEC (R) */ 36: 37: /* individual attribute : -100 - -199 are used for general purpose */ 38: DN_SCRLIST = -100, /* TC[] (R) */ 39: DN_SCRNO = -101, /* W (RW)*/ 40: DN_SCRCOLOR = -102, /* COLOR[] (RW)*/ 41: DN_SCRBMP = -103, /* BMP (R) */ 42: 43: DN_SCRBRIGHT = -200, /* W (RW)*/ 44: 45: DN_SCRUPDFN = -300, /* FP (R) */ 46: DN_SCRVFREQ = -301, /* W (RW)*/ 47: DN_SCRADJUST = -302, /* ScrAdjust (RW)*/ 48: DN_SCRDEVINFO = -303, /* ScrDevInfo (R) */ 49: DN_SCRMEMCLK = -304, /* W (RW)*/ 50: DN_SCRUPDRECT = -305, /* RECT (RW)*/ 51: DN_SCRWRITE = -306, /* - (W) */ 52: 53: DN_SCRXSPEC0 = -500, /* DEV_SPEC (R) */ 54: } ScrDataNo; 55: 56: // we use the range from -755 to - 500 57: #define DN_SCRXSPEC(n) (DN_SCRXSPEC0 - ((n) & 0xff)) 58: 59: /* 60: DN_SCRADJUST : monitor adjust parameter 61: */ 62: typedef struct { 63: UH left; /* number of blank pixels on the left (multiple of 8) */ 64: UH hsync; /* number of pixels for horizontal sync (multiple of 8) */ 65: UH right; /* number of blank pixels on the right (multiple of 8) */ 66: UH top; /* number of blank pixels at the top */ 67: UH vsync; /* number of pixels for vertical sync */ 68: UH bottom; /* number of blank pixels at the bottom */ 69: } ScrAdjust; 70: 71: /* 72: DN_SCRDEVINFO : device information 73: */ 74: typedef struct { 75: UB name1[32]; /* name-1 (ASCII) */ 76: UB name2[32]; /* name-2 (ASCII) */ 77: UB name3[32]; /* name-3 (ASCII) */ 78: void* framebuf_addr; /* physical address of framebuffer */ 79: W framebuf_size; /* framebuffer size */ 80: W mainmem_size; /* main memory size */ 81: UB reserved[24]; /* reserved */ 82: } ScrDevInfo; 83: 84: /* 85: (tkse/extension/typedef.h) 86: */ 87: /* color */ 88: #ifndef __color__ 89: #define __color__ 90: typedef UW COLOR; /* color */ 91: #endif /* __color__ */ 92: 93: /* point */ 94: #ifndef __pnt__ 95: #define __pnt__ 96: typedef struct point { 97: H x; /* horizontal coordinate value*/ 98: H y; /* vertical coordinate value */ 99: } PNT; 100: #endif /* __pnt__ */ 101: 102: /* rectangle */ 103: #ifndef __rect__ 104: #define __rect__ 105: typedef union rect { 106: struct _rect { 107: H left; /* X coordinate value of left edge */ 108: H top; /* Y coodinate value of the upper edge. */ 109: H right; /* X coordinate value of right edge */ 110: H bottom; /* Y coordinate value of the lower edge */ 111: } c; 112: struct { 113: PNT lefttop; /* upper-left corner point */ 114: PNT rightbot; /* lower-right corner point */ 115: } p; 116: } RECT; 117: #endif /* __rect__ */ 118: 119: /* 120: (btron/dp.h) 121: */ 122: /* bitmap */ 123: #ifndef __bmp__ 124: #define __bmp__ 125: #define PLANES 1 126: 127: typedef struct Bitmap { 128: UW planes; /* number of planes */ 129: UH pixbits; /* number of pixel bits */ 130: UH rowbytes; /* row bytes of a plane */ 131: RECT bounds; /* coordinate specification */ 132: UB *baseaddr[PLANES]; /* base addresses */ 133: } BMP; 134: #endif /* __bmp__ */ 135: 136: /* device information */ 137: #ifndef __dev_spec__ 138: #define __dev_spec__ 139: typedef struct { 140: H attr; /* device attribute */ 141: H planes; /* number of planes */ 142: H pixbits; /* number of bits in a pixel (boundary / effective value) */ 143: H hpixels; /* number of pixels on the horizontal row */ 144: H vpixels; /* number of pixels in the vertical direction */ 145: H hres; /* horizontal resolution */ 146: H vres; /* vertical resolution */ 147: H color[4]; /* color information */ 148: H resv[6]; 149: } DEV_SPEC; 150: 151: /* device attributes */ 152: #define DA_CANLOCK 0x4000 153: #define DA_HAVEBMP 0x2000 154: #define DA_HAVECMAP 0x0008 155: #define DA_COLORSYSTEM 0x0007 156: 157: /* Color System */ 158: #define DA_COLOR_MONO 0 159: #define DA_COLOR_RGB 1 160: #define DA_COLOR_CMY 2 161: #endif /* __dev_spec__ */ 162: 163: #ifdef __cplusplus 164: } 165: #endif 166: #endif /* __DEVICE_SCREEN_H__ */