onewirespilcd.java

来自「Is a Application Demo (an example) of ho」· Java 代码 · 共 86 行

JAVA
86
字号
package etaai.lcd.onewire;import etaai.lcd.LCDPort;import etaai.lcd.onewire.spi.*;import com.dalsemi.onewire.adapter.*;import etaai.lcd.*;/** * Title:        Serial LCD * Description:  Comnada display lcd pe seriala * Copyright:    Copyright (c) 2001 * Company:      ETA AI * @author Mircea Pop * @version 1.0 */public class OneWireSPILCD extends OneWireSPI implements LCDPort{  private OneWireSPI spi;  /**   * Clasa OneWireLCD implementeaza comunicarea cu afisajul LCD Cristalfontz   *   * @param DSPortAdapter adapter Adaptorul de 1-wire   * @param String adresa1 Adresa DS2406( PIOA - SPI_DATA, PIOB SPI_CLOCK)   * @param String adresa2 Adresa DS2406( PIOA - SPI_CS, PIOB /SPI_BUSY)   * @throws Exception Eroare LCD   */  public OneWireSPILCD(DSPortAdapter adapter ,String adresa1,String adresa2) throws Exception  {    super(adapter, adresa1, adresa2);  }  /**   * Trimitere la LCD comenzi   * @param String lcdData Datele ce se trimit la lcd   * @throws LCDException Daca nu s-a reusit trimiterea datelor   */  public void sendLCDData(String lcdData) throws LCDException  {    try    {      sendSPIData(lcdData);    }    catch(Exception e) {throw new LCDException("SPILCD : " + e);}  }  /**   * Trimitere la LCD comenzi   * @param int lcdData Datele ce se trimit la lcd   * @throws LCDException Daca nu s-a reusit trimiterea datelor   */  public void sendLCDData(int lcdData) throws LCDException  {    try    {      sendSPIData(lcdData);    }    catch(Exception e) {throw new LCDException("SPILCD : " + e);}  }  /**   * Trimitere la LCD comenzi   * @param byte[] lcdData Datele ce se trimit la lcd   * @throws LCDException Daca nu s-a reusit trimiterea datelor   */  public void sendLCDData(byte[] lcdData) throws LCDException  {    try    {      sendSPIData(lcdData);    }    catch(Exception e) {throw new LCDException("SPILCD : " + e);}  }    /**     * Resetare display     */    public void resetDisplay(){ }    /**Inchidere port SPI*/    public void close(){ }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?