org.lsst.ccs.drivers.ad
Class Cypress

java.lang.Object
  extended by org.lsst.ccs.drivers.ad.Cypress
Direct Known Subclasses:
I2cBus, SpiBus

public class Cypress
extends Object

Routines to access Cypress EZUSB chip functions on an Analog Devices evaluation board

Author:
Owen Saxton

Constructor Summary
Cypress(org.lsst.ccs.drivers.usb.UsbComm com)
          Constructor
 
Method Summary
 void load(String name, boolean force)
          Loads memory from a file
 int readMemory(int addr, byte[] data, int timeout)
          Reads byte array from memory
 int readMemory(int addr, byte[] data, int offs, int leng, int timeout)
          Reads byte array from memory
 void setReset(boolean on)
          Sets or clears the RESET state
 int writeMemory(int addr, byte[] data)
          Writes byte array to memory
 int writeMemory(int addr, byte[] data, int offs, int leng)
          Writes byte array to memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cypress

public Cypress(org.lsst.ccs.drivers.usb.UsbComm com)
Constructor

Method Detail

setReset

public void setReset(boolean on)
              throws javax.usb.UsbException
Sets or clears the RESET state

Parameters:
on - If true, sets RESET, otherwise clears RESET
Throws:
javax.usb.UsbException

readMemory

public int readMemory(int addr,
                      byte[] data,
                      int timeout)
               throws javax.usb.UsbException
Reads byte array from memory

Parameters:
addr - The first address to read
data - The array of bytes to read into
timeout - The maximum time to wait (ms), or 0 for no timeout
Returns:
The number of bytes read.
Throws:
javax.usb.UsbException

readMemory

public int readMemory(int addr,
                      byte[] data,
                      int offs,
                      int leng,
                      int timeout)
               throws javax.usb.UsbException
Reads byte array from memory

Parameters:
addr - The first address to read
data - The array of bytes to read into
offs - The offset in data to the first byte to read into
leng - The number of bytes to read
timeout - The maximum time to wait (ms), or 0 for no timeout
Returns:
The number of bytes read.
Throws:
javax.usb.UsbException

writeMemory

public int writeMemory(int addr,
                       byte[] data)
                throws javax.usb.UsbException
Writes byte array to memory

Parameters:
addr - The first address to write
data - The array of bytes to write
Returns:
The number of bytes written.
Throws:
javax.usb.UsbException

writeMemory

public int writeMemory(int addr,
                       byte[] data,
                       int offs,
                       int leng)
                throws javax.usb.UsbException
Writes byte array to memory

Parameters:
addr - The first address to write
data - The array of bytes to write
offs - The offset in data to the first byte to write from
leng - The number of bytes to write
Returns:
The number of bytes written.
Throws:
javax.usb.UsbException

load

public void load(String name,
                 boolean force)
          throws javax.usb.UsbException
Loads memory from a file

Parameters:
name - The name of the "hex" file to load
force - If true, force the load even if memory appears to be already loaded correctly.
Throws:
javax.usb.UsbException


Copyright © 2013 LSST. All Rights Reserved.