LCD updates
This commit is contained in:
parent
7dd0a46732
commit
0fcec02db5
8 changed files with 190 additions and 167 deletions
|
@ -23,21 +23,20 @@
|
||||||
#ifndef ULCDST7565_H
|
#ifndef ULCDST7565_H
|
||||||
#define ULCDST7565_H
|
#define ULCDST7565_H
|
||||||
|
|
||||||
#include "Marlin.h"
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(U8GLIB_ST7565_64128N)
|
|
||||||
|
|
||||||
|
#if !( defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 \
|
||||||
|
&& defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 \
|
||||||
|
&& defined(DOGLCD_CS) && DOGLCD_CS >= 0 \
|
||||||
|
&& defined(DOGLCD_A0) && DOGLCD_A0 >= 0 )
|
||||||
|
#error "DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, and DOGLCD_A0 are required for VIKI."
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ST7565_CLK_PIN DOGLCD_SCK
|
#define ST7565_CLK_PIN DOGLCD_SCK
|
||||||
#define ST7565_DAT_PIN DOGLCD_MOSI
|
#define ST7565_DAT_PIN DOGLCD_MOSI
|
||||||
#define ST7565_CS_PIN DOGLCD_CS
|
#define ST7565_CS_PIN DOGLCD_CS
|
||||||
#define ST7565_A0_PIN DOGLCD_A0
|
#define ST7565_A0_PIN DOGLCD_A0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <U8glib.h>
|
#include <U8glib.h>
|
||||||
|
|
||||||
#define WIDTH 128
|
#define WIDTH 128
|
||||||
|
@ -116,110 +115,108 @@ static void ST7565_SWSPI_SND_8BIT(uint8_t val) {
|
||||||
#define U8G_DELAY u8g_10MicroDelay()
|
#define U8G_DELAY u8g_10MicroDelay()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ST7565_CS() { WRITE(ST7565_CS_PIN,1); U8G_DELAY; }
|
#define ST7565_CS() do{ WRITE(ST7565_CS_PIN, HIGH); U8G_DELAY; }while(0)
|
||||||
#define ST7565_NCS() { WRITE(ST7565_CS_PIN,0); }
|
#define ST7565_NCS() WRITE(ST7565_CS_PIN, LOW)
|
||||||
#define ST7565_A0() { WRITE(ST7565_A0_PIN,1); U8G_DELAY; }
|
#define ST7565_A0() do{ WRITE(ST7565_A0_PIN, HIGH); U8G_DELAY; }while(0)
|
||||||
#define ST7565_NA0() { WRITE(ST7565_A0_PIN,0); }
|
#define ST7565_NA0() WRITE(ST7565_A0_PIN, LOW)
|
||||||
#define ST7565_WRITE_BYTE(a) { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY; }
|
#define ST7565_WRITE_BYTE(a) do{ ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY; }while(0)
|
||||||
#define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; i++) {ST7565_SWSPI_SND_8BIT( *ptr++);} DELAY_10US; }
|
#define ST7560_WriteSequence(count, pointer) do{ uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; ++i) { ST7565_SWSPI_SND_8BIT(*ptr++); } DELAY_10US; }while(0)
|
||||||
|
|
||||||
|
|
||||||
uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
|
uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case U8G_DEV_MSG_INIT:
|
case U8G_DEV_MSG_INIT: {
|
||||||
{ OUT_WRITE(ST7565_CS_PIN, LOW);
|
OUT_WRITE(ST7565_CS_PIN, LOW);
|
||||||
OUT_WRITE(ST7565_DAT_PIN, LOW);
|
OUT_WRITE(ST7565_DAT_PIN, LOW);
|
||||||
OUT_WRITE(ST7565_CLK_PIN, LOW);
|
OUT_WRITE(ST7565_CLK_PIN, LOW);
|
||||||
OUT_WRITE(ST7565_A0_PIN, LOW);
|
OUT_WRITE(ST7565_A0_PIN, LOW);
|
||||||
|
|
||||||
ST7565_CS(); /* disable chip */
|
ST7565_CS(); // disable chip
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_NCS(); /* enable chip */
|
ST7565_NCS(); // enable chip
|
||||||
|
|
||||||
|
ST7565_WRITE_BYTE(0xA2); // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet)
|
||||||
|
ST7565_WRITE_BYTE(0xA0); // Normal ADC Select (according to Displaytech 64128N datasheet)
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x0A2); /* 0x0a2: LCD bias 1/9 (according to Displaytech 64128N datasheet) */
|
ST7565_WRITE_BYTE(0xC8); // common output mode: set scan direction normal operation/SHL Select; 0xC0 --> SHL = 0; normal; 0xC8 --> SHL = 1
|
||||||
ST7565_WRITE_BYTE(0x0A0); /* Normal ADC Select (according to Displaytech 64128N datasheet) */
|
ST7565_WRITE_BYTE(0x40); // Display start line for Displaytech 64128N
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x0c8); /* common output mode: set scan direction normal operation/SHL Select; 0x0c0 --> SHL = 0; normal; 0x0c8 --> SHL = 1 */
|
ST7565_WRITE_BYTE(0x28 | 0x04); // power control: turn on voltage converter
|
||||||
ST7565_WRITE_BYTE(0x040); /* Display start line for Displaytech 64128N */
|
//U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x028 | 0x04); /* power control: turn on voltage converter */
|
ST7565_WRITE_BYTE(0x28 | 0x06); // power control: turn on voltage regulator
|
||||||
// U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */
|
//U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x028 | 0x06); /* power control: turn on voltage regulator */
|
ST7565_WRITE_BYTE(0x28 | 0x07); // power control: turn on voltage follower
|
||||||
// U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */
|
//U8G_ESC_DLY(50); // delay 50 ms - hangs after a reset if used
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x028 | 0x07); /* power control: turn on voltage follower */
|
ST7565_WRITE_BYTE(0x10); // Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N
|
||||||
// U8G_ESC_DLY(50); /* delay 50 ms - hangs after a reset if used */
|
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x010); /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */
|
ST7565_WRITE_BYTE(0xA6); // display normal, bit val 0: LCD pixel off.
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x0a6); /* display normal, bit val 0: LCD pixel off. */
|
ST7565_WRITE_BYTE(0x81); // set contrast
|
||||||
|
ST7565_WRITE_BYTE(0x1E); // Contrast value. Setting for controlling brightness of Displaytech 64128N
|
||||||
|
|
||||||
ST7565_WRITE_BYTE(0x081); /* set contrast */
|
ST7565_WRITE_BYTE(0xAF); // display on
|
||||||
ST7565_WRITE_BYTE(0x01e); /* Contrast value. Setting for controlling brightness of Displaytech 64128N */
|
|
||||||
|
|
||||||
|
U8G_ESC_DLY(100); // delay 100 ms
|
||||||
ST7565_WRITE_BYTE(0x0af); /* display on */
|
ST7565_WRITE_BYTE(0xA5); // display all points; ST7565
|
||||||
|
U8G_ESC_DLY(100); // delay 100 ms
|
||||||
U8G_ESC_DLY(100); /* delay 100 ms */
|
U8G_ESC_DLY(100); // delay 100 ms
|
||||||
ST7565_WRITE_BYTE(0x0a5); /* display all points; ST7565 */
|
ST7565_WRITE_BYTE(0xA4); // normal display
|
||||||
U8G_ESC_DLY(100); /* delay 100 ms */
|
ST7565_CS(); // disable chip
|
||||||
U8G_ESC_DLY(100); /* delay 100 ms */
|
} // end of sequence
|
||||||
ST7565_WRITE_BYTE(0x0a4); /* normal display */
|
|
||||||
ST7565_CS(); /* disable chip */
|
|
||||||
} /* end of sequence */
|
|
||||||
break;
|
break;
|
||||||
case U8G_DEV_MSG_STOP:
|
case U8G_DEV_MSG_STOP:
|
||||||
break;
|
break;
|
||||||
case U8G_DEV_MSG_PAGE_NEXT:
|
case U8G_DEV_MSG_PAGE_NEXT: {
|
||||||
{ u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
|
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
|
||||||
ST7565_CS(); /* disable chip */
|
ST7565_CS(); // disable chip
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_NCS(); /* enable chip */
|
ST7565_NCS(); // enable chip
|
||||||
ST7565_WRITE_BYTE(0x010); /* set upper 4 bit of the col adr to 0x10 */
|
ST7565_WRITE_BYTE(0x10); // set upper 4 bit of the col adr to 0x10
|
||||||
ST7565_WRITE_BYTE(0x000); /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
|
ST7565_WRITE_BYTE(0x00); // set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N
|
||||||
/* end of sequence */
|
// end of sequence
|
||||||
ST7565_WRITE_BYTE(0x0b0 | (2*pb->p.page));; /* select current page (ST7565R) */
|
ST7565_WRITE_BYTE(0xB0 | (2 * pb->p.page)); // select current page (ST7565R)
|
||||||
ST7565_A0(); /* data mode */
|
ST7565_A0(); // data mode
|
||||||
ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf);
|
ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf);
|
||||||
ST7565_CS(); /* disable chip */
|
ST7565_CS(); // disable chip
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_NCS(); /* enable chip */
|
ST7565_NCS(); // enable chip
|
||||||
ST7565_WRITE_BYTE(0x010); /* set upper 4 bit of the col adr to 0x10 */
|
ST7565_WRITE_BYTE(0x10); // set upper 4 bit of the col adr to 0x10
|
||||||
ST7565_WRITE_BYTE(0x000); /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
|
ST7565_WRITE_BYTE(0x00); // set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N
|
||||||
/* end of sequence */
|
// end of sequence
|
||||||
ST7565_WRITE_BYTE(0x0b0 | (2*pb->p.page+1)); /* select current page (ST7565R) */
|
ST7565_WRITE_BYTE(0xB0 | (2 * pb->p.page + 1)); // select current page (ST7565R)
|
||||||
ST7565_A0(); /* data mode */
|
ST7565_A0(); // data mode
|
||||||
ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf)+pb->width);
|
ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf)+pb->width);
|
||||||
ST7565_CS(); /* disable chip */
|
ST7565_CS(); // disable chip
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case U8G_DEV_MSG_CONTRAST:
|
case U8G_DEV_MSG_CONTRAST:
|
||||||
ST7565_NCS();
|
ST7565_NCS();
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_WRITE_BYTE(0x081);
|
ST7565_WRITE_BYTE(0x81);
|
||||||
ST7565_WRITE_BYTE((*(uint8_t *)arg) >> 2);
|
ST7565_WRITE_BYTE((*(uint8_t *)arg) >> 2);
|
||||||
ST7565_CS(); /* disable chip */
|
ST7565_CS(); // disable chip
|
||||||
return 1;
|
return 1;
|
||||||
case U8G_DEV_MSG_SLEEP_ON:
|
case U8G_DEV_MSG_SLEEP_ON:
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_NCS(); /* enable chip */
|
ST7565_NCS(); // enable chip
|
||||||
ST7565_WRITE_BYTE(0x0ac); /* static indicator off */
|
ST7565_WRITE_BYTE(0xAC); // static indicator off
|
||||||
ST7565_WRITE_BYTE(0x000); /* indicator register set (not sure if this is required) */
|
ST7565_WRITE_BYTE(0x00); // indicator register set (not sure if this is required)
|
||||||
ST7565_WRITE_BYTE(0x0ae); /* display off */
|
ST7565_WRITE_BYTE(0xAE); // display off
|
||||||
ST7565_WRITE_BYTE(0x0a5); /* all points on */
|
ST7565_WRITE_BYTE(0xA5); // all points on
|
||||||
ST7565_CS(); /* disable chip , bugfix 12 nov 2014 */
|
ST7565_CS(); // disable chip , bugfix 12 nov 2014
|
||||||
/* end of sequence */
|
// end of sequence
|
||||||
return 1;
|
return 1;
|
||||||
case U8G_DEV_MSG_SLEEP_OFF:
|
case U8G_DEV_MSG_SLEEP_OFF:
|
||||||
ST7565_NA0(); /* instruction mode */
|
ST7565_NA0(); // instruction mode
|
||||||
ST7565_NCS(); /* enable chip */
|
ST7565_NCS(); // enable chip
|
||||||
ST7565_WRITE_BYTE(0x0a4); /* all points off */
|
ST7565_WRITE_BYTE(0xA4); // all points off
|
||||||
ST7565_WRITE_BYTE(0x0af); /* display on */
|
ST7565_WRITE_BYTE(0xAF); // display on
|
||||||
U8G_ESC_DLY(50); /* delay 50 ms */
|
U8G_ESC_DLY(50); // delay 50 ms
|
||||||
ST7565_CS(); /* disable chip , bugfix 12 nov 2014 */
|
ST7565_CS(); // disable chip , bugfix 12 nov 2014
|
||||||
/* end of sequence */
|
// end of sequence
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
|
return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
|
||||||
|
@ -229,7 +226,6 @@ uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[WIDTH*2] U8G_NOCOMMON ;
|
||||||
u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = { { 16, HEIGHT, 0, 0, 0 }, WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf };
|
u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = { { 16, HEIGHT, 0, 0, 0 }, WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf };
|
||||||
u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = { u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn };
|
u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = { u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn };
|
||||||
|
|
||||||
|
|
||||||
class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
|
class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
|
||||||
public:
|
public:
|
||||||
U8GLIB_ST7565_64128n_2x_VIKI(uint8_t dummy)
|
U8GLIB_ST7565_64128n_2x_VIKI(uint8_t dummy)
|
||||||
|
@ -240,9 +236,6 @@ class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma GCC reset_options
|
#pragma GCC reset_options
|
||||||
|
|
||||||
#endif // U8GLIB_ST7565
|
|
||||||
#endif // ULCDST7565_H
|
#endif // ULCDST7565_H
|
||||||
|
|
|
@ -23,9 +23,7 @@
|
||||||
#ifndef ULCDST7920_H
|
#ifndef ULCDST7920_H
|
||||||
#define ULCDST7920_H
|
#define ULCDST7920_H
|
||||||
|
|
||||||
#include "Marlin.h"
|
#include "../../Marlin.h"
|
||||||
|
|
||||||
#if ENABLED(U8GLIB_ST7920)
|
|
||||||
|
|
||||||
#define ST7920_CLK_PIN LCD_PINS_D4
|
#define ST7920_CLK_PIN LCD_PINS_D4
|
||||||
#define ST7920_DAT_PIN LCD_PINS_ENABLE
|
#define ST7920_DAT_PIN LCD_PINS_ENABLE
|
||||||
|
@ -186,5 +184,4 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB {
|
||||||
|
|
||||||
#pragma GCC reset_options
|
#pragma GCC reset_options
|
||||||
|
|
||||||
#endif // U8GLIB_ST7920
|
|
||||||
#endif // ULCDST7920_H
|
#endif // ULCDST7920_H
|
||||||
|
|
|
@ -20,6 +20,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* thermistornames.h
|
||||||
|
*
|
||||||
|
* Used by LCD code to obtain a thermistor name
|
||||||
|
*
|
||||||
|
* Usage: Set THERMISTOR_ID then #include this file
|
||||||
|
* to set a new value for THERMISTOR_NAME.
|
||||||
|
*/
|
||||||
|
|
||||||
#undef THERMISTOR_NAME
|
#undef THERMISTOR_NAME
|
||||||
|
|
||||||
// Thermcouples
|
// Thermcouples
|
||||||
|
|
|
@ -20,33 +20,43 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ultralcd.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(ULTRA_LCD)
|
#if ENABLED(ULTRA_LCD)
|
||||||
#include "Marlin.h"
|
|
||||||
#include "language.h"
|
#include "ultralcd.h"
|
||||||
#include "cardreader.h"
|
|
||||||
#include "temperature.h"
|
#include "../sd/cardreader.h"
|
||||||
#include "planner.h"
|
#include "../module/temperature.h"
|
||||||
#include "stepper.h"
|
#include "../module/planner.h"
|
||||||
#include "configuration_store.h"
|
#include "../module/stepper.h"
|
||||||
#include "utility.h"
|
#include "../module/configuration_store.h"
|
||||||
|
|
||||||
|
#include "../Marlin.h"
|
||||||
|
|
||||||
#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
|
#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
|
||||||
#include "buzzer.h"
|
#include "../libs/buzzer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(PRINTCOUNTER)
|
#if ENABLED(PRINTCOUNTER)
|
||||||
#include "printcounter.h"
|
#include "../module/printcounter.h"
|
||||||
#include "duration_t.h"
|
#include "../libs/duration_t.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
||||||
|
#include "../feature/filwidth.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAS_BED_PROBE
|
||||||
|
#include "../module/probe.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(BLTOUCH)
|
#if ENABLED(BLTOUCH)
|
||||||
#include "endstops.h"
|
#include "../module/endstops.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if HAS_LEVELING
|
||||||
#include "ubl.h"
|
#include "../feature/bedlevel/bedlevel.h"
|
||||||
bool ubl_lcd_map_control = false;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialized by settings.load()
|
// Initialized by settings.load()
|
||||||
|
@ -92,7 +102,7 @@ uint16_t max_display_update_time = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(DAC_STEPPER_CURRENT)
|
#if ENABLED(DAC_STEPPER_CURRENT)
|
||||||
#include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
|
#include "../feature/dac/stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
|
||||||
uint8_t driverPercent[XYZE];
|
uint8_t driverPercent[XYZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -102,9 +112,6 @@ uint16_t max_display_update_time = 0;
|
||||||
#define TALL_FONT_CORRECTION 0
|
#define TALL_FONT_CORRECTION 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Function pointer to menu functions.
|
|
||||||
typedef void (*screenFunc_t)();
|
|
||||||
|
|
||||||
#if HAS_POWER_SWITCH
|
#if HAS_POWER_SWITCH
|
||||||
extern bool powersupply_on;
|
extern bool powersupply_on;
|
||||||
#endif
|
#endif
|
||||||
|
@ -161,7 +168,7 @@ uint16_t max_display_update_time = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
|
#if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
|
||||||
#include "mesh_bed_leveling.h"
|
#include "../feature/mbl/mesh_bed_leveling.h"
|
||||||
extern void mesh_probing_done();
|
extern void mesh_probing_done();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -443,7 +450,7 @@ uint16_t max_display_update_time = 0;
|
||||||
/**
|
/**
|
||||||
* General function to go directly to a screen
|
* General function to go directly to a screen
|
||||||
*/
|
*/
|
||||||
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
|
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
|
||||||
if (currentScreen != screen) {
|
if (currentScreen != screen) {
|
||||||
|
|
||||||
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING)
|
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING)
|
||||||
|
@ -469,14 +476,14 @@ uint16_t max_display_update_time = 0;
|
||||||
if (screen == lcd_status_screen) {
|
if (screen == lcd_status_screen) {
|
||||||
defer_return_to_status = false;
|
defer_return_to_status = false;
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
ubl_lcd_map_control = false;
|
ubl.lcd_map_control = false;
|
||||||
#endif
|
#endif
|
||||||
screen_history_depth = 0;
|
screen_history_depth = 0;
|
||||||
}
|
}
|
||||||
lcd_implementation_clear();
|
lcd_implementation_clear();
|
||||||
// Re-initialize custom characters that may be re-used
|
// Re-initialize custom characters that may be re-used
|
||||||
#if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
|
#if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
if (!ubl_lcd_map_control) lcd_set_custom_characters(
|
if (!ubl.lcd_map_control) lcd_set_custom_characters(
|
||||||
#if ENABLED(LCD_PROGRESS_BAR)
|
#if ENABLED(LCD_PROGRESS_BAR)
|
||||||
screen == lcd_status_screen
|
screen == lcd_status_screen
|
||||||
#endif
|
#endif
|
||||||
|
@ -928,7 +935,7 @@ void kill_screen(const char* lcd_msg) {
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
if (card.cardOK) {
|
if (card.cardOK) {
|
||||||
if (card.isFileOpen()) {
|
if (card.isFileOpen()) {
|
||||||
if (card.sdprinting)
|
if (IS_SD_PRINTING)
|
||||||
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
|
||||||
else
|
else
|
||||||
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
|
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
|
||||||
|
@ -2224,7 +2231,7 @@ void kill_screen(const char* lcd_msg) {
|
||||||
|
|
||||||
void _lcd_ubl_map_homing() {
|
void _lcd_ubl_map_homing() {
|
||||||
defer_return_to_status = true;
|
defer_return_to_status = true;
|
||||||
ubl_lcd_map_control = true; // Return to the map screen
|
ubl.lcd_map_control = true; // Return to the map screen
|
||||||
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
|
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
|
||||||
lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
|
lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
|
||||||
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
||||||
|
|
|
@ -23,15 +23,21 @@
|
||||||
#ifndef ULTRALCD_H
|
#ifndef ULTRALCD_H
|
||||||
#define ULTRALCD_H
|
#define ULTRALCD_H
|
||||||
|
|
||||||
#include "Marlin.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(ULTRA_LCD)
|
#if ENABLED(ULTRA_LCD)
|
||||||
|
|
||||||
|
#include "../Marlin.h"
|
||||||
|
|
||||||
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
|
#define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
|
||||||
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
|
#define BUTTON_PRESSED(BN) !READ(BTN_## BN)
|
||||||
|
|
||||||
extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
|
extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
|
||||||
|
|
||||||
|
#if ENABLED(LCD_BED_LEVELING) && ENABLED(PROBE_MANUALLY)
|
||||||
|
extern bool lcd_wait_for_move;
|
||||||
|
#endif
|
||||||
|
|
||||||
int16_t lcd_strlen(const char* s);
|
int16_t lcd_strlen(const char* s);
|
||||||
int16_t lcd_strlen_P(const char* s);
|
int16_t lcd_strlen_P(const char* s);
|
||||||
void lcd_update();
|
void lcd_update();
|
||||||
|
@ -74,6 +80,11 @@
|
||||||
|
|
||||||
#if ENABLED(ULTIPANEL)
|
#if ENABLED(ULTIPANEL)
|
||||||
|
|
||||||
|
// Function pointer to menu functions.
|
||||||
|
typedef void (*screenFunc_t)();
|
||||||
|
|
||||||
|
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
|
||||||
|
|
||||||
#define BLEN_A 0
|
#define BLEN_A 0
|
||||||
#define BLEN_B 1
|
#define BLEN_B 1
|
||||||
// Encoder click is directly connected
|
// Encoder click is directly connected
|
||||||
|
@ -91,7 +102,18 @@
|
||||||
|
|
||||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||||
void lcd_advanced_pause_show_message(const AdvancedPauseMessage message);
|
void lcd_advanced_pause_show_message(const AdvancedPauseMessage message);
|
||||||
#endif // ADVANCED_PAUSE_FEATURE
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
|
void lcd_mesh_edit_setup(float initial);
|
||||||
|
float lcd_mesh_edit();
|
||||||
|
void lcd_z_offset_edit_setup(float);
|
||||||
|
float lcd_z_offset_edit();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(DELTA_CALIBRATION_MENU)
|
||||||
|
float lcd_probe_pt(const float &lx, const float &ly);
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -189,16 +211,9 @@
|
||||||
|
|
||||||
void lcd_reset_status();
|
void lcd_reset_status();
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
// For i2c define BUZZ to use lcd_buzz
|
||||||
extern bool ubl_lcd_map_control;
|
#if ENABLED(LCD_USE_I2C_BUZZER)
|
||||||
void lcd_mesh_edit_setup(float initial);
|
#define BUZZ(d,f) lcd_buzz(d, f)
|
||||||
float lcd_mesh_edit();
|
|
||||||
void lcd_z_offset_edit_setup(float);
|
|
||||||
float lcd_z_offset_edit();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ENABLED(DELTA_CALIBRATION_MENU)
|
|
||||||
float lcd_probe_pt(const float &lx, const float &ly);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // ULTRALCD_H
|
#endif // ULTRALCD_H
|
||||||
|
|
|
@ -36,27 +36,27 @@
|
||||||
#ifndef ULTRALCD_IMPL_DOGM_H
|
#ifndef ULTRALCD_IMPL_DOGM_H
|
||||||
#define ULTRALCD_IMPL_DOGM_H
|
#define ULTRALCD_IMPL_DOGM_H
|
||||||
|
|
||||||
#include "MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of the LCD display routines for a DOGM128 graphic display.
|
|
||||||
* These are common LCD 128x64 pixel graphic displays.
|
|
||||||
*/
|
|
||||||
#include "ultralcd.h"
|
#include "ultralcd.h"
|
||||||
#include "ultralcd_st7920_u8glib_rrd.h"
|
|
||||||
#include "ultralcd_st7565_u8glib_VIKI.h"
|
#if ENABLED(U8GLIB_ST7565_64128N)
|
||||||
#include "dogm_bitmaps.h"
|
#include "dogm/ultralcd_st7565_u8glib_VIKI.h"
|
||||||
#include "utility.h"
|
#elif ENABLED(U8GLIB_ST7920)
|
||||||
#include "duration_t.h"
|
#include "dogm/ultralcd_st7920_u8glib_rrd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "dogm/dogm_bitmaps.h"
|
||||||
|
#include "../libs/duration_t.h"
|
||||||
|
|
||||||
#include <U8glib.h>
|
#include <U8glib.h>
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
#include "ubl.h"
|
#include "../feature/ubl/ubl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
|
#if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
|
||||||
#include "_Bootscreen.h"
|
#include "../config/_Bootscreen.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Only Western languages support big / small fonts
|
// Only Western languages support big / small fonts
|
||||||
|
@ -66,57 +66,57 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(USE_SMALL_INFOFONT)
|
#if ENABLED(USE_SMALL_INFOFONT)
|
||||||
#include "dogm_font_data_6x9_marlin.h"
|
#include "dogm/dogm_font_data_6x9_marlin.h"
|
||||||
#define FONT_STATUSMENU_NAME u8g_font_6x9
|
#define FONT_STATUSMENU_NAME u8g_font_6x9
|
||||||
#else
|
#else
|
||||||
#define FONT_STATUSMENU_NAME FONT_MENU_NAME
|
#define FONT_STATUSMENU_NAME FONT_MENU_NAME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "dogm_font_data_Marlin_symbols.h" // The Marlin special symbols
|
#include "dogm/dogm_font_data_Marlin_symbols.h" // The Marlin special symbols
|
||||||
#define FONT_SPECIAL_NAME Marlin_symbols
|
#define FONT_SPECIAL_NAME Marlin_symbols
|
||||||
|
|
||||||
#if DISABLED(SIMULATE_ROMFONT)
|
#if DISABLED(SIMULATE_ROMFONT)
|
||||||
#if ENABLED(DISPLAY_CHARSET_ISO10646_1)
|
#if ENABLED(DISPLAY_CHARSET_ISO10646_1)
|
||||||
#include "dogm_font_data_ISO10646_1.h"
|
#include "dogm/dogm_font_data_ISO10646_1.h"
|
||||||
#define FONT_MENU_NAME ISO10646_1_5x7
|
#define FONT_MENU_NAME ISO10646_1_5x7
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_PL)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_PL)
|
||||||
#include "dogm_font_data_ISO10646_1_PL.h"
|
#include "dogm/dogm_font_data_ISO10646_1_PL.h"
|
||||||
#define FONT_MENU_NAME ISO10646_1_PL_5x7
|
#define FONT_MENU_NAME ISO10646_1_PL_5x7
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
|
||||||
#include "dogm_font_data_ISO10646_5_Cyrillic.h"
|
#include "dogm/dogm_font_data_ISO10646_5_Cyrillic.h"
|
||||||
#define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7
|
#define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
|
||||||
#include "dogm_font_data_ISO10646_Kana.h"
|
#include "dogm/dogm_font_data_ISO10646_Kana.h"
|
||||||
#define FONT_MENU_NAME ISO10646_Kana_5x7
|
#define FONT_MENU_NAME ISO10646_Kana_5x7
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
|
||||||
#include "dogm_font_data_ISO10646_Greek.h"
|
#include "dogm/dogm_font_data_ISO10646_Greek.h"
|
||||||
#define FONT_MENU_NAME ISO10646_Greek_5x7
|
#define FONT_MENU_NAME ISO10646_Greek_5x7
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
|
||||||
#include "dogm_font_data_ISO10646_CN.h"
|
#include "dogm/dogm_font_data_ISO10646_CN.h"
|
||||||
#define FONT_MENU_NAME ISO10646_CN
|
#define FONT_MENU_NAME ISO10646_CN
|
||||||
#define TALL_FONT_CORRECTION 1
|
#define TALL_FONT_CORRECTION 1
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_TR)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_TR)
|
||||||
#include "dogm_font_data_ISO10646_1_tr.h"
|
#include "dogm/dogm_font_data_ISO10646_1_tr.h"
|
||||||
#define FONT_MENU_NAME ISO10646_TR
|
#define FONT_MENU_NAME ISO10646_TR
|
||||||
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ)
|
#elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ)
|
||||||
#include "dogm_font_data_ISO10646_CZ.h"
|
#include "dogm/dogm_font_data_ISO10646_CZ.h"
|
||||||
#define FONT_MENU_NAME ISO10646_CZ
|
#define FONT_MENU_NAME ISO10646_CZ
|
||||||
#else // fall-back
|
#else // fall-back
|
||||||
#include "dogm_font_data_ISO10646_1.h"
|
#include "dogm/dogm_font_data_ISO10646_1.h"
|
||||||
#define FONT_MENU_NAME ISO10646_1_5x7
|
#define FONT_MENU_NAME ISO10646_1_5x7
|
||||||
#endif
|
#endif
|
||||||
#else // SIMULATE_ROMFONT
|
#else // SIMULATE_ROMFONT
|
||||||
#if DISPLAY_CHARSET_HD44780 == JAPANESE
|
#if DISPLAY_CHARSET_HD44780 == JAPANESE
|
||||||
#include "dogm_font_data_HD44780_J.h"
|
#include "dogm/dogm_font_data_HD44780_J.h"
|
||||||
#define FONT_MENU_NAME HD44780_J_5x7
|
#define FONT_MENU_NAME HD44780_J_5x7
|
||||||
#elif DISPLAY_CHARSET_HD44780 == WESTERN
|
#elif DISPLAY_CHARSET_HD44780 == WESTERN
|
||||||
#include "dogm_font_data_HD44780_W.h"
|
#include "dogm/dogm_font_data_HD44780_W.h"
|
||||||
#define FONT_MENU_NAME HD44780_W_5x7
|
#define FONT_MENU_NAME HD44780_W_5x7
|
||||||
#elif DISPLAY_CHARSET_HD44780 == CYRILLIC
|
#elif DISPLAY_CHARSET_HD44780 == CYRILLIC
|
||||||
#include "dogm_font_data_HD44780_C.h"
|
#include "dogm/dogm_font_data_HD44780_C.h"
|
||||||
#define FONT_MENU_NAME HD44780_C_5x7
|
#define FONT_MENU_NAME HD44780_C_5x7
|
||||||
#else // fall-back
|
#else // fall-back
|
||||||
#include "dogm_font_data_ISO10646_1.h"
|
#include "dogm/dogm_font_data_ISO10646_1.h"
|
||||||
#define FONT_MENU_NAME ISO10646_1_5x7
|
#define FONT_MENU_NAME ISO10646_1_5x7
|
||||||
#endif
|
#endif
|
||||||
#endif // SIMULATE_ROMFONT
|
#endif // SIMULATE_ROMFONT
|
||||||
|
@ -178,7 +178,6 @@
|
||||||
U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI
|
U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI
|
||||||
//U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes
|
//U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes
|
||||||
//U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes HWSPI
|
//U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes HWSPI
|
||||||
|
|
||||||
#elif ENABLED(U8GLIB_SSD1306)
|
#elif ENABLED(U8GLIB_SSD1306)
|
||||||
// Generic support for SSD1306 OLED I2C LCDs
|
// Generic support for SSD1306 OLED I2C LCDs
|
||||||
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes
|
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 8 stripes
|
||||||
|
|
|
@ -28,11 +28,14 @@
|
||||||
* These are the most common LCD character displays.
|
* These are the most common LCD character displays.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "utility.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
#include "duration_t.h"
|
|
||||||
|
#if LCD_HEIGHT > 3
|
||||||
|
#include "../libs/duration_t.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
#include "ubl.h"
|
#include "../feature/ubl/ubl.h"
|
||||||
|
|
||||||
#if ENABLED(ULTIPANEL)
|
#if ENABLED(ULTIPANEL)
|
||||||
#define ULTRA_X_PIXELS_PER_CHAR 5
|
#define ULTRA_X_PIXELS_PER_CHAR 5
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifndef UTF_MAPPER_H
|
#ifndef UTF_MAPPER_H
|
||||||
#define UTF_MAPPER_H
|
#define UTF_MAPPER_H
|
||||||
|
|
||||||
#include "language.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if ENABLED(DOGLCD)
|
#if ENABLED(DOGLCD)
|
||||||
#define HARDWARE_CHAR_OUT u8g.print
|
#define HARDWARE_CHAR_OUT u8g.print
|
||||||
|
|
Reference in a new issue