mirror of
https://github.com/fmalpartida/New-LiquidCrystal.git
synced 2026-07-28 04:07:33 +00:00
LCD_DATA
This commit is contained in:
@@ -361,12 +361,12 @@ void LCD::command(uint8_t value)
|
||||
#if (ARDUINO < 100)
|
||||
void LCD::write(uint8_t value)
|
||||
{
|
||||
send(value, DATA);
|
||||
send(value, LCD_DATA);
|
||||
}
|
||||
#else
|
||||
size_t LCD::write(uint8_t value)
|
||||
{
|
||||
send(value, DATA);
|
||||
send(value, LCD_DATA);
|
||||
return 1; // assume OK
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -148,7 +148,7 @@ inline static void waitUsec ( uint16_t uSec )
|
||||
// Define COMMAND and DATA LCD Rs (used by send method).
|
||||
// ---------------------------------------------------------------------------
|
||||
#define COMMAND 0
|
||||
#define DATA 1
|
||||
#define LCD_DATA 1
|
||||
#define FOUR_BITS 2
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable,
|
||||
void LiquidCrystal::send(uint8_t value, uint8_t mode)
|
||||
{
|
||||
// Only interested in COMMAND or DATA
|
||||
digitalWrite( _rs_pin, ( mode == DATA ) );
|
||||
digitalWrite( _rs_pin, ( mode == LCD_DATA ) );
|
||||
|
||||
// if there is a RW pin indicated, set it low to Write
|
||||
// ---------------------------------------------------
|
||||
|
||||
@@ -273,7 +273,7 @@ void LiquidCrystal_I2C::write4bits ( uint8_t value, uint8_t mode )
|
||||
|
||||
// Is it a command or data
|
||||
// -----------------------
|
||||
if ( mode == DATA )
|
||||
if ( mode == LCD_DATA )
|
||||
{
|
||||
mode = _Rs;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void LiquidCrystal_SI2C::write4bits ( uint8_t value, uint8_t mode )
|
||||
|
||||
// Is it a command or data
|
||||
// -----------------------
|
||||
if ( mode == DATA )
|
||||
if ( mode == LCD_DATA )
|
||||
{
|
||||
mode = _Rs;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ void LiquidCrystal_SR::send(uint8_t value, uint8_t mode)
|
||||
// Divide byte in two nibbles include the RS signal
|
||||
// and format it for shiftregister output wiring to the LCD
|
||||
// We are only interested in my COMMAND or DATA for myMode
|
||||
uint8_t myMode = ( mode == DATA ) ? SR_RS_BIT : 0; // RS bit; LOW: command. HIGH: character.
|
||||
uint8_t myMode = ( mode == LCD_DATA ) ? SR_RS_BIT : 0; // RS bit; LOW: command. HIGH: character.
|
||||
|
||||
if ( mode != FOUR_BITS )
|
||||
{
|
||||
|
||||
@@ -201,7 +201,7 @@ void LiquidCrystal_SR1W::send(uint8_t value, uint8_t mode)
|
||||
if ( mode != FOUR_BITS )
|
||||
{
|
||||
// upper nibble
|
||||
data = ( mode == DATA ) ? SR1W_RS_MASK : 0;
|
||||
data = ( mode == LCD_DATA ) ? SR1W_RS_MASK : 0;
|
||||
data |= SR1W_EN_MASK | SR1W_UNUSED_MASK;
|
||||
data |= _blMask;
|
||||
|
||||
@@ -214,7 +214,7 @@ void LiquidCrystal_SR1W::send(uint8_t value, uint8_t mode)
|
||||
}
|
||||
|
||||
// lower nibble
|
||||
data = ( mode == DATA ) ? SR1W_RS_MASK : 0;
|
||||
data = ( mode == LCD_DATA ) ? SR1W_RS_MASK : 0;
|
||||
data |= SR1W_EN_MASK | SR1W_UNUSED_MASK;
|
||||
data |= _blMask;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ void LiquidCrystal_SR2W::loadSR(uint8_t val)
|
||||
// send
|
||||
void LiquidCrystal_SR2W::send(uint8_t value, uint8_t mode)
|
||||
{
|
||||
uint8_t myMode = ( mode == DATA ) ? SR2W_RS_MASK : 0;
|
||||
uint8_t myMode = ( mode == LCD_DATA ) ? SR2W_RS_MASK : 0;
|
||||
|
||||
myMode = myMode | SR2W_EN_MASK | _blMask;
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ void LiquidCrystal_SR3W::write4bits(uint8_t value, uint8_t mode)
|
||||
|
||||
// Is it a command or data
|
||||
// -----------------------
|
||||
mode = ( mode == DATA ) ? _Rs : 0;
|
||||
mode = ( mode == LCD_DATA ) ? _Rs : 0;
|
||||
|
||||
pinMapValue |= mode | _backlightStsMask;
|
||||
loadSR ( pinMapValue | _En ); // Send with enable high
|
||||
|
||||
Reference in New Issue
Block a user