Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial"/>
        /// class with the BAUD rate to negotiate with display.
        /// </summary>
        /// <param name="baud">
        /// The BAUD rate.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// BAUD rate cannot be less than 2400 or greater than 19200.
        /// </exception>
        public CrystalFontz63xSerial(BaudRates baud)
        {
            if ((Int32)baud < 2400)
            {
                throw new ArgumentOutOfRangeException("baud", "Cannot be less than 2400 baud.");
            }

            if ((Int32)baud > 19200)
            {
                throw new ArgumentOutOfRangeException("baud", "Cannot be greater than 19200 baud.");
            }
            this._baud = baud;
            this._lcd  = new Rs232SerialPort(baud);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Releases all resource used by the
        /// <see cref="CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial"/> object.
        /// </summary>
        /// <param name="disposing">
        /// If set to <c>true</c> disposing.
        /// </param>
        private void Dispose(Boolean disposing)
        {
            if (this._isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (this._lcd != null)
                {
                    this._lcd.Dispose();
                    this._lcd = null;
                }

                if (this._backlightPin != null)
                {
                    this._backlightPin.Dispose();
                    this._backlightPin = null;
                }
            }

            this._isDisposed = true;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial"/>
 /// class. This is the default constructor.
 /// </summary>
 public CrystalFontz63xSerial()
 {
     this._lcd = new Rs232SerialPort(this._baud);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="CyrusBuilt.MonoPi.Devices.CrystalFontzSerialLCD.CrystalFontz63xSerial"/>
 /// class with a GPIO pin to use to control the backlight.
 /// </summary>
 /// <param name="backlightPin">
 /// The GPIO pin to use to control the backlight.
 /// </param>
 public CrystalFontz63xSerial(IRaspiGpio backlightPin)
 {
     this._lcd          = new Rs232SerialPort(this._baud);
     this._backlightPin = backlightPin;
 }