/*
 * Example1.java - TAC, 05/20/2000
 */

/* Copyright (C) 1999, 2000 Dallas Semiconductor Corporation.
 * All rights Reserved. Printed in U.S.A.
 * This software is protected by copyright laws of
 * the United States and of foreign countries.
 * This material may also be protected by patent laws of the United States
 * and of foreign countries.
 * This software is furnished under a license agreement and/or a
 * nondisclosure agreement and may only be used or copied in accordance
 * with the terms of those agreements.
 * The mere transfer of this software does not imply any licenses
 * of trade secrets, proprietary technology, copyrights, patents,
 * trademarks, maskwork rights, or any other form of intellectual
 * property whatsoever. Dallas Semiconductor retains all ownership rights.
 */
/*
 $Workfile: spi400test.java $
 $Revision: 8 $
 $Date: 03/22/03 4:25a $
 $Author: N.Z.Gustavson $
 $Modtime: 7/14/03 10:56a $
*/

import com.dalsemi.system.*;

/**

 */
public class par400test
{

  public static void main(String[] args)
  {
    System.out.println("Starting DS400em parallel port test");

    try
    {
      // attempt to load our native library
      int cpuType = TINIOS.getCPU();   // Get CPU type

      int data = 0x5a;
      //open the spi device with no clock divider, spi cs 3 on CPOL=0 CPHA=1
      PAR400EM port = new PAR400EM();
      port.write(data);

      System.out.println("PAR read method returned: "+port.read());
      System.out.println("PAR shadow method returned: "+port.getshadow());


    }
    catch(Throwable t)
    {
      System.out.println(t);
    }

    System.out.println("Exiting DS400em PAR test");
  }
}
