library/hd44780/hd44780ioClass/hd44780_NTCU165ECPB.h
int hd44780cmd(uint8_t value)
{
	// detect the hd44780 command
	if(value & HD44780_SETDDRAMADDR)
	{
		_cgmode = 0; // back to ddram mode
		devicewrite(CMD_SETDIGPOINTER | (value & 0xf));
	}
	else if(value & HD44780_SETCGRAMADDR)
	{
		_cgmode = 1; // enter cgram mode
		_cgindx = 0;
		_cgchar = (value >> 3) & 0x7; // for now limmit to 8 custom like hd44780
	}
	else if(value & HD44780_FUNCTIONSET)
	{
		// not supported
	}
	else if(value & HD44780_CURDISPSHIFT)
	{
		// not supported
	}
	else if(value & HD44780_DISPLAYCONTROL)
	{
		if(value & HD44780_DISPLAYON)
			devicewrite(CMD_DISPLAYON);
		else
			devicewrite(CMD_DISPLAYOFF);
	}
	else if(value & HD44780_ENTRYMODESET)
	{
		// not supported
	}
	else if(value & HD44780_RETURNHOME)
	{
		_cgmode = 0; // back to ddram mode
		devicewrite(CMD_SETDIGPOINTER);
	}
	else if(value & HD44780_CLEARDISPLAY)
	{
		_cgmode = 0; // back to ddram mode
		device_clear();
	}
	
	return(0);
}
// hd44780cmd() - emulate hd44780 commands best we can
// for now, silently drop unsupported commands
emulate hd44780 commands best we can
for now, silently drop unsupported commands
emulate hd44780 commands best we can for now silently drop unsupported commands
int hd44780cmd(uint8_t value)
{
	if(value & HD44780_SETDDRAMADDR)
	{
		_cgmode = 0; 
		devicewrite(CMD_SETDIGPOINTER | (value & 0xf));
	}
	else if(value & HD44780_SETCGRAMADDR)
	{
		_cgmode = 1; 
		_cgindx = 0;
		_cgchar = (value >> 3) & 0x7; 
	}
	else if(value & HD44780_FUNCTIONSET)
	{
	}
	else if(value & HD44780_CURDISPSHIFT)
	{
	}
	else if(value & HD44780_DISPLAYCONTROL)
	{
		if(value & HD44780_DISPLAYON)
			devicewrite(CMD_DISPLAYON);
		else
			devicewrite(CMD_DISPLAYOFF);
	}
	else if(value & HD44780_ENTRYMODESET)
	{
	}
	else if(value & HD44780_RETURNHOME)
	{
		_cgmode = 0; 
		devicewrite(CMD_SETDIGPOINTER);
	}
	else if(value & HD44780_CLEARDISPLAY)
	{
		_cgmode = 0; 
		device_clear();
	}
	return(0);
}
int hd44780cmd ( uint8_t value ) { if ( value & HD44780_SETDDRAMADDR ) { _cgmode = 0 ; devicewrite ( CMD_SETDIGPOINTER | ( value & 0xf ) ) ; } else if ( value & HD44780_SETCGRAMADDR ) { _cgmode = 1 ; _cgindx = 0 ; _cgchar = ( value >> 3 ) & 0x7 ; } else if ( value & HD44780_FUNCTIONSET ) { } else if ( value & HD44780_CURDISPSHIFT ) { } else if ( value & HD44780_DISPLAYCONTROL ) { if ( value & HD44780_DISPLAYON ) devicewrite ( CMD_DISPLAYON ) ; else devicewrite ( CMD_DISPLAYOFF ) ; } else if ( value & HD44780_ENTRYMODESET ) { } else if ( value & HD44780_RETURNHOME ) { _cgmode = 0 ; devicewrite ( CMD_SETDIGPOINTER ) ; } else if ( value & HD44780_CLEARDISPLAY ) { _cgmode = 0 ; device_clear ( ) ; } return ( 0 ) ; }
hd44780cmd() - emulate hd44780 commands best we can
for now, silently drop unsupported commands
hd44780cmd () - emulate hd44780 commands best we can for now silently drop unsupported commands
// detect the hd44780 command // back to ddram mode // enter cgram mode // for now limmit to 8 custom like hd44780 // not supported // not supported // not supported // back to ddram mode // back to ddram mode