LiquidCrystal class renamed to LiquidCrystal_Prusa

This commit is contained in:
Robert Pelnar 2018-03-29 17:50:43 +02:00
parent 186e630299
commit 363a9d24b3
9 changed files with 57 additions and 57 deletions

View File

@ -690,7 +690,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define LCD_I2C_SAINSMART_YWROBOT
#ifdef LCD_I2C_SAINSMART_YWROBOT
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-LiquidCrystal_Prusa/wiki/Home )
// Make sure it is placed in the Arduino libraries directory.
#define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
@ -745,7 +745,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Shift register panels
// ---------------------
// 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
// https://bitbucket.org/fmalpartida/new-LiquidCrystal_Prusa/wiki/schematics#!shiftregister-connection
//#define SAV_3DLCD
#ifdef SAV_3DLCD

View File

@ -43,7 +43,7 @@
#elif defined(DOGLCD)
#include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
#else
#include "LiquidCrystal.h" // library for character LCD
#include "LiquidCrystal_Prusa.h" // library for character LCD
#endif
#endif

View File

@ -1,4 +1,4 @@
#include "LiquidCrystal.h"
#include "LiquidCrystal_Prusa.h"
#include <stdio.h>
#include <string.h>
@ -22,35 +22,35 @@
//
// Note, however, that resetting the Arduino doesn't reset the LCD, so we
// can't assume that it's in that state when a sketch starts (and the
// LiquidCrystal constructor is called).
// LiquidCrystal_Prusa constructor is called).
LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
LiquidCrystal_Prusa::LiquidCrystal_Prusa(uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7);
}
LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable,
LiquidCrystal_Prusa::LiquidCrystal_Prusa(uint8_t rs, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
init(0, rs, 255, enable, d0, d1, d2, d3, d4, d5, d6, d7);
}
LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
LiquidCrystal_Prusa::LiquidCrystal_Prusa(uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
{
init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
}
LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable,
LiquidCrystal_Prusa::LiquidCrystal_Prusa(uint8_t rs, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
{
init(1, rs, 255, enable, d0, d1, d2, d3, 0, 0, 0, 0);
}
void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
void LiquidCrystal_Prusa::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
@ -82,7 +82,7 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en
begin(16, 1);
}
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
void LiquidCrystal_Prusa::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
@ -162,7 +162,7 @@ void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
void LiquidCrystal::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize) {
void LiquidCrystal_Prusa::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize) {
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
@ -253,21 +253,21 @@ void LiquidCrystal::begin_noclear(uint8_t cols, uint8_t lines, uint8_t dotsize)
/********** high level commands, for the user! */
void LiquidCrystal::clear()
void LiquidCrystal_Prusa::clear()
{
command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
delayMicroseconds(1600); // this command takes a long time
}
void LiquidCrystal::home()
void LiquidCrystal_Prusa::home()
{
command(LCD_RETURNHOME); // set cursor position to zero
delayMicroseconds(1600); // this command takes a long time!
}
void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
void LiquidCrystal_Prusa::setCursor(uint8_t col, uint8_t row)
{
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
if ( row >= _numlines ) {
@ -278,70 +278,70 @@ void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
}
// Turn the display on/off (quickly)
void LiquidCrystal::noDisplay() {
void LiquidCrystal_Prusa::noDisplay() {
_displaycontrol &= ~LCD_DISPLAYON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
void LiquidCrystal::display() {
void LiquidCrystal_Prusa::display() {
_displaycontrol |= LCD_DISPLAYON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
// Turns the underline cursor on/off
void LiquidCrystal::noCursor() {
void LiquidCrystal_Prusa::noCursor() {
_displaycontrol &= ~LCD_CURSORON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
void LiquidCrystal::cursor() {
void LiquidCrystal_Prusa::cursor() {
_displaycontrol |= LCD_CURSORON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
// Turn on and off the blinking cursor
void LiquidCrystal::noBlink() {
void LiquidCrystal_Prusa::noBlink() {
_displaycontrol &= ~LCD_BLINKON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
void LiquidCrystal::blink() {
void LiquidCrystal_Prusa::blink() {
_displaycontrol |= LCD_BLINKON;
command(LCD_DISPLAYCONTROL | _displaycontrol);
}
// These commands scroll the display without changing the RAM
void LiquidCrystal::scrollDisplayLeft(void) {
void LiquidCrystal_Prusa::scrollDisplayLeft(void) {
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
}
void LiquidCrystal::scrollDisplayRight(void) {
void LiquidCrystal_Prusa::scrollDisplayRight(void) {
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
}
// This is for text that flows Left to Right
void LiquidCrystal::leftToRight(void) {
void LiquidCrystal_Prusa::leftToRight(void) {
_displaymode |= LCD_ENTRYLEFT;
command(LCD_ENTRYMODESET | _displaymode);
}
// This is for text that flows Right to Left
void LiquidCrystal::rightToLeft(void) {
void LiquidCrystal_Prusa::rightToLeft(void) {
_displaymode &= ~LCD_ENTRYLEFT;
command(LCD_ENTRYMODESET | _displaymode);
}
// This will 'right justify' text from the cursor
void LiquidCrystal::autoscroll(void) {
void LiquidCrystal_Prusa::autoscroll(void) {
_displaymode |= LCD_ENTRYSHIFTINCREMENT;
command(LCD_ENTRYMODESET | _displaymode);
}
// This will 'left justify' text from the cursor
void LiquidCrystal::noAutoscroll(void) {
void LiquidCrystal_Prusa::noAutoscroll(void) {
_displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
command(LCD_ENTRYMODESET | _displaymode);
}
// Allows us to fill the first 8 CGRAM locations
// with custom characters
void LiquidCrystal::createChar(uint8_t location, uint8_t charmap[]) {
void LiquidCrystal_Prusa::createChar(uint8_t location, uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
command(LCD_SETCGRAMADDR | (location << 3));
for (int i=0; i<8; i++) {
@ -351,11 +351,11 @@ void LiquidCrystal::createChar(uint8_t location, uint8_t charmap[]) {
/*********** mid level commands, for sending data/cmds */
inline void LiquidCrystal::command(uint8_t value) {
inline void LiquidCrystal_Prusa::command(uint8_t value) {
send(value, LOW);
}
inline size_t LiquidCrystal::write(uint8_t value) {
inline size_t LiquidCrystal_Prusa::write(uint8_t value) {
if (_escape[0] || (value == 0x1b))
return escape_write(value);
send(value, HIGH);
@ -368,7 +368,7 @@ inline size_t LiquidCrystal::write(uint8_t value) {
//CursorShow "\x1b[?25h"
//CursorHide "\x1b[?25l"
inline size_t LiquidCrystal::escape_write(uint8_t chr)
inline size_t LiquidCrystal_Prusa::escape_write(uint8_t chr)
{
#define escape_cnt (_escape[0]) //escape character counter
#define is_num_msk (_escape[1]) //numeric character bit mask
@ -502,7 +502,7 @@ end:
/************ low level data pushing commands **********/
// write either command or data, with automatic 4/8-bit selection
void LiquidCrystal::send(uint8_t value, uint8_t mode) {
void LiquidCrystal_Prusa::send(uint8_t value, uint8_t mode) {
digitalWrite(_rs_pin, mode);
// if there is a RW pin indicated, set it low to Write
@ -518,7 +518,7 @@ void LiquidCrystal::send(uint8_t value, uint8_t mode) {
}
}
void LiquidCrystal::pulseEnable(void) {
void LiquidCrystal_Prusa::pulseEnable(void) {
digitalWrite(_enable_pin, LOW);
delayMicroseconds(1);
digitalWrite(_enable_pin, HIGH);
@ -527,7 +527,7 @@ void LiquidCrystal::pulseEnable(void) {
delayMicroseconds(100); // commands need > 37us to settle
}
void LiquidCrystal::write4bits(uint8_t value) {
void LiquidCrystal_Prusa::write4bits(uint8_t value) {
for (int i = 0; i < 4; i++) {
pinMode(_data_pins[i], OUTPUT);
digitalWrite(_data_pins[i], (value >> i) & 0x01);
@ -536,7 +536,7 @@ void LiquidCrystal::write4bits(uint8_t value) {
pulseEnable();
}
void LiquidCrystal::write8bits(uint8_t value) {
void LiquidCrystal_Prusa::write8bits(uint8_t value) {
for (int i = 0; i < 8; i++) {
pinMode(_data_pins[i], OUTPUT);
digitalWrite(_data_pins[i], (value >> i) & 0x01);

View File

@ -1,5 +1,5 @@
#ifndef LiquidCrystal_h
#define LiquidCrystal_h
#ifndef LiquidCrystal_Prusa_h
#define LiquidCrystal_Prusa_h
#include <inttypes.h>
#include "Print.h"
@ -42,17 +42,17 @@
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00
class LiquidCrystal : public Print {
class LiquidCrystal_Prusa : public Print {
public:
LiquidCrystal(uint8_t rs, uint8_t enable,
LiquidCrystal_Prusa(uint8_t rs, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
LiquidCrystal_Prusa(uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
LiquidCrystal_Prusa(uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
LiquidCrystal(uint8_t rs, uint8_t enable,
LiquidCrystal_Prusa(uint8_t rs, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,

View File

@ -810,8 +810,8 @@ void factory_reset(char level, bool quiet)
}
#include "LiquidCrystal.h"
extern LiquidCrystal lcd;
#include "LiquidCrystal_Prusa.h"
extern LiquidCrystal_Prusa lcd;
FILE _lcdout = {0};

View File

@ -42,11 +42,11 @@
/* Russian language not supported yet, needs custom font
#ifdef LANGUAGE_RU
#include "LiquidCrystalRus.h"
#define LCD_CLASS LiquidCrystalRus
#include "LiquidCrystal_Rus.h"
#define LCD_CLASS LiquidCrystal_Rus
#else
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal
#include <LiquidCrystal_Prusa.h>
#define LCD_CLASS LiquidCrystal_Prusa
#endif
*/

View File

@ -9,8 +9,8 @@
#include "fastio.h"
#include "cmdqueue.h"
//#include "LiquidCrystal.h"
//extern LiquidCrystal lcd;
//#include "LiquidCrystal_Prusa.h"
//extern LiquidCrystal_Prusa lcd;
#define FSENSOR_ERR_MAX 5 //filament sensor max error count

View File

@ -3,7 +3,7 @@
#ifdef TMC2130
#include "tmc2130.h"
#include "LiquidCrystal.h"
#include "LiquidCrystal_Prusa.h"
#include "ultralcd.h"
#ifndef NEW_SPI
#include <SPI.h>
@ -12,7 +12,7 @@
#endif //NEW_SPI
extern LiquidCrystal lcd;
extern LiquidCrystal_Prusa lcd;
#define TMC2130_GCONF_NORMAL 0x00000000 // spreadCycle
#define TMC2130_GCONF_SGSENS 0x00003180 // spreadCycle with stallguard (stall activates DIAG0 and DIAG1 [pushpull])

View File

@ -194,7 +194,7 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
// 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
// https://bitbucket.org/fmalpartida/new-LiquidCrystal_Prusa/wiki/schematics#!shiftregister-connection
#elif defined(SR_LCD_2W_NL)
extern "C" void __cxa_pure_virtual() { while (1); }
@ -206,11 +206,11 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
#else
// Standard directly connected LCD implementations
#ifdef LANGUAGE_RU
#include "LiquidCrystalRus.h"
#define LCD_CLASS LiquidCrystalRus
#include "LiquidCrystal_Rus.h"
#define LCD_CLASS LiquidCrystal_Rus
#else
#include "LiquidCrystal.h"
#define LCD_CLASS LiquidCrystal
#include "LiquidCrystal_Prusa.h"
#define LCD_CLASS LiquidCrystal_Prusa
#endif
LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5,LCD_PINS_D6,LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
#endif