C# Class CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial

Provides an API for manipulating a CrystalFontz 632/634 serial LCD display. This API currently *only* works with serial (SPI not yet supported) displays that are 16x2 (16 column, 2 row).
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Backspace ( ) : void

Moves the cursor back one space and erases the character in that space.

Begin ( ) : void

Begins communication with the display.

Begin ( DisplayType type ) : void

Begins communication with the display.

CarriageReturn ( ) : void

Moves the cursor to the left-most column of the current row.

ClearDisplay ( ) : void

Clear the contents of the display and return the cursor to its home position (upper left corner, or position 0, 0).

CrLf ( ) : void

Carriage return, line feed. This will move the cursor to the left-most column of the next row (same as calling CarriageReturn followed by LineFeed).

CrystalFontz63xSerial ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class. This is the default constructor.

CrystalFontz63xSerial ( BaudRates baud ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with the BAUD rate to negotiate with display.

CrystalFontz63xSerial ( IRaspiGpio backlightPin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with a GPIO pin to use to control the backlight.

CrystalFontz63xSerial ( IRaspiGpio backlightPin, BaudRates baud ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with the GPIO pin to control the backlight with and the BAUD rate to negotiate with the display.

CursorHome ( ) : void

Returns the cursor to its home position (upper left corner).

DeleteInPlace ( ) : void

Deletes the character at the current cursor position but does not move the cursor.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial. The Dispose method leaves the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial was occupying.

End ( ) : void

Ends communication with the display.

FormFeed ( ) : void

Clears the display. All data is erased.

LineFeed ( ) : void

Moves the cursor down one row. If scrolling is enabled and the cursor is in the bottom row, the display will scroll up one row and the bottom row will be cleared. If scrolling is NOT enabled, and the cursor is in the bottom row, then it will wrap up to the same character position on the top row.

Print ( String text ) : void

Prints text to the display.

RebootDisplay ( ) : void

Reboot the LCD display. This should only be used to return the display to a usable state, perhaps due to invalid contrast or brightness values or if the display is printing garbage. However, this method is not likely to succeed if the display's controller is in an inoperable or indeterminate state. In such cases, it is best to power-cycle the controller instead.

SetBarGraph ( GraphIndices index, GraphStyle style, UInt16 startCol, UInt16 endCol, UInt16 len, UInt16 row ) : void

Displays/updates a horizontal bar graph.

SetCursorPosition ( UInt16 column, UInt16 row ) : void

Sets the cursor position.

ShowInfoScreen ( ) : void

Displays the LCD controller info screen.

Private Methods

Method Description
Dispose ( System.Boolean disposing ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial object.

SendCommand ( Byte cmd ) : void

Sends the specified command to the display controller.

Method Details

Backspace() public method

Moves the cursor back one space and erases the character in that space.
public Backspace ( ) : void
return void

Begin() public method

Begins communication with the display.
/// This instance has been disposed. /// /// Cannot initialize the backlight control pin because it is configured as an input. ///
public Begin ( ) : void
return void

Begin() public method

Begins communication with the display.
/// This instance has been disposed. /// /// Cannot initialize the backlight control pin because it is configured as an input. ///
public Begin ( DisplayType type ) : void
type DisplayType /// The display type ///
return void

CarriageReturn() public method

Moves the cursor to the left-most column of the current row.
public CarriageReturn ( ) : void
return void

ClearDisplay() public method

Clear the contents of the display and return the cursor to its home position (upper left corner, or position 0, 0).
public ClearDisplay ( ) : void
return void

CrLf() public method

Carriage return, line feed. This will move the cursor to the left-most column of the next row (same as calling CarriageReturn followed by LineFeed).
public CrLf ( ) : void
return void

CrystalFontz63xSerial() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class. This is the default constructor.
public CrystalFontz63xSerial ( ) : System
return System

CrystalFontz63xSerial() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with the BAUD rate to negotiate with display.
/// BAUD rate cannot be less than 2400 or greater than 19200. ///
public CrystalFontz63xSerial ( BaudRates baud ) : System
baud BaudRates /// The BAUD rate. ///
return System

CrystalFontz63xSerial() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with a GPIO pin to use to control the backlight.
public CrystalFontz63xSerial ( IRaspiGpio backlightPin ) : System
backlightPin IRaspiGpio /// The GPIO pin to use to control the backlight. ///
return System

CrystalFontz63xSerial() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial class with the GPIO pin to control the backlight with and the BAUD rate to negotiate with the display.
/// BAUD rate cannot be less than 2400 or greater than 19200. ///
public CrystalFontz63xSerial ( IRaspiGpio backlightPin, BaudRates baud ) : System
backlightPin IRaspiGpio /// The GPIO pin to use to control the backlight. ///
baud BaudRates /// The BAUD rate. ///
return System

CursorHome() public method

Returns the cursor to its home position (upper left corner).
public CursorHome ( ) : void
return void

DeleteInPlace() public method

Deletes the character at the current cursor position but does not move the cursor.
public DeleteInPlace ( ) : void
return void

Dispose() public method

Releases all resource used by the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial. The Dispose method leaves the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial was occupying.
public Dispose ( ) : void
return void

End() public method

Ends communication with the display.
public End ( ) : void
return void

FormFeed() public method

Clears the display. All data is erased.
public FormFeed ( ) : void
return void

LineFeed() public method

Moves the cursor down one row. If scrolling is enabled and the cursor is in the bottom row, the display will scroll up one row and the bottom row will be cleared. If scrolling is NOT enabled, and the cursor is in the bottom row, then it will wrap up to the same character position on the top row.
public LineFeed ( ) : void
return void

Print() public method

Prints text to the display.
public Print ( String text ) : void
text String /// The text to print. ///
return void

RebootDisplay() public method

Reboot the LCD display. This should only be used to return the display to a usable state, perhaps due to invalid contrast or brightness values or if the display is printing garbage. However, this method is not likely to succeed if the display's controller is in an inoperable or indeterminate state. In such cases, it is best to power-cycle the controller instead.
public RebootDisplay ( ) : void
return void

SetBarGraph() public method

Displays/updates a horizontal bar graph.
public SetBarGraph ( GraphIndices index, GraphStyle style, UInt16 startCol, UInt16 endCol, UInt16 len, UInt16 row ) : void
index GraphIndices /// The graph index to use. ///
style GraphStyle /// The graph style to use. ///
startCol System.UInt16 /// The starting column for the graph (0 - 15). ///
endCol System.UInt16 /// The ending column for the graph (0 - 15). ///
len System.UInt16 /// The graph bar length (should be a value between startCol and endCol). ///
row System.UInt16 /// The row to place the bar graph in (0 or 1). ///
return void

SetCursorPosition() public method

Sets the cursor position.
public SetCursorPosition ( UInt16 column, UInt16 row ) : void
column System.UInt16 /// The column to put the cursor in (0 - 15). ///
row System.UInt16 /// The row to put the cursor in (0 or 1). ///
return void

ShowInfoScreen() public method

Displays the LCD controller info screen.
public ShowInfoScreen ( ) : void
return void