public class Ztex1v1 extends Ztex1
The features supported by this interface can be accessed via vendor commands and vendor requests via Endpoint 0.
Each feature can be enabled or disabled by the firmware and also depends from the hardware.
The presence of a feature is indicated by a 1 in the corresponding feature bit of the ZTEX descriptor 1, see ZtexDevice1
.
The following table gives an overview about the features
Capability bit | Description | |||||||||||||||||||||||||||
0.0 |
EEPROM support
|
|||||||||||||||||||||||||||
0.1 |
FPGA Configuration
|
|||||||||||||||||||||||||||
0.2 |
Flash memory support
|
|||||||||||||||||||||||||||
0.3 |
Debug helper support
|
|||||||||||||||||||||||||||
0.4 |
XMEGA support
|
|||||||||||||||||||||||||||
0.5 |
High speed FPGA configuration support
|
|||||||||||||||||||||||||||
0.6 |
MAC EEPROM support
|
|||||||||||||||||||||||||||
0.7 |
Multi-FPGA support
|
|||||||||||||||||||||||||||
1.0 |
Temperature sensor support
|
|||||||||||||||||||||||||||
1.1 |
Flash 2 support
|
|||||||||||||||||||||||||||
1.2 | Indicates an FX3 firmware | |||||||||||||||||||||||||||
1.3 |
Debug helper support
|
|||||||||||||||||||||||||||
1.4 |
Default firmware interface
|
ZtexDevice1
,
Ztex1
Modifier and Type | Field and Description |
---|---|
static int |
CAPABILITY_DEBUG
Capability index for DEBUG helper support.
|
static int |
CAPABILITY_DEBUG2
Capability index for debug helper 2
|
static int |
CAPABILITY_DEFAULT
Capability index for default firmware interface
|
static int |
CAPABILITY_EEPROM
Capability index for EEPROM support.
|
static int |
CAPABILITY_FLASH
Capability index for FLASH memory support.
|
static int |
CAPABILITY_FLASH2
Capability index for 2nd FLASH memory support.
|
static int |
CAPABILITY_FPGA
Capability index for FPGA configuration support.
|
static int |
CAPABILITY_FX3
Capability index for FX3 firmware
|
static int |
CAPABILITY_HS_FPGA
Capability index for AVR XMEGA support.
|
static int |
CAPABILITY_MAC_EEPROM
Capability index for AVR XMEGA support.
|
static int |
CAPABILITY_MULTI_FPGA
Capability index for multi FPGA support
|
static int |
CAPABILITY_TEMP_SENSOR
Capability index for Temperature sensor support
|
static int |
CAPABILITY_XMEGA
Capability index for AVR XMEGA support.
|
static java.lang.String[] |
capabilityStrings
The names of the capabilities
|
ConfigData |
config
The configuration data structure
is initialized if this kind of data is present in MAC EEPROM or in (firmware) EEPROM.
|
int |
debug2LogIdx
Index of next log entry (messages of type 1 and 2) to be read.
|
int |
debugNewMessages
Is set by
debugReadMessages(boolean,byte[]) and contains the number of new messages. |
boolean |
defaultDisableWarnings
disable update warnings.
|
int |
defaultLatestSubVersion
sub-version number of the latest default interface.
|
int |
defaultLatestVersion
version number of the latest default interface.
|
int |
eepromBytes
Number of bytes written to EEPROM.
|
int |
eepromChecksum
Checksum of the last EEPROM transfer.
|
static int |
eepromConfigSpaceStartAddr
If no MAC-EEPROM is present configuration data is stored at this address in (firmware) EEPROM.
|
boolean |
enableExtraFpgaConfigurationChecks
Enables extra FPGA configuration checks.
|
static int |
FLASH_EC_BUSY
Signals that Flash memory it busy.
|
static int |
FLASH_EC_BUSY_FPGA
Flash may be in use by FPGA.
|
static int |
FLASH_EC_CMD_ERROR
Signals an error while attempting to execute a command.
|
static int |
FLASH_EC_NO_ERROR
Means no error.
|
static int |
FLASH_EC_NOTSUPPORTED
Signals the installed Flash memory is not supported.
|
static int |
FLASH_EC_PENDING
Signals that another Flash operation is pending.
|
static int |
FLASH_EC_READ_ERROR
Signals an error while attempting to read from Flash.
|
static int |
FLASH_EC_RUNTIME
Signals a runtime error of the firmware.
|
static int |
FLASH_EC_TIMEOUT
Signals that a timeout occurred.
|
static int |
FLASH_EC_WRITE_ERROR
Signals an error while attempting to write to Flash.
|
int |
flash2EC
Last 2nd Flash error code obtained by
flashState() . |
int |
flashEC
Last Flash error code obtained by
flashState() . |
int |
tempSensorUpdateInterval
smallest temperature sensor update interval in ms
|
int |
usb3RcvErrors
USB 3.0 receive error count.
|
int |
usb3SndErrors
USB 3.0 send error count.
|
static int |
XMEGA_EC_ADDRESS_ERROR
Signals an address error (invalid address or wrong page size).
|
static int |
XMEGA_EC_INVALID_DEVICE
Signals that the ATxmega controller is not supported.
|
static int |
XMEGA_EC_NO_ERROR
Means no error.
|
static int |
XMEGA_EC_NVM_BUSY
Signals that the NVM is busy.
|
static int |
XMEGA_EC_NVM_TIMEOUT
Signals that an NVM timeout occurred.
|
static int |
XMEGA_EC_PDI_READ_ERROR
Signals a PDI read error.
|
int |
xmegaEC
Last ATxmega error code obtained by
xmegaState() . |
controlMsgTimeout
Constructor and Description |
---|
Ztex1v1(ZtexDevice1 pDev)
Constructs an instance from a given device.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
capabilityInfo(java.lang.String pf)
Creates a String with capability information.
|
void |
checkCapability(int i)
Checks whether ZTEX descriptor 1 is available and interface 1 and a given capability are supported.
|
void |
checkCapability(int i,
int j)
Checks whether ZTEX descriptor 1 is available and interface 1 and a given capability are supported.
|
void |
checkCompatible(int productId0,
int productId1,
int productId2,
int productId3)
Checks whether the given product ID is compatible to the device corresponding to this class and whether interface 1 is supported.
|
void |
checkValid()
Checks whether ZTEX descriptor 1 is available and interface 1 is supported.
|
boolean |
compatible(int productId0,
int productId1,
int productId2,
int productId3)
Checks whether the given product ID is compatible to the device corresponding to this class and whether interface 1 is supported.
|
long |
configureFpga(java.io.InputStream inputStream,
boolean force,
int bs)
Upload a Bitstream to the FPGA using high speed mode (if available) or low speed mode.
|
long |
configureFpga(java.lang.String fwFileName,
boolean force)
Upload a Bitstream to the FPGA using high speed mode (if available) or low speed mode.
|
long |
configureFpga(java.lang.String fwFileName,
boolean force,
int bs)
Upload a Bitstream to the FPGA using high speed mode (if available) or low speed mode.
|
long |
configureFpgaHS(java.io.InputStream inputStream,
boolean force,
int bs)
Upload a Bitstream to the FPGA using high speed mode.
|
long |
configureFpgaHS(java.lang.String fwFileName,
boolean force,
int bs)
Upload a Bitstream to the FPGA using high speed mode.
|
long |
configureFpgaLS(java.io.InputStream inputStream,
boolean force,
int bs)
Upload a Bitstream to the FPGA using low speed mode.
|
long |
configureFpgaLS(java.lang.String fwFileName,
boolean force,
int bs)
Upload a Bitstream to the FPGA using low speed mode.
|
int |
debug2Cnt()
Returns the number of messages in buffer.
|
int |
debug2EC()
Returns an error code if a fatal error occurred (0 if no error occurred)
|
byte[] |
debug2GetMessage(int idx)
Reads a debug message with given Index in raw format.
|
java.lang.String |
debug2GetNextLogMessage()
Reads the next log message in string format.
|
int |
debug2LastIdx()
Returns index of last message + 1
|
void |
debug2PrintNextLogMessages(java.io.PrintStream out)
Prints new log message.
|
int |
debugLastMsg()
Returns the number of the last message read out by
debugReadMessages(boolean,byte[]) |
int |
debugMsgSize()
Returns the size of messages in bytes.
|
int |
debugReadMessages(boolean all,
byte[] buf)
Reads debug messages from message stack.
|
int |
debugStackSize()
Returns the size of message stack in messages.
|
void |
defaultCheckVersion(int version)
Checks version of the default interface.
|
int |
defaultGpioCtl(int mask,
int value)
Reads and modifies the 4 GPIO pins.
|
int |
defaultInEP()
Returns input Endpoint of default interface
used for high speed communication.
|
int |
defaultLsiGet(int addr)
Read data from the low speed interface of default firmwares.
|
void |
defaultLsiGet(int addr,
int[] val,
int length)
Read data from the low speed interface of default firmwares.
|
void |
defaultLsiSet(int[] addr,
int[] val,
int length)
Send data to the low speed interface of default firmwares.
|
void |
defaultLsiSet(int addr,
int val)
Send data to the low speed interface of default firmwares.
|
void |
defaultLsiSet(int addr,
int[] val,
int length)
Send data to the low speed interface of default firmwares.
|
int |
defaultOutEP()
Returns output Endpoint of default interface
used for high speed communication.
|
void |
defaultReset()
Assert the reset signal.
|
void |
defaultReset(boolean leave)
Assert the reset signal.
|
int |
defaultSubVersion()
Returns sub-version of the default interface.
|
int |
defaultVersion()
Returns version of the default interface or 0 if default interface is not present.
|
void |
eepromDisable()
Deprecated.
Replaced by
nvDisableFirmware() |
void |
eepromRead(int addr,
byte[] buf,
int length)
Reads data from the EEPROM.
|
boolean |
eepromState()
Reads the current EEPROM status.
|
long |
eepromUpload(ImgFile imgFile,
boolean force)
Deprecated.
Replaced by
nvUploadFirmware(String,boolean)
Upload the firmware to the non-volatile memory.
In order to start the uploaded firmware the device must be reset. |
long |
eepromUpload(java.lang.String imgFileName,
boolean force)
Deprecated.
Replaced by
nvUploadFirmware(String,boolean)
Upload the firmware to the non-volatile memory.
In order to start the uploaded firmware the device must be reset. |
void |
eepromWrite(int addr,
byte[] buf,
int length)
Writes data to the EEPROM.
|
boolean |
flash2Enabled()
Returns true if 2nd Flash memory is installed.
|
java.lang.String |
flash2Info()
Returns information about 2nd Flash memory.
|
void |
flash2ReadSector(int sector,
byte[] buf)
Reads one sector from the 2nd Flash memory.
|
void |
flash2ReadSector(int sector,
int num,
byte[] buf)
Reads a integer number of sectors from the 2nd Flash memory.
|
int |
flash2Sectors()
Returns the number of sectors of the 2nd Flash memory or 0, if no 2nd Flash is installed.
|
int |
flash2SectorSize()
Returns the sector size of the 2nd Flash memory or 0, if no 2nd Flash is installed.
|
long |
flash2Size()
Returns the size of 2nd Flash memory or 0, if no 2nd Flash memory is installed.
|
boolean |
flash2State()
Reads the the 2nd Flash memory status and information.
|
java.lang.String |
flash2StrError()
Gets the last 2nd Flash error from the device.
|
void |
flash2WriteSector(int sector,
byte[] buf)
Writes one sector to the 2nd Flash memory.
|
void |
flash2WriteSector(int sector,
int num,
byte[] buf)
Writes a integer number of sectors to the 2nd Flash.
|
long |
flashDownloadUserData(byte[] buf,
int offs)
Downloads user data from Flash memory.
|
boolean |
flashEnabled()
Returns true if Flash memory is installed.
|
int |
flashFirstFreeSector()
Returns the first free sector of the Flash memory.
|
java.lang.String |
flashInfo()
Returns information about Flash memory.
|
void |
flashReadSector(int sector,
byte[] buf)
Reads one sector from the Flash.
|
void |
flashReadSector(int sector,
int num,
byte[] buf)
Reads a integer number of sectors from the Flash.
|
void |
flashResetBitstream()
Clears a Bitstream from the Flash.
|
int |
flashSectors()
Returns the number of sectors of the Flash memory or 0, if no Flash memory is installed.
|
int |
flashSectorSize()
Returns the sector size of the Flash memory or 0, if no Flash is installed.
|
long |
flashSize()
Returns the size of Flash memory in bytes or 0, if no Flash memory is installed.
|
boolean |
flashState()
Reads the the Flash memory status and information.
|
java.lang.String |
flashStrError()
Gets the last Flash error from the device.
|
static java.lang.String |
flashStrError(int errNum)
Converts a given error code into a String.
|
long |
flashUploadBitstream(java.io.InputStream inputStream,
int bs)
Uploads a Bitstream to the Flash.
|
long |
flashUploadBitstream(java.lang.String fileName)
Uploads a Bitstream to the Flash.
|
long |
flashUploadBitstream(java.lang.String fileName,
int bs)
Uploads a Bitstream to the Flash.
|
long |
flashUploadUserData(java.io.InputStream inputStream,
int offs)
Uploads user data to Flash memory.
|
long |
flashUploadUserData(java.lang.String fileName,
int offs)
Uploads user data to Flash memory.
|
void |
flashWriteSector(int sector,
byte[] buf)
Writes one sector to the Flash.
|
void |
flashWriteSector(int sector,
int num,
byte[] buf)
Writes a integer number of sectors to the Flash.
|
int |
getFlash2EC()
Gets the last 2nd Flash memory error from the device.
|
int |
getFlashEC()
Gets the last Flash error from the device.
|
boolean |
getFpgaConfiguration()
Returns true if the FPGA is configured.
|
java.lang.String |
getFpgaConfigurationStr()
Returns a string that indicates the FPGA configuration status.
|
void |
getUsb3Errors()
Reads USB 3.0 errors and stores them in
usb3SndErrors usb3RcvErrors . |
protected void |
init()
Initializates the class.
|
boolean |
interfaceCapabilities(int i)
Returns interface capability bit.
|
void |
macEepromRead(int addr,
byte[] buf,
int length)
Reads data from the MAC EEPROM.
|
boolean |
macEepromState()
Reads the current MAC EEPROM status.
|
void |
macEepromWrite(int addr,
byte[] buf,
int length)
Writes data to the MAC EEPROM.
|
void |
macRead(byte[] buf)
Reads MAC address from MAC EEPROM.
|
int |
numberOfFpgas()
Returns the number of FPGA's
|
void |
nvDisableFirmware()
Disables the firmware stored in the non-volatile memory.
|
long |
nvUploadFirmware(ImgFile imgFile,
boolean force)
Upload the firmware to the non-volatile memory.
|
long |
nvUploadFirmware(java.lang.String imgFileName,
boolean force)
Upload the firmware to the non-volatile memory.
|
void |
printFpgaState()
Prints out the FPGA state.
|
boolean |
printMmc2State()
Prints out some debug information about *SD/MMC Flash cards in SPI mode.
|
boolean |
printMmcState()
Prints out some debug information about *SD/MMC Flash cards in SPI mode.
|
void |
printSpiState()
Prints out some debug information about SPI Flash.
|
void |
resetEzUsb()
Resets the EZ-USB and manages the renumeration process.
|
void |
resetFpga()
Resets the FPGA.
|
void |
selectFpga(int num)
Select a FPGA
|
double |
tempSensorRead(int idx)
Read temperature sensor data.
|
java.lang.String |
toHumanStr(long i)
Converts an integer into a base 1024 formatted string.
|
java.lang.String |
toString()
Returns a lot of useful information about the corresponding device.
|
boolean |
valid()
Returns true if ZTEX interface 1 is available.
|
boolean |
valid(int i,
int j)
Returns true if ZTEX interface 1 and capability i.j are available.
|
int |
xmegaEepromPages()
Returns the number of the ATxmega EEPROM pages.
|
int |
xmegaEepromPageSize()
Returns the size of the ATXmega EEPROM pages.
|
void |
xmegaEepromPageWrite(int addr,
byte[] buf)
Writes data to EEPROM memory of ATxmega.
|
void |
xmegaEepromRead(int addr,
byte[] buf,
int length)
Reads data from EEPROM memory of ATxmega.
|
boolean |
xmegaEnabled()
Returns true if ATxmega controller is available.
|
int |
xmegaFlashPages()
Returns the number of the ATxmega Flash pages.
|
int |
xmegaFlashPageSize()
Returns the size of the ATxmega Flash pages.
|
void |
xmegaFlashPageWrite(int addr,
byte[] buf)
Writes data to Flash memory of ATxmega.
|
void |
xmegaFlashRead(int addr,
byte[] buf,
int length)
Reads data from Flash memory of ATxmega.
|
int |
xmegaFuseRead(int addr)
Reads data one Fuse of ATxmega.
|
void |
xmegaFuseRead(int addr,
byte[] buf,
int length)
Reads data from Fuse memory of ATxmega.
|
void |
xmegaFuseWrite(int addr,
int val)
Writes one Fuse of the ATxmega.
|
void |
xmegaNvmRead(int addr,
byte[] buf,
int length)
Reads data from the NVM of ATxmega.
|
void |
xmegaReset()
Resets the ATxmega.
|
int |
xmegaState()
Read ATxmega error and status information from the device.
|
java.lang.String |
xmegaStrError()
Gets the last ATxmega error from the device.
|
java.lang.String |
xmegaStrError(int errNum)
Converts a given error code into a String.
|
long |
xmegaWriteEeprom(ImgFile imgFile)
Uploads data to the EEPROM memory
|
long |
xmegaWriteFirmware(ImgFile imgFile)
Uploads firmware to the flash memory
|
allocateByteBuffer, allocateByteBuffer, bulkRead, bulkRead, bulkWrite, bulkWrite, claimInterface, dev, dispose, finalize, getInterfaceClaimed, handle, name, releaseInterface, resetDevice, setConfiguration, trySetConfiguration, uploadFirmware, uploadFirmware, uploadFirmware, vendorCommand, vendorCommand, vendorCommand, vendorCommand, vendorCommand2, vendorCommand2, vendorCommand3, vendorCommand3, vendorRequest, vendorRequest, vendorRequest, vendorRequest, vendorRequest2, vendorRequest2, vendorRequest2, vendorRequest3, vendorRequest3, vendorRequest3
public static final int CAPABILITY_EEPROM
public static final int CAPABILITY_FPGA
public static final int CAPABILITY_FLASH
public static final int CAPABILITY_DEBUG
public static final int CAPABILITY_XMEGA
public static final int CAPABILITY_HS_FPGA
public static final int CAPABILITY_MAC_EEPROM
public static final int CAPABILITY_MULTI_FPGA
public static final int CAPABILITY_TEMP_SENSOR
public static final int CAPABILITY_FLASH2
public static final int CAPABILITY_FX3
public static final int CAPABILITY_DEBUG2
public static final int CAPABILITY_DEFAULT
public static final java.lang.String[] capabilityStrings
public boolean enableExtraFpgaConfigurationChecks
public int eepromBytes
eepromState()
.)public int eepromChecksum
eepromState()
.)public int flashEC
flashState()
. See FLASH_EC_* for possible error codes.public int flash2EC
flashState()
. See FLASH_EC_* for possible error codes.public static final int FLASH_EC_NO_ERROR
public static final int FLASH_EC_CMD_ERROR
public static final int FLASH_EC_TIMEOUT
public static final int FLASH_EC_BUSY
public static final int FLASH_EC_PENDING
public static final int FLASH_EC_READ_ERROR
public static final int FLASH_EC_WRITE_ERROR
public static final int FLASH_EC_NOTSUPPORTED
public static final int FLASH_EC_RUNTIME
public static final int FLASH_EC_BUSY_FPGA
public int debugNewMessages
debugReadMessages(boolean,byte[])
and contains the number of new messages.public int xmegaEC
xmegaState()
. See XMEGA_EC_* for possible error codes.public static final int XMEGA_EC_NO_ERROR
public static final int XMEGA_EC_PDI_READ_ERROR
public static final int XMEGA_EC_NVM_TIMEOUT
public static final int XMEGA_EC_INVALID_DEVICE
public static final int XMEGA_EC_ADDRESS_ERROR
public static final int XMEGA_EC_NVM_BUSY
public int tempSensorUpdateInterval
public int debug2LogIdx
public int usb3SndErrors
getUsb3Errors()
.public int usb3RcvErrors
getUsb3Errors()
.public boolean defaultDisableWarnings
public final int defaultLatestVersion
public final int defaultLatestSubVersion
public static final int eepromConfigSpaceStartAddr
public ConfigData config
macEepromWrite(int,byte[],int)
and eepromWrite(int,byte[],int)
.
If no valid configuration data is present config
is null.public Ztex1v1(ZtexDevice1 pDev) throws UsbException
pDev
- The given device.UsbException
- if an communication error occurred.protected void init() throws UsbException
init
in class Ztex1
UsbException
- if an communication error occurred.public boolean valid()
public boolean valid(int i, int j)
i
- byte index of the capabilityj
- bit index of the capabilitypublic boolean compatible(int productId0, int productId1, int productId2, int productId3)
if ( this.productId(0)==0 || productId0<=0 || this.productId(0)==productId0 ) && ( this.productId(0)==0 || productId1<=0 || this.productId(1)==productId1 ) && ( this.productId(2)==0 || productId2<=0 || this.productId(2)==productId2 ) && ( this.productId(3)==0 || productId3<=0 || this.productId(3)==productId3 )
productId0
- Byte 0 of the given product IDproductId1
- Byte 1 of the given product IDproductId2
- Byte 2 of the given product IDproductId3
- Byte 3 of the given product IDpublic void checkValid() throws InvalidFirmwareException
checkValid
in class Ztex1
InvalidFirmwareException
- if ZTEX descriptor 1 is not available or interface 1 is not supported.public void checkCapability(int i, int j) throws InvalidFirmwareException, CapabilityException
i
- byte index of the capabilityj
- bit index of the capabilityInvalidFirmwareException
- if ZTEX descriptor 1 is not available or interface 1 is not supported.CapabilityException
- if the given capability is not supported.public void checkCapability(int i) throws InvalidFirmwareException, CapabilityException
i
- capability index (0..47)InvalidFirmwareException
- if ZTEX descriptor 1 is not available or interface 1 is not supported.CapabilityException
- if the given capability is not supported.public boolean interfaceCapabilities(int i)
i
- capability index (0..47)public void checkCompatible(int productId0, int productId1, int productId2, int productId3) throws InvalidFirmwareException
compatible(int,int,int,int)
.productId0
- Byte 0 of the given product IDproductId1
- Byte 1 of the given product IDproductId2
- Byte 2 of the given product IDproductId3
- Byte 3 of the given product IDInvalidFirmwareException
- if the given product ID is not compatible or interface 1 is not supported.public void printFpgaState() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public boolean getFpgaConfiguration() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public java.lang.String getFpgaConfigurationStr() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public void resetFpga() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public long configureFpgaLS(java.io.InputStream inputStream, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
inputStream
- for reading the Bitstream.force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public long configureFpgaLS(java.lang.String fwFileName, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
fwFileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public boolean eepromState() throws UsbException, InvalidFirmwareException, CapabilityException
eepromBytes
and eepromChecksum
.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if EEPROM access is not supported by the firmware.public void eepromWrite(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The destination address of the EEPROM.buf
- The data.length
- The amount of bytes to be sent.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if EEPROM access is not supported by the firmware or if configuration data is overwritten and config
is not null.public void eepromRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address of the EEPROM.buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if EEPROM access is not supported by the firmware.public long nvUploadFirmware(ImgFile imgFile, boolean force) throws IncompatibleFirmwareException, FirmwareUploadException, InvalidFirmwareException, CapabilityException
imgFile
- The firmware image.force
- Skips the compatibility check if true.IncompatibleFirmwareException
- if the given firmware is not compatible to the installed one, see compatible(int,int,int,int)
(Upload can be enforced using the force parameter.)InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to upload the firmware.nvDisableFirmware()
@Deprecated public long eepromUpload(ImgFile imgFile, boolean force) throws IncompatibleFirmwareException, FirmwareUploadException, InvalidFirmwareException, CapabilityException
nvUploadFirmware(String,boolean)
Upload the firmware to the non-volatile memory.
In order to start the uploaded firmware the device must be reset.imgFile
- The firmware image.force
- Skips the compatibility check if true.IncompatibleFirmwareException
- if the given firmware is not compatible to the installed one, see compatible(int,int,int,int)
(Upload can be enforced using the force parameter.)InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to upload the firmware.nvDisableFirmware()
public long nvUploadFirmware(java.lang.String imgFileName, boolean force) throws IncompatibleFirmwareException, FirmwareUploadException, InvalidFirmwareException, CapabilityException
imgFileName
- The file name of the firmware image in ihx or img format. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- Skips the compatibility check if true.IncompatibleFirmwareException
- if the given firmware is not compatible to the installed one, see compatible(int,int,int,int)
(Upload can be enforced using the force parameter.)InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to upload the firmware.nvDisableFirmware()
@Deprecated public long eepromUpload(java.lang.String imgFileName, boolean force) throws IncompatibleFirmwareException, FirmwareUploadException, InvalidFirmwareException, CapabilityException
nvUploadFirmware(String,boolean)
Upload the firmware to the non-volatile memory.
In order to start the uploaded firmware the device must be reset.imgFileName
- The file name of the firmware image in ihx or img format. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- Skips the compatibility check if true.IncompatibleFirmwareException
- if the given firmware is not compatible to the installed one, see compatible(int,int,int,int)
(Upload can be enforced using the force parameter.)InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to upload the firmware.nvDisableFirmware()
@Deprecated public void eepromDisable() throws FirmwareUploadException, InvalidFirmwareException, CapabilityException
nvDisableFirmware()
InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to disable the firmware.public void nvDisableFirmware() throws FirmwareUploadException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if EEPROM access is not supported by the firmware.FirmwareUploadException
- if an error occurred while attempting to disable the firmware.public static java.lang.String flashStrError(int errNum)
errNum
- The error code.public java.lang.String flashStrError()
public java.lang.String flash2StrError()
public boolean flashState() throws UsbException, InvalidFirmwareException, CapabilityException
flashEnabled()
, flashSectorSize()
and flashSectors()
.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public boolean flash2State() throws UsbException, InvalidFirmwareException, CapabilityException
flash2Enabled()
, flash2SectorSize()
and flash2Sectors()
.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public int getFlashEC() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public int getFlash2EC() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public void flashReadSector(int sector, int num, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The number of the first sector to be read.num
- The number of sectors to be read.buf
- A buffer for the storage of the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is to small.public void flashReadSector(int sector, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be read.buf
- A buffer for the storage of the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the Flash sector size.public void flash2ReadSector(int sector, int num, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The number of the first sector to be read.num
- The number of sectors to be read.buf
- A buffer for the storage of the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is to small.public void flash2ReadSector(int sector, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be read.buf
- A buffer for the storage of the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the 2nd Flash sector size.public void flashWriteSector(int sector, int num, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be written.num
- The number of sectors to be read.buf
- The data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is to small.public void flashWriteSector(int sector, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be written.buf
- The data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the Flash sector size.public void flash2WriteSector(int sector, int num, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be written.num
- The number of sectors to be read.buf
- The data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is to small.public void flash2WriteSector(int sector, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
sector
- The sector number to be written.buf
- The data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash access is not possible.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the 2nd Flash sector size.public boolean flashEnabled() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public boolean flash2Enabled() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public int flashSectorSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public int flash2SectorSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash access is not supported by the firmware.public int flashSectors() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public int flash2Sectors() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public long flashSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public long flash2Size() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public boolean printMmcState() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public boolean printMmc2State() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if 2nd Flash memory access is not supported by the firmware.public long flashUploadBitstream(java.io.InputStream inputStream, int bs) throws BitstreamReadException, UsbException, InvalidFirmwareException, CapabilityException
If configuration data is present, information about bitstream (start, size, reserved spaCE) are stored there.
In all other devices the information about the bitstream is stored in sector 0. This so called boot sector has the following format:
Bytes | Description |
0..7 | ID, must be "ZTEXBS",1,1 |
8..9 | The number of sectors used to store the Bitstream. 0 means no Bitstream. |
10..11 | The number of bytes in the last sector. |
12..sectorSize-1 | This data is reserved for future use and preserved by this method. |
The total size of the Bitstream is computed as ((bs[8] | (bs[9]<<8) - 1) * flash_sector_size + ((bs[10] | (bs[11]<<8)) where bs[i] denotes byte i of the boot sector.
The first sector of the Bitstream is sector 1.
inputStream
- for reading the Bitstream.bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.flashResetBitstream()
public long flashUploadBitstream(java.lang.String fileName, int bs) throws BitstreamReadException, UsbException, InvalidFirmwareException, CapabilityException
flashUploadBitstream(InputStream,int)
for further details.fileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.flashResetBitstream()
public long flashUploadBitstream(java.lang.String fileName) throws BitstreamReadException, UsbException, InvalidFirmwareException, CapabilityException
flashUploadBitstream(InputStream,int)
for further details.fileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.flashResetBitstream()
public void flashResetBitstream() throws UsbException, InvalidFirmwareException, CapabilityException
flashUploadBitstream(String)
.
If no boot sector is installed the method returns without any write action.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public int flashFirstFreeSector() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public long flashUploadUserData(java.io.InputStream inputStream, int offs) throws java.lang.IllegalArgumentException, UsbException, InvalidFirmwareException, CapabilityException, java.io.IOException
inputStream
- for reading the user data.offs:
- Start address relative to free space (see flashFirstFreeSector()
) in bytes. This must be a sector boundary. Negative values are suppoorted but not recommended.java.lang.IllegalArgumentException
- if start address is invalid or size is to large.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.io.IOException
- if user data cannot be read.public long flashUploadUserData(java.lang.String fileName, int offs) throws java.lang.IllegalArgumentException, UsbException, InvalidFirmwareException, CapabilityException, java.io.IOException
fileName
- The file name of the user data. The file can be a regular file or a system resource (e.g. a file from the current jar archive).offs:
- Start address relative to free space (see flashFirstFreeSector()
) in bytes. This must be a sector boundary. Negative values are supported but not recommended.java.lang.IllegalArgumentException
- if start address is invalid or size is to large.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.java.io.IOException
- if file cannot be read.public long flashDownloadUserData(byte[] buf, int offs) throws java.lang.IllegalArgumentException, UsbException, InvalidFirmwareException, CapabilityException
buf
- where to store the downloaded user data. Size is determined by the length of the buffer.offs:
- Start address relative to free space (see flashFirstFreeSector()
) in bytes. This must be a sector boundary. Negative values are supported but not recommended.java.lang.IllegalArgumentException
- if start address is invalid or size is to large.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public java.lang.String toHumanStr(long i)
i
- an integer which may be large.public java.lang.String flashInfo()
public java.lang.String flash2Info()
public int debugStackSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public int debugMsgSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public final int debugLastMsg()
debugReadMessages(boolean,byte[])
debugReadMessages(boolean,byte[])
public int debugReadMessages(boolean all, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException
debugNewMessages
.
The number of the latest message is returned by debugLastMsg()
.all
- If true, all messages from stack are written to buf. If it is false, only the new messages are written to buf.buf
- The buffer to store the messages.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not possible.public java.lang.String xmegaStrError(int errNum)
errNum
- The error code.public java.lang.String xmegaStrError()
public int xmegaState() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATxmega controllers are not supported by the firmware.public boolean xmegaEnabled() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATxmega controllers are not supported by the firmware.public int xmegaFlashPages() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATxmega controllers are not supported by the firmware.public int xmegaEepromPages() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATxmega controllers are not supported by the firmware.public int xmegaFlashPageSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATxmega controllers are not supported by the firmware.public int xmegaEepromPageSize() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if ATXmega controllers are not supported by the firmware.public void xmegaReset() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.public void xmegaNvmRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address of the NVM (PDI address space).buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.public void xmegaFlashRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address relative to the Flash memory base.buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If NVRAM access to ATxmega is not supported by the firmware.public void xmegaEepromRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address relative to the EEPROM memory base.buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If NVRAM access to ATxmega is not supported by the firmware.public void xmegaFuseRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address relative to the Fuse memory base.buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If NVRAM access to ATxmega is not supported by the firmware.public int xmegaFuseRead(int addr) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The index of th Fuse.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If NVRAM access to ATxmega is not supported by the firmware.public void xmegaFlashPageWrite(int addr, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The source address relative to the Flash memory base.buf
- A buffer that stores the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the Flash page size.public void xmegaEepromPageWrite(int addr, byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The source address relative to the EEPROM memory base.buf
- A buffer that stores the data.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than the EEPROM page size.public void xmegaFuseWrite(int addr, int val) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The index of th Fuse.val
- The value of th Fuse.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.public long xmegaWriteFirmware(ImgFile imgFile) throws UsbException, InvalidFirmwareException, CapabilityException, FirmwareUploadException
imgFile
- The firmware / data image.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.FirmwareUploadException
- if the verification fails.public long xmegaWriteEeprom(ImgFile imgFile) throws UsbException, InvalidFirmwareException, CapabilityException, FirmwareUploadException
imgFile
- The firmware / data image.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if NVRAM access to ATxmega is not supported by the firmware.FirmwareUploadException
- if the verification fails.public java.lang.String toString()
public java.lang.String capabilityInfo(java.lang.String pf)
pf
- A separator between the single capabilities, e.g. ", "public long configureFpgaHS(java.io.InputStream inputStream, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
inputStream
- for reading the Bitstream.force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public long configureFpgaHS(java.lang.String fwFileName, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
fwFileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public long configureFpga(java.io.InputStream inputStream, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException, java.io.IOException
inputStream
- for reading the Bitstream.force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.java.io.IOException
- if mark/reset is not supportedpublic long configureFpga(java.lang.String fwFileName, boolean force, int bs) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
fwFileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).bs
- 0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order.BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public long configureFpga(java.lang.String fwFileName, boolean force) throws BitstreamReadException, UsbException, BitstreamUploadException, AlreadyConfiguredException, InvalidFirmwareException, CapabilityException
fwFileName
- The file name of the Bitstream. The file can be a regular file or a system resource (e.g. a file from the current jar archive).force
- If set to true existing configurations will be overwritten. (By default an AlreadyConfiguredException
is thrown).BitstreamReadException
- if an error occurred while attempting to read the Bitstream.BitstreamUploadException
- if an error occurred while attempting to upload the Bitstream.AlreadyConfiguredException
- if the FPGA is already configured.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if FPGA configuration is not supported by the firmware.public void macEepromWrite(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The destination address of the MAC EEPROM.buf
- The data.length
- The amount of bytes to be sent.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if MAC EEPROM access is not supported by the firmware or if configuration data is present and there is a write to addresses 0 to 79. In order to override this behavior set config
variable to null.public void macEepromRead(int addr, byte[] buf, int length) throws UsbException, InvalidFirmwareException, CapabilityException
addr
- The source address of the MAC EEPROM.buf
- A buffer for the storage of the data.length
- The amount of bytes to be read.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if MAC EEPROM access is not supported by the firmware.public boolean macEepromState() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if MAC EEPROM access is not supported by the firmware.public void macRead(byte[] buf) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
buf
- A buffer with a minimum size of 6 bytes.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if MAC EEPROM access is not supported by the firmware.java.lang.IndexOutOfBoundsException
- If the buffer is smaller than 6 bytes.public int numberOfFpgas() throws UsbException, InvalidFirmwareException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.public void selectFpga(int num) throws UsbException, InvalidFirmwareException, java.lang.IndexOutOfBoundsException
num
- FPGA to select. Valid values are 0 to numberOfFpgas()
-1InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.java.lang.IndexOutOfBoundsException
- If FPGA number is not in range.public double tempSensorRead(int idx) throws UsbException, InvalidFirmwareException, CapabilityException, java.lang.IndexOutOfBoundsException
idx
- Temperature sensor indexInvalidFirmwareException
- If interface 1 or temperature sensor protocol is not supported.UsbException
- If a communication error occurs.CapabilityException
- If NVRAM access to ATxmega is not supported by the firmware.java.lang.IndexOutOfBoundsException
- If idx is not in range.public void printSpiState() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if a communication error occurs.CapabilityException
- if Flash memory access is not supported by the firmware.public byte[] debug2GetMessage(int idx) throws UsbException, InvalidFirmwareException, CapabilityException
debug2LastIdx()
-debug2Cnt()
to debug2LastIdx()
-1.
Data format is:
Bytes | Description |
0 | Type |
1..length | Message |
idx
- Index of message.InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.CapabilityException
- Debug2 feature is not supported by firmware.UsbException
- if a communication error occurs.public int debug2LastIdx() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.CapabilityException
- Debug2 feature is not supported by firmware.UsbException
- if a communication error occurs.public int debug2EC() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.CapabilityException
- Debug2 feature is not supported by firmware.UsbException
- if a communication error occurs.public int debug2Cnt() throws UsbException, InvalidFirmwareException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.CapabilityException
- Debug2 feature is not supported by firmware.UsbException
- if a communication error occurs.public java.lang.String debug2GetNextLogMessage() throws UsbException, InvalidFirmwareException, CapabilityException
debug2LogIdx
which is incremented by this function.
null is returned if no log message is available.InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.CapabilityException
- Debug2 feature is not supported by firmware.UsbException
- if a communication error occurs.public void debug2PrintNextLogMessages(java.io.PrintStream out) throws UsbException, InvalidFirmwareException
debug2LogIdx
which is incremented by this function.
Returns quietly if debug2 functionality is not supported.out
- destination for printing the messages.InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.UsbException
- if a communication error occurs.public void resetEzUsb() throws FirmwareUploadException, UsbException, InvalidFirmwareException, DeviceLostException
After the reset the renumeration starts. During this process the device disappears from the bus and a new one occurs which will be assigned to this class automatically (instead of the disappeared one).
resetEzUsb
in class Ztex1
FirmwareUploadException
- If an error occurred while attempting to reset the EZ-USBUsbException
- if a communication error occurs.InvalidFirmwareException
- if ZTEX descriptor 1 is not available.DeviceLostException
- if a device went lost after renumeration.public void getUsb3Errors() throws UsbException, InvalidFirmwareException, CapabilityException
usb3SndErrors
usb3RcvErrors
.InvalidFirmwareException
- if interface 1 is not supported or invalid result is returned.UsbException
- if a communication error occurs.CapabilityException
- Debug2 feature is not supported by firmware.public int defaultVersion() throws InvalidFirmwareException, UsbException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if an error occurred while attempting to read default interface information.public void defaultCheckVersion(int version) throws InvalidFirmwareException, UsbException, CapabilityException
version
- The minimum required version. Minimum valid version is 1.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if an error occurred while attempting to read default interface information.public int defaultOutEP() throws InvalidFirmwareException, UsbException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if an error occurred while attempting to read default interface information.public int defaultInEP() throws InvalidFirmwareException, UsbException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if an error occurred while attempting to read default interface information.public int defaultSubVersion() throws InvalidFirmwareException, UsbException, CapabilityException
InvalidFirmwareException
- if interface 1 is not supported.UsbException
- if an error occurred while attempting to read default interface information.CapabilityException
- if default interface if not present or version number is lower than requiredpublic void defaultReset(boolean leave) throws InvalidFirmwareException, UsbException, CapabilityException
leave
- if true, the signal is left active. Otherwise only a short impulse is sent.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.public void defaultReset() throws InvalidFirmwareException, UsbException, CapabilityException
defaultReset(boolean)
InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.public int defaultGpioCtl(int mask, int value) throws InvalidFirmwareException, UsbException, CapabilityException
mask
- Bitmask for the pins which are modified. 1 means a bit is set. Only the lowest 4 bits are significant.value
- The bit values which are to be set. Only the lowest 4 bits are significant.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.public void defaultLsiSet(int addr, int val) throws InvalidFirmwareException, UsbException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The address. Valid values are 0 to 255.val
- The register data with a width of 32 Bit.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.java.lang.IndexOutOfBoundsException
- If the address is out of range.public void defaultLsiSet(int addr, int[] val, int length) throws InvalidFirmwareException, UsbException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The starting address address. Valid values are 0 to 255. Address is wrapped from 255 to 0.val
- The register data array with a word width of 32 Bit.length
- The length of the data array.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.java.lang.IndexOutOfBoundsException
- If the address is out of range or length is > 256public void defaultLsiSet(int[] addr, int[] val, int length) throws InvalidFirmwareException, UsbException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The register addresses. Valid values are 0 to 255.val
- The register data array with a word width of 32 Bit.length
- The length of the data array.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.java.lang.IndexOutOfBoundsException
- If the address is out of range or length is > 256public int defaultLsiGet(int addr) throws InvalidFirmwareException, UsbException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The address. Valid values are 0 to 255.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.java.lang.IndexOutOfBoundsException
- If the address is out of range.public void defaultLsiGet(int addr, int[] val, int length) throws InvalidFirmwareException, UsbException, CapabilityException, java.lang.IndexOutOfBoundsException
addr
- The start address. Valid values are 0 to 255. Address is wrapped from 255 to 0.val
- The array where to store the register data with a word width of 32 Bit.length
- The amount of register to be read.InvalidFirmwareException
- if interface 1 is not supported.CapabilityException
- if default interface if not present or version number is lower than requiredUsbException
- if a communication error occurred.java.lang.IndexOutOfBoundsException
- If the address is out of range or length is > 256