Exemple #1
0
        /// <summary>
        /// Sets entire display (D) on/off, cursor on/off (C),
        /// and blinking of cursor position character (B).
        /// </summary>
        /// <param name="cursorBlinking">Blinking of cursor</param>
        /// <param name="cursorChar">Cursor position char</param>
        /// <param name="displayStatus">Display Status On/Off</param>
        private void DisplayControl(CursorBlinking cursorBlinking, CursorChar cursorChar, DisplayStatus displayStatus)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   0   1   D   C   B

            byte displayCtrlCmd = DISPLAY_CONTROL;

            // blinking of cursor
            if (cursorBlinking == CursorBlinking.Yes)
            {
                displayCtrlCmd |= BLINK_CURSOR_ENABLE;
            }
            this.blinkCursor = (cursorBlinking == CursorBlinking.Yes);

            // display cursor position char
            if (cursorChar == CursorChar.Display)
            {
                displayCtrlCmd |= CURSOR_CHAR_ENABLE;
            }
            this.showCursor = (cursorChar == CursorChar.Display);

            // display status on/off
            if (displayStatus == DisplayStatus.On)
            {
                displayCtrlCmd |= DISPLAY_STATUS_ON;
            }
            this.displayOn = (displayStatus == DisplayStatus.On);

            this.SendCommand(displayCtrlCmd); // 37 us (datasheet)
        }
Exemple #2
0
        /// <summary>
        /// Sets entire display (D) on/off, cursor on/off (C), 
        /// and blinking of cursor position character (B).
        /// </summary>
        /// <param name="cursorBlinking">Blinking of cursor</param>
        /// <param name="cursorChar">Cursor position char</param>
        /// <param name="displayStatus">Display Status On/Off</param>
        private void DisplayControl(CursorBlinking cursorBlinking, CursorChar cursorChar, DisplayStatus displayStatus)
        {
            //  DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
            //  0   0   0   0   1   D   C   B

            byte displayCtrlCmd = DISPLAY_CONTROL;

            // blinking of cursor
            if (cursorBlinking == CursorBlinking.Yes)
                displayCtrlCmd |= BLINK_CURSOR_ENABLE;
            this.blinkCursor = (cursorBlinking == CursorBlinking.Yes);

            // display cursor position char
            if (cursorChar == CursorChar.Display)
                displayCtrlCmd |= CURSOR_CHAR_ENABLE;
            this.showCursor = (cursorChar == CursorChar.Display);

            // display status on/off
            if (displayStatus == DisplayStatus.On)
                displayCtrlCmd |= DISPLAY_STATUS_ON;
            this.displayOn = (displayStatus == DisplayStatus.On);

            this.SendCommand(displayCtrlCmd); // 37 us (datasheet)
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModeInfo"/> class.
 /// </summary>
 /// <param name="cursorShape">Cursor shape info.</param>
 /// <param name="cellPercentage">Cursor size info.</param>
 /// <param name="cursorBlinking">Cursor blinking info.</param>
 public ModeInfo(CursorShape cursorShape, int cellPercentage, CursorBlinking cursorBlinking)
 {
     this.CursorShape    = cursorShape;
     this.CellPercentage = cellPercentage;
     this.CursorBlinking = cursorBlinking;
 }