ソースを参照

LCD Size Defines (#15297)

Robby Candra 5年前
コミット
787d522036

+ 7
- 6
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp ファイルの表示

60
 #if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS)
60
 #if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS)
61
 
61
 
62
 #include "HAL_LCD_com_defines.h"
62
 #include "HAL_LCD_com_defines.h"
63
+#include "ultralcd_DOGM.h"
63
 
64
 
64
 #include <string.h>
65
 #include <string.h>
65
 
66
 
70
   extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count);
71
   extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count);
71
 #endif
72
 #endif
72
 
73
 
73
-#define WIDTH 128
74
-#define HEIGHT 64
74
+#define WIDTH LCD_PIXEL_WIDTH
75
+#define HEIGHT LCD_PIXEL_HEIGHT
75
 #define PAGE_HEIGHT 8
76
 #define PAGE_HEIGHT 8
76
 
77
 
77
-#define X_LO 32
78
-#define Y_LO 32
78
+#define X_LO LCD_PIXEL_OFFSET_X
79
+#define Y_LO LCD_PIXEL_OFFSET_Y
79
 #define X_HI (X_LO + 2 * WIDTH  - 1)
80
 #define X_HI (X_LO + 2 * WIDTH  - 1)
80
 #define Y_HI (Y_LO + 2 * HEIGHT - 1)
81
 #define Y_HI (Y_LO + 2 * HEIGHT - 1)
81
 
82
 
142
 };
143
 };
143
 
144
 
144
 static const uint8_t clear_screen_sequence[] = {
145
 static const uint8_t clear_screen_sequence[] = {
145
-  U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, 0x01, 0x3F,
146
-  U8G_ESC_ADR(0), LCD_ROW,    U8G_ESC_ADR(1), 0x00, 0x00, 0x00, 0xEF,
146
+  U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_WIDTH),
147
+  U8G_ESC_ADR(0), LCD_ROW,    U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_HEIGHT),
147
   U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1),
148
   U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1),
148
   U8G_ESC_END
149
   U8G_ESC_END
149
 };
150
 };

+ 9
- 0
Marlin/src/lcd/dogm/ultralcd_DOGM.h ファイルの表示

145
   #define LCD_PIXEL_HEIGHT 64
145
   #define LCD_PIXEL_HEIGHT 64
146
 #endif
146
 #endif
147
 
147
 
148
+// LCD_FULL_PIXEL_WIDTH = 
149
+// LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X 
150
+#if ENABLED(FSMC_GRAPHICAL_TFT)
151
+  #define LCD_FULL_PIXEL_WIDTH  320
152
+  #define LCD_PIXEL_OFFSET_X    32  
153
+  #define LCD_FULL_PIXEL_HEIGHT 240
154
+  #define LCD_PIXEL_OFFSET_Y    32
155
+#endif
156
+
148
 // For selective rendering within a Y range
157
 // For selective rendering within a Y range
149
 #define PAGE_OVER(ya)         ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top?
158
 #define PAGE_OVER(ya)         ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top?
150
 #define PAGE_UNDER(yb)        ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom?
159
 #define PAGE_UNDER(yb)        ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom?

読み込み中…
キャンセル
保存