Advertisement
Guest User

Untitled

a guest
May 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.15 KB | None | 0 0
  1. //-----------------------------------------------------------------------------
  2. //
  3. //  Target:         STM32F103C8
  4. //  Tool chain:     CodeSourcery G++
  5. //
  6. //-----------------------------------------------------------------------------
  7.  
  8. #ifndef Screen_h
  9.  
  10. #define Screen_h
  11.  
  12. #include    "Common.h"
  13.  
  14. // ------------ Display parameters -----------------------
  15. // Overall display parameters
  16. #define     ScreenX0        0
  17. #define     ScreenY0        0
  18. #define     ScreenXsize     320
  19. #define     ScreenYsize     240
  20.  
  21. #define     Rbits           0       // Red bits position
  22. #define     Gbits           5       // Green bits position
  23. #define     Bbits           11      // Blue bits position
  24. #define     RGB(R, G, B)    (((R >> 3) << Rbits) | ((G >> 2) << Gbits) | ((B >> 3) << Bbits))
  25.  
  26. enum  COLOR{
  27.     clBlack             =   RGB(0, 0, 0),
  28.     clWhite         =   RGB(255, 255, 255),
  29.     clRed           =   RGB(255, 0, 0),
  30.     clGreen         =   RGB(0, 255, 0),
  31.     clBlue          =   RGB(0, 0, 255),
  32.     clYellow            =   RGB(255, 255, 0),
  33.     clGainsboro     =   RGB(220, 220, 220),
  34.     clNavy          =   RGB(0, 0, 128),
  35.     clAqua          =   RGB(0, 255, 255),
  36.     clHotpink       =   RGB(255, 105, 180),
  37.     clOrange        =   RGB(255, 165, 0),
  38.     clDeepskyblue   =   RGB(0, 191, 255),
  39.     clDimgray       =   RGB(105, 105, 105),
  40.     cllightsalmon   =   RGB(255, 160, 122),
  41.     cllightcoral        =   RGB(240, 128, 128),
  42.     clpaleturquoise =   RGB(175, 238, 238),
  43.     clturquoise     =   RGB(64, 224, 208),
  44.     clViolet            =   RGB(238, 130, 238),
  45.     clGray1         =   RGB(90, 90, 90),
  46.     clGray2         =   RGB(220, 220, 220),
  47.     clGray3         =   RGB(240, 240, 240),
  48.     clDarkgray      =   RGB(169, 169, 169),
  49.     clSkyblue       =   RGB(135, 206, 235),
  50.     clChocolate     =   RGB(210, 105, 30),
  51.     clMediumseagreen    =   RGB(60, 179, 113),
  52.     clPeachpuff     =   RGB(255, 218, 185),
  53.     clSeagreen      =   RGB(46, 139, 87),
  54.  
  55.     clBG1           =   clGainsboro,
  56.    
  57.     clActiveItem1   =   clAqua,
  58.     clActiveItem2   =   clturquoise,
  59.  
  60.     clBtnBG1        =   clOrange,
  61.     clBtnBG2        =   clBlue,
  62.     clBtnBG3        =   clGainsboro,
  63.     clBtnBG4        =   clSkyblue,
  64.     clBtnBG5        =   clRed,
  65.    
  66.     clBtnFG1        =   clBlack,
  67.     clBtnFG2        =   clWhite,
  68.  
  69.     clCh1           =   clYellow,
  70.     clTB                =   clGreen,
  71.     clTrigger       =   clHotpink,
  72.  
  73.     clCursorT       =   clMediumseagreen,
  74.     clCursorV       =   clOrange,
  75.     clCursorActive  =   clAqua,
  76.     clMeasurement   =   clGray3,
  77. } ;
  78.  
  79. typedef struct {
  80.     U8  *Array;
  81.     U8  Xsize;
  82.     U8  Ysize;
  83.     U8  CharPitch;
  84.     U8  LinePitch;
  85.     U8  IndexOfs;
  86.     } FONT;
  87.  
  88.  
  89. //  Display Panel
  90. // =======================================================
  91. // Display parameters
  92. #define WWindowx0           10
  93. #define WWindowy0           15
  94. #define WWindowSizex        300
  95. #define WWindowSizey        200
  96. #define WWindowMidValue 0x800
  97.  
  98. #define WDsize              300     // Wave display size
  99. #define HBarSize            140     // HPos indicator length
  100.  
  101. // ===========================================================
  102. //  Declarations of external variables
  103. // ===========================================================
  104. //
  105. extern  FONT ASC8X16;
  106.  
  107. // ===========================================================
  108. //  Function Prototype Declarations
  109. // ===========================================================
  110. //
  111. void    ClrScreen(void);
  112. void    SetWindow(U16 x, U16 xsize, U16 y, U16 ysize);
  113. void FillRect(S16 x, S16 y, S16 xsize, S16 ysize, U16 color);
  114. void    PutcGenic(U16 x, U16 y, U8 ch, U16 fgcolor, U16 bgcolor, FONT *font);
  115. void    PutsGenic(U16 x, U16 y, U8 *str, U16 fgcolor, U16 bgcolor, FONT *font);
  116.  
  117. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement