/// <summary>
        /// Define or delete of RAM Macro processing definition.
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="p">RAM Macro data length</param>
        /// <param name="d">RAM Macro data</param>
        public static void RamMacroProcessingDefinition(this Gu256x128c device, ushort p, params byte[] d)
        {
            var pL = (byte)p;
            var pH = (byte)(p >> 8);

            device.WriteBytes(new byte[] { 0x1F, 0x3A, pL, pH }, d);
        }
        /// <summary>
        /// Defines the16 x 16 downloaded character in specified code.
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="c">Character code</param>
        /// <param name="d">Definition data</param>
        public static void DownloadCharacterDefinition16x16(this Gu256x128c device, char c, params byte[] d)
        {
            var c1 = (byte)(c >> 8);
            var c2 = (byte)c;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x10, c1, c2 }, d);
        }
        /// <summary>
        /// Define or delete FROM Macro to the FROM
        /// <para>* Valid at the user setup mode.</para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="a">FROM Macro definition number</param>
        /// <param name="p">FROM Macro data length</param>
        /// <param name="t1">Display time interval</param>
        /// <param name="t2">Idle time of macro repetition</param>
        /// <param name="d">FROM Macro data</param>
        public static void FromMacroProcessingDefinition(this Gu256x128c device, byte a, ushort p, byte t1, byte t2, params byte[] d)
        {
            var pL = (byte)p;
            var pH = (byte)(p >> 8);

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x12, a, pL, pH, t1, t2 }, d);
        }
        /// <summary>
        /// Delete the16 x 16 downloaded character defined in the specified code.
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="c">Delete character code</param>
        public static void DownloadedCharacterDelete16x16(this Gu256x128c device, char c)
        {
            var c1 = (byte)(c >> 8);
            var c2 = (byte)c;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x11, c1, c2 });
        }
        // General-purpose memory store
        // General-purpose memory transfer
        // General-purpose memory send


        /// <summary>
        /// Send each display status information.
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="name">Informarion name</param>
        /// <param name="address">Start address</param>
        /// <param name="length">Data length</param>
        public static void DisplayStatusSend(this Gu256x128c device, InformationName name, byte address, byte length)
        {
            var a = (byte)name;
            var b = address;
            var c = length;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x40, a, b, c });
        }
Beispiel #6
0
        /// <summary>
        /// The cursor moves to specified X, Y position on display memory.
        /// </summary>
        /// <param name="x">Cursor position x</param>
        /// <param name="y">Cursor position y</param>
        /// <param name="device">GU256x128c device</param>
        public static void CursorSet(this Gu256x128c device, ushort x, ushort y)
        {
            var xL = (byte)x;
            var xH = (byte)(x >> 8);
            var yL = (byte)y;
            var yH = (byte)(y >> 8);

            device.WriteBytes(new byte[] { 0x1F, 0x24, xL, xH, yL, yH });
        }
        /// <summary>
        /// Change the RS-232 serial interface communication parameters.
        /// </summary>
        public static void Rs232SerialSettings(this Gu256x128c device, int baudRate = Gu256x128c.DefaultBaudRate, Parity parity = Gu256x128c.DefaultParity)
        {
            var a = BaudRateList[baudRate];
            var b = ParityList[parity];

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x69, 0x10, a, b });

            device.serialPort.Close();
            device.serialPort.BaudRate = baudRate;
            device.serialPort.Parity   = parity;
            device.serialPort.Open();
        }
Beispiel #8
0
        /// <summary>
        /// Define or Cancel User Window
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="a">Definable window number</param>
        /// <param name="b">Define or Cancel</param>
        /// <param name="xP">Left position of window (by 1dot)</param>
        /// <param name="yP">Top position of window (by 8dot) </param>
        /// <param name="xS">X size of window (by 1dot)</param>
        /// <param name="yS">Y size of window (by 8dot) </param>
        public static void UserWindowDefinitionCancel(this Gu256x128c device, byte a, byte b, ushort xP, ushort yP, ushort xS, ushort yS)
        {
            var xPL = (byte)xP;
            var xPH = (byte)(xP >> 8);
            var yPL = (byte)yP;
            var yPH = (byte)(yP >> 8);
            var xSL = (byte)xS;
            var xSH = (byte)(xS >> 8);
            var ySL = (byte)yS;
            var ySH = (byte)(yS >> 8);

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x77, 0x02, a, b, xPL, xPH, yPL, yPH, xSL, xSH, ySL, ySH });
        }
Beispiel #9
0
        /// <summary>
        /// Brightness level setting
        /// <para>Default = <see cref="BrightnessLevel.Level4Of4"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void BrightnessLevelSetting(this Gu256x128c device, BrightnessLevel level)
        {
            var n = (byte)level;

            device.WriteBytes(new byte[] { 0x1F, 0x58, n });
        }
Beispiel #10
0
        /// <summary>
        /// Specify or cancel 2byte character mode.
        /// <para>Default = <see cref="false"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void SpecifyCancel2ByteCharacterMode(this Gu256x128c device, bool specify)
        {
            var m = (byte)(specify ? 1 : 0);

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x02, m });
        }
 /// <summary>
 /// Shift to “Memory re-write mode” from “Normal mode”.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void MemoryRewriteMode(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1C, 0x7C, 0x4D, 0xD0, 0x4D, 0x4F, 0x44, 0x45, 0x49, 0x4E });
 }
 /// <summary>
 /// Send the contents of memory SW data “a”.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 /// <param name="a">Memory SW number</param>
 public static void MemorySwDataSend(this Gu256x128c device, byte a)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x04, a });
 }
Beispiel #13
0
        /// <summary>
        /// Select the write screen mode for base window.
        /// <para>Default = <see cref="ScreenMode.DisplayScreenMode"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void WriteScreenModeSelect(this Gu256x128c device, ScreenMode mode)
        {
            var a = (byte)mode;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x77, 0x10, a });
        }
Beispiel #14
0
 /// <summary>
 /// Magnify the character by x times on the right, y times downward.
 /// <para>Default x = <see cref="0x01"/></para>
 /// <para>Default y = <see cref="0x01"/></para>
 /// </summary>
 /// <param name="x">Specify the size of magnification X</param>
 /// <param name="y">Specify the size of magnification Y</param>
 /// <param name="device">GU256x128c device</param>
 public static void FontMagnifiedDisplay(this Gu256x128c device, byte x, byte y)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x40, x, y });
 }
 /// <summary>
 /// Set the contents of data“b” to memory SW “a”.
 /// <para>* Valid at the user setup mode.</para>
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 /// <param name="a">Memory SW number</param>
 /// <param name="b">Setting data</param>
 public static void MemorySwSetting(this Gu256x128c device, byte a, byte b)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x03, a, b });
 }
 /// <summary>
 /// End User set up mode end.
 /// <para>* Valid at the user setup mode.</para>
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void IoPortInputOutputSetting(this Gu256x128c device, byte n, PortMode mode)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x02, 0x4F, 0x55, 0x54 });
 }
Beispiel #17
0
 /// <summary>
 /// Set to horizontal scroll speed.
 /// <para>Default = <see cref="0x00"/></para>
 /// <para><see cref="0x00"/> = By Character</para>
 /// <para><see cref="0x01"/> = T millisecond / dots</para>
 /// <para><see cref="02H - 1FH"/> = (n - 1) x T millisecond / dot</para>
 /// <para>Scroll base speed “T” is depending on write screen mode, character size selected. </para>
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void HorizontalScrollSpeed(this Gu256x128c device, byte n)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x73, n });
 }
Beispiel #18
0
 /// <summary>
 /// Set to Over-write mode.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void OverwriteMode(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x01 });
 }
Beispiel #19
0
        /// <summary>
        /// Display cursor ON/OFF select
        /// <para>Default = <see cref="false"/></para>
        /// </summary>
        /// <param name="display">Cursor ON</param>
        /// <param name="device">GU256x128c device</param>
        public static void CursorDisplayOnOffSelect(this Gu256x128c device, bool display)
        {
            var n = (byte)(display ? 1 : 0);

            device.WriteBytes(new byte[] { 0x1F, 0x43, n });
        }
Beispiel #20
0
        /// <summary>
        /// The fonts located on 80h-FFh of font table are chosen/Replaced from 10 types font set.
        /// <para>Default = <see cref="CodeType.PC437"/></para>
        /// </summary>
        /// <param name="type"></param>
        /// <param name="device">GU256x128c device</param>
        public static void SpecifiesCharacterCodeType(this Gu256x128c device, CodeType type)
        {
            var n = (byte)type;

            device.WriteBytes(new byte[] { 0x1B, 0x74, n });
        }
Beispiel #21
0
        /// <summary>
        /// Some characters located on 20h-7Fh are chosen/replaced from 14 types font set.
        /// <para>Default = <see cref="FontSet.America"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void SpecifiesInternationalFontSet(this Gu256x128c device, FontSet set)
        {
            var n = (byte)set;

            device.WriteBytes(new byte[] { 0x1B, 0x52, n });
        }
Beispiel #22
0
        /// <summary>
        /// Specify or cancel boldface character.
        /// <para>Default = <see cref="false"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void CharacterBoldDisplay(this Gu256x128c device, bool specify)
        {
            var b = (byte)(specify ? 1 : 0);

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x41, b });
        }
Beispiel #23
0
 /// <summary>
 /// Clear the all display screen, and initialize all setting.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void InitializeDisplay(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1B, 0x40 });
 }
Beispiel #24
0
        /// <summary>
        /// Select font size of a character.
        /// <para>Default = <see cref="FontSize.Font6x8"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void FontSizeSelect(this Gu256x128c device, FontSize size)
        {
            var m = (byte)size;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x01, m });
        }
 /// <summary>
 /// Start User set up mode start.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void UserSetupModeStart(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x28, 0x65, 0x01, 0x49, 0x4E });
 }
Beispiel #26
0
        /// <summary>
        /// Select 2 byte character type
        /// <para>Default = <see cref="CharacterType.Japanese"/></para>
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        public static void Select2ByteCharacterType(this Gu256x128c device, CharacterType type)
        {
            var m = (byte)type;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x67, 0x03, m });
        }
Beispiel #27
0
 /// <summary>
 /// Set to Vertical scroll mode.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void VerticalScrollMode(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x02 });
 }
Beispiel #28
0
        /// <summary>
        /// Select current window
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="define">Window define</param>
        public static void CurrentWndowSelect(this Gu256x128c device, WindowDefine define)
        {
            var a = (byte)define;

            device.WriteBytes(new byte[] { 0x1F, 0x28, 0x77, 0x01, a });
        }
        /// <summary>
        /// Execute Macro continuously.
        /// </summary>
        /// <param name="device">GU256x128c device</param>
        /// <param name="definition">Macro processing definition number</param>
        /// <param name="t1">Display time interval</param>
        /// <param name="t2">Idle time of macro repetition</param>
        public static void MacroExecution(this Gu256x128c device, MacroProcessingDefinition definition, byte t1, byte t2)
        {
            var a = (byte)definition;

            device.WriteBytes(new byte[] { 0x1F, 0x5E, a, t1, t2 });
        }
Beispiel #30
0
 /// <summary>
 /// Set to horizontal scroll mode.
 /// </summary>
 /// <param name="device">GU256x128c device</param>
 public static void HorizontalScrollMode(this Gu256x128c device)
 {
     device.WriteBytes(new byte[] { 0x1F, 0x03 });
 }