FX3Connection Class |
Namespace: FX3Api
The FX3Connection type exposes the following members.
Name | Description | |
---|---|---|
![]() | FX3Connection |
Class Constructor. Loads SPI settings and default values for the interface, and starts a background thread to manage programming newly
connected boards with the ADI bootloader.
|
Name | Description | |
---|---|---|
![]() | ActiveFX3 |
Property which returns the active FX3 board. Returns nothing if there is not a board connected.
|
![]() | ActiveFX3SerialNumber |
Property which returns the serial number of the active FX3 board.
|
![]() | AvailableFX3s |
Property which returns a list of the serial numbers of all FX3 boards running the ADI bootloader
|
![]() | BitBangSpiConfig |
Property to get or set the bit bang SPI configuration. Can select pins, timings, etc
|
![]() | BootloaderPath |
Set/get the blink USB bootloader firmware .img file used for multi-board identification
|
![]() | BufferAvailable |
Checks if a streaming frame is available, or will be available soon in thread safe queue. If there is no data in the queue
and the streaming thread is not currently running, it will return false.
|
![]() | BurstByteCount |
Get or set the burst word length, in bytes. Is the total count of bytes transfered, including trigger
|
![]() | BurstMode |
Switches burstMode on and off. Set burstMode to the number of burst read registers.
|
![]() | BurstMOSIData |
Data to transmit on the MOSI line during a burst read operation. This value is over written
if you set the trigger reg, since trigger reg is given priority.
|
![]() | BusyFX3s |
Property which returns a list of the serial numbers of all FX3 boards currently in use, running the application firmware.
|
![]() | ChipSelectControl |
Property to get or set the FX3 SPI controller chip select setting. Should be left on hardware control, changing modes will likely cause unexpected behavior.
Reqcode: B2
Value: Desired setting (as SpiChipselectControl )
Index: 4
Length: 4
Data: None
|
![]() | ChipSelectLagTime |
The number of SPI clock cycles after the transaction ends that chip select is toggled to idle.
Reqcode: B2
Value: Desired Setting (as SpiLagLeadTime )
Index: 6
Length: 4
Data: None
|
![]() | ChipSelectLeadTime |
The number of SPI clock cycles before the SPI transaction that chip select is toggled to active.
Reqcode: B2
Value: Desired Setting (as SpiLagLeadTime )
Index: 5
Length: 4
Data: None
|
![]() | ChipSelectPolarity |
Property to get or set the FX3 SPI chip select polarity (True - Active High, False - Active Low)
Reqcode: B2
Value: Polarity (0 active low, 1 active high)
Index: 3
Length: 4
Data: None
|
![]() | Cpha |
Property to get or set the FX3 SPI controller chip select phase
Reqcode: B2
Value: Polarity (0 active low, 1 active high)
Index: 2
Length: 4
Data: None
|
![]() | Cpol |
Property to get or set the FX3 SPI controller clock polarity setting (True - Idles High, False - Idles Low)
Reqcode: B2
Value: Polarity (0 active low, 1 active high)
'Index: 1
Length: 4
Data: None
|
![]() | CrcFirstIndex |
Gets or sets the index of the first burst data word used in CRC calculations.
|
![]() | CrcLastIndex |
Gets or sets the index of the last burst data word used in CRC calculations.
|
![]() | CrcResultIndex |
Gets or sets the index of the word that contains the CRC result.
|
![]() | DIO1 |
Read-only property to get the DIO1 pin
|
![]() | DIO2 |
Read-only property to get the DIO2 pin
|
![]() | DIO3 |
Read-only property to get the DIO3 pin
|
![]() | DIO4 |
Read-only property to get the DIO4 pin
|
![]() | DrActive |
If the data ready is used for register reads
|
![]() | DrPin |
This property is used to get or set the data ready pin. Is tied to the ReadyPin property
|
![]() | DrPolarity |
The Data Ready polarity for streaming mode (index 11)
|
![]() | DutSupplyMode |
Get or set the DUT supply mode on the FX3. Available options are regulated 3.3V, USB 5V, and off. This feature is only available on the
ADI in-house iSensor FX3 eval platform, not the platform based on the Cypress Explorer kit. If a Cypress Explorer kit is connected, the
setter for this property will be disabled.
|
![]() | FirmwarePath |
The path to the firmware .img file. Needs to be set before the FX3 can be programmed
|
![]() | FlashProgrammerPath |
Path to the programmer firmware which is loaded in RAM to allow flashing the EEPROM with the bootloader.
|
![]() | FX3_GPIO1 |
Read-only property to get the FX3_GPIO1 pin. This pin does not map to the standard iSensor breakout,
and should be used for other general purpose interfacing.
|
![]() | FX3_GPIO2 |
Read-only property to get the FX3_GPIO2 pin. This pin does not map to the standard iSensor breakout,
and should be used for other general purpose interfacing.
|
![]() | FX3_GPIO3 |
Read-only property to get the FX3_GPIO3 pin. This pin does not map to the standard iSensor breakout,
and should be used for other general purpose interfacing.
|
![]() | FX3_GPIO4 |
Read-only property to get the FX3_GPIO4 pin. This pin does not map to the standard iSensor breakout,
and should be used for other general purpose interfacing. This pin shares a complex GPIO block with DIO1. If DIO1 is being used
as a clock source, via the StartPWM function, then this pin cannot be used as a clock source.
|
![]() | FX3_LOOPBACK1 |
Read-only property to get loop back pin 1. This pin (CTL8) is wired directly to
loop back pin 2 (CTL9) on the iSensor FX3 Board, Revision C or newer. These loop
back pins allow for fixed transaction timing on "asynchronous" SPI/I2C reads. One
of the loop back pins can be configured as a PWM output using the "StartPWM" API,
and the other loop back pin can be set as the DrPin, allowing the FX3 to trigger
itself at a known rate.
|
![]() | FX3_LOOPBACK2 |
Read-only property to get loop back pin 2. This pin (CTL9) is wired directly to
loop back pin 1 (CTL8) on the iSensor FX3 Board, Revision C or newer. These loop
back pins allow for fixed transaction timing on "asynchronous" SPI/I2C reads. One
of the loop back pins can be configured as a PWM output using the "StartPWM" API,
and the other loop back pin can be set as the DrPin, allowing the FX3 to trigger
itself at a known rate.
|
![]() | FX3BoardAttached |
Checks if there is a Cypress FX3 USB device connected to the system
|
![]() | GetBootStatus |
Checks the boot status of the FX3 board by sending a vendor request
|
![]() | GetFirmwareVersion |
Property which reads the firmware version from the FX3
|
![]() | GetFX3ApiInfo |
This property returns a class containing some useful information about the current FX3 Dll. Some of the
information is available as a attribute of the DLL, while others (build date/time and git revision) are
generated at compile time using a pre-build batch file script.
|
![]() | GetNumBuffersRead |
Read-only property to get the number of buffers read in from the DUT in buffered streaming mode
|
![]() | GetTargetSerialNumber |
Read-only property to get the serial number of the active FX3 board
|
![]() | I2CBitRate |
Get/Set the FX3 I2C bit rate. Valid range 100KHz - 1MHz. Defaults to 100KHz
|
![]() | I2CRetryCount |
Get/Set the FX3 I2C retry count. This is the number of times the FX3
will retry a read/write when a NAK is received from the slave device
being addressed.
|
![]() | IsLSBFirst |
The FX3 SPI Controller LSB setting. The controller flips the bits depending on this setting.
Reqcode: B2
Value: Polarity (0 MSB first, 1 LSB first)
Index: 7
Length: 4
Data: None
|
![]() | NumFramesPurged |
Read-only property to get the number of bad frames purged with a call to PurgeBadFrameData. Frames are purged when the CRC appended to the end of
the frame does not match the expected CRC.
|
![]() | NumFramesSkipped |
Property to get the number of frame skips in an ADcmXL real time stream
|
![]() | PartType |
The DUT type connected to the board.
Reqcode: B2
Value: Part type to set
Index: 10
Length: 4
Data: None
|
![]() | PinExit |
Gets and sets the sync pin exit configuration for exiting real-time stream mode on ADcmXL DUT's.
|
![]() | PinStart |
Gets and sets the sync pin start configuration for starting real-time stream mode on ADcmXL DUT's.
|
![]() | ReadyPin |
Property to get or set the DUT data ready pin.
|
![]() | ResetPin |
Read-only property to get the reset pin
|
![]() | SclkFrequency |
Property to get or set the FX3 SPI clock frequency setting.
Reqcode: B2
Value: Don't Care
Index: 0
Length: 4
Data: Clock Frequency to be set
|
![]() | SensorType |
Property to get the device family type the FX3 was initialized for. Setting this property restores all SPI settings to the
default for the selected device family.
|
![]() | StallTime |
Property to get/set the number of microseconds between words
Reqcode: B2
Value: Stall time in microseconds (as int16)
Index: 9
Length: 4
Data: None
|
![]() | StreamTimeoutSeconds |
Sets the timeout for the Bulk Endpoint used in real time streaming modes.
|
![]() | StripBurstTriggerWord |
Property to choose if the readback from the 16 bit trigger word at the start of each burst is discarded or not
|
![]() | TimerTickScaleFactor |
Read only property to get the timer tick scale factor used for converting ticks to ms.
|
![]() | TriggerReg |
Gets or sets register that is used to trigger burst operation.
|
![]() | WatchdogEnable |
Enable or disable the FX3 firmware watchdog.
|
![]() | WatchdogTimeoutSeconds |
Set the FX3 firmware watchdog timeout period (in seconds). If the watchdog is triggered the FX3 will reset.
|
![]() | WordCount |
Gets or sets the number of 16 bit words that are read during the burst. Does not include trigger, real transfer will be 2 bytes larger.
|
![]() | WordLength |
The FX3 SPI controller word length. Default is 8 (1 byte per word)
Reqcode: B2
Value: Word length (as int8)
Index: 8
Length: 4
Data: None
|
Name | Description | |
---|---|---|
![]() | BitBangReadReg16 |
Read a standard iSensors 16-bit register using a bitbang SPI connection
|
![]() | BitBangSpi |
Perform a bit banged SPI transfer, using the config set in BitBangSpiConfig.
|
![]() | BitBangWriteRegByte |
Write a byte to an iSensor register using a bitbang SPI connection
|
![]() | BootloaderBlinkLED |
BOOTLOADER FW: Blink the on-board LED
|
![]() | BootloaderTurnOffLED |
BOOTLOADER FW: Turn off the LED
|
![]() | BootloaderTurnOnLED |
BOOTLOADER FW: Turn on the LED
|
![]() | CancelStreamAsync |
Cancel a any running stream
|
![]() | ClearBurstMode |
Takes interface out of burst mode by setting BurstMode to zero.
|
![]() | ClearErrorLog |
Clear the error log stored in flash
|
![]() | Connect |
Attempts to program the selected FX3 board with the application firmware. The FX3 board should be programmed
with the ADI bootloader.
|
![]() | Disconnect |
This function sends a reset command to the specified FX3 board, or does nothing if no board is connected
|
![]() | Disconnect(String) |
Overload of Disconnect which lets you specify the FX3 serial number to disconnect. Returns a boolean
indicating if the board was disconnected.
|
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | FX3CodeRunningOnTarget |
Function which checks if the FX3 is connected and programmed
|
![]() | GetBuffer |
Gets one frame from the thread safe queue. Waits to return until a frame is available if there is a stream running. If
there is not a stream running, and there is no data in the queue this call returns "Nothing".
|
![]() | GetBufferedStreamDataPacket |
This function returns a single buffered stream packet. Needed for IBufferedStreamProducer
|
![]() | GetErrorLog |
Gets the current error log from FX3 flash memory
|
![]() | GetErrorLogCount |
Get the number of errors logged to the FX3 flash memory
|
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetI2CBuffer |
Get I2C buffer from I2C read stream
|
![]() | GetPinPWMInfo |
Allows the user to retrieve a set of information about the current pin PWM configuration.
|
![]() | GetStreamDataPacketU16 |
This function does the same thing as GetBufferedStreamDataPacket()
|
![]() | GetTimerValue |
This function reads the current value from the 10MHz timer running on the FX3
|
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | I2CReadBytes |
Read bytes from an I2C slave device attached to the FX3.
|
![]() | I2CWriteBytes |
Write bytes to an I2C slave device attached to the FX3
|
![]() | ISpi32StopStream |
ISpi32 StopStream implementation. Calls generic version.
|
![]() | isPWMPin |
This function checks to see if the selected pin has already been configured to act as a PWM output pin.
|
![]() | MeasureBusyPulse(Byte, IPinObject, UInt32, UInt32) |
Overload of measure busy pulse which triggers the DUT event using a SPI write instead of a pin drive.
|
![]() | MeasureBusyPulse(IPinObject, UInt32, UInt32, IPinObject, UInt32, UInt32) |
This function triggers a DUT action using a pulse drive, and then measures the following pulse width on a separate busy line.
The pulse time on the busy pin is measured using a 10MHz timer with approx. 0.1us accuracy.
|
![]() | MeasurePinDelay |
This function measures the time delay between toggling a trigger pin, and a state change on the busy pin. This can be used to measure
the propagation delay between a sync edge and data ready being de-asserted.
|
![]() | MeasurePinFreq |
Measures the frequency of an input signal to the selected pin.
|
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | PulseDrive |
This function drives a pin to the specified level for a given time interval in ms
|
![]() | PulseWait |
This function waits for a pin to reach a specified level
|
![]() | PurgeBadFrameData |
This function checks the CRC of each real time streaming frame stored in the Stream Data Queue,
and purges the bad ones. This operation is only valid for an ADcmXL series DUT.
|
![]() | ReadDRFreq |
Reads the measured DR value
|
![]() | ReadFlash |
Read data from the FX3 non-volatile memory
|
![]() | ReadPin |
Reads the value of a GPIO pin on the FX3
|
![]() | ReadPins(IPinObject) |
Reads a list of FX3 GPIO pins. This function calls the overload which takes an IEnumerable
|
![]() | ReadPins(IEnumerableIPinObject) |
Reads a list of FX3 GPIO pins
|
![]() | ReadRegArray(IEnumerableUInt32) |
Reads an array of 16 bit register values.
|
![]() | ReadRegArray(IEnumerableAddrDataPair, UInt32) |
ReadRegArray overload which includes register writes. Breaks the call into multiple calls of readRegByte and writeRegByte
|
![]() | ReadRegArray(IEnumerableUInt32, UInt32) |
Overload of ReadRegArray which builds a new IEnumerable of addr and call the overload which takes an enumerable of addr
|
![]() | ReadRegArrayStream(IEnumerableAddrDataPair, UInt32, UInt32) |
This is the most generic array register function. All other array read/write functions call down to this one.
|
![]() | ReadRegArrayStream(IEnumerableUInt32, UInt32, UInt32) | |
![]() | ReadRegByte |
This is the most general ReadRegByte. Other implementations are based on this.
|
![]() | ReadRegWord |
Reads a single 16 bit register on the DUT
|
![]() | ReadTime |
Not implemented
|
![]() | Reset |
Drives the Reset pin low for 10ms, sleeps for 100ms, and then blocks until the ReadyPin is high (500ms timeout)
|
![]() | ResetAllFX3s |
Looks for and resets boards in application mode. Should only be called at program start, after InitBoardList()
Note: Should not be used if running multiple instances of the GUI.
|
![]() | RestoreHardwareSpi |
Resets the hardware SPI pins to their default operating mode. Can be used to recover the SPI functionality after a bit-bang SPI transaction over the hardware SPI pins
without having to reboot the FX3.
|
![]() | SetBitBangSpiFreq(Double) |
Sets the SCLK frequency for a bit bang SPI connection.
|
![]() | SetBitBangSpiFreq(UInt32) |
Set the SCLK frequency for a bit banged SPI connection. Overloaded to allow for a UInt
|
![]() | SetBitBangStallTime |
Set the bit bang SPI stall time. Driven by a clock with resolution of 49.3ns
|
![]() | SetPin |
Sets the value of a FX3 GPIO pin. This value will persist until the pin is set to a different value, or read from
|
![]() | SetPinResistorSetting |
Set the FX3 GPIO input stage pull up or pull down resistor setting. All FX3 GPIOs have a software configurable
pull up / pull down resistor (10KOhm).
|
![]() | SetupBurstMode |
Puts interface into burst mode by setting burstMode to match word count.
|
![]() | Start |
This function is not currently implemented. Calling it will throw a NotImplementedException.
|
![]() | StartBufferedStream(IEnumerableAddrDataPair, UInt32, UInt32, Int32, BackgroundWorker) |
Starts a buffered stream operation. This is usually called from the TextFileStreamManager. DUTType must be set before executing.
|
![]() | StartBufferedStream(IEnumerableUInt32, UInt32, UInt32, Int32, BackgroundWorker) |
Starts a buffered stream operation. The registers listed in addr are read numCaptures times per register buffer. This process is repeated numBuffers times.
|
![]() | StartBurstStream |
Function to start a burst read using the BurstStreamManager
|
![]() | StartGenericStream |
Starts a generic data stream. This allows you to read/write a set of registers on the DUT, triggering off the data ready if needed.
The data read is placed in the thread-safe queue and can be retrieved with a call to GetBuffer. Each "buffer" is the result of
reading the addr list of registers numCaptures times. For example, if addr is set to [0, 2, 4] and numCaptures is set to 10, each
buffer will contain the 30 register values. The total number of register reads performed is numCaptures * numBuffers
|
![]() | StartI2CStream |
Start an asynchronous I2C read stream. This stream runs on the stream thread
and places all data in a thread safe queue. The data can be retrieved using
GetI2CBuffer()
|
![]() | StartPWM |
This function configures the selected pin to drive a pulse width modulated output.
|
![]() | StartRealTimeStreaming |
This function starts real time streaming on the ADcmXLx021 (interface and FX3). Specifying pin exit is optional and must be 0 (disabled) or 1 (enabled)
|
![]() | StartStream |
Starts a buffered stream for only a single buffer.
This is equivalent to StartBufferedStream(addr, numCaptures, 1, CurrentTimeout, Nothing)
|
![]() | StopPWM |
This function call disables the PWM output from the FX3 and returns the pin to a tri-stated mode.
|
![]() | StopRealTimeStreaming |
This function stops real time streaming on the ADcmXLx021 (stream thread in FX3 API and FX3 firmware)
|
![]() | StopStream |
Stops the currently running data stream, if any.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Transfer |
This function performs a single bi-directional 32 bit SPI transaction. If DrActive is set to false the transfer is performed asynchronously. If DrActive is set to true,
the transfer should wait until a data ready condition (determined by DrPin and DrPolarity) is true.
|
![]() | TransferArray(IEnumerableUInt32) |
This function performs an array bi-directional SPI transfer. WriteData.Count() total SPI transfers are performed. If DrActive is set to true, the transfer should wait
until a data ready condition (determined by DrPin and DrPolarity) is true, and then perform all SPI transfers. If DrActive is false it is performed asynchronously.
|
![]() | TransferArray(IEnumerableUInt32, UInt32) |
This function performs an array bi-directional SPI transfer. This overload transfers all the data in WriteData numCaptures times. The total
number of SPI words transfered is WriteData.Count() * numCaptures.
If DrActive is set to true, the transfer should wait until a data ready condition (determined by DrPin and DrPolarity) is true, and
then perform all SPI transfers. If DrActive is false it is performed asynchronously.
|
![]() | TransferArray(IEnumerableUInt32, UInt32, UInt32) |
This function performs an array bi-directional SPI transfer. If DrActive is set to true, this overload transfers all the data in WriteData
numCaptures times per data ready condition being met. It captures data from numBuffers data ready signals. If DrActive is set to false, all the
transfers are performed asynchronously. The total number of SPI transfers is WriteData.Count()*numCaptures*numBuffers.
The following pseduo-code snippet would perform 400 total SPI transfers, across 100 data ready conditions.
MOSI = {0x1234, 0x5678}
myISpi32.DrActive = True
MISO = myISpi32.TransferArray(MOSI, 2, 100)
During the transfers, the SPI bus would look like the following:
MOSI: ---(0x1234)---(0x5678)---(0x1234)---(0x5678)-----------------(0x1234)---(0x5678)---(0x1234)---(0x5678)--...-----(0x1234)-----(0x5678)-----(0x1234)-----(0x5678)--
MISO:----MISO(0)----MISO(1)----MISO(2)----MISO(3)------------------MISO(4)----MISO(5)----MISO(6)----MISO(7)---...-----MISO(196)----MISO(197)----MISO(198)----MISO(199)-
DR: ___|¯¯¯|_____________________________________________________|¯¯¯|______________________________________..._____|¯¯¯|____________________________________________
|
![]() | UserLEDBlink |
Blink user LED using timer hardware (not available on Cypress Explorer FX3 board)
|
![]() | UserLEDOff |
Turn off user LED (not available on Cypress Explorer FX3 board)
|
![]() | UserLEDOn |
Turn on user LED (not available on Cypress Explorer FX3 board)
|
![]() | WaitForBoard |
This function is used to wait for an FX3 to be programmed with the ADI bootloader. In general, the programming model would go as follows,
to connect and program the first board attached:
Dim myFX3 as FX3Connection = New FX3Connection(firmwarepath, bootloaderpath, devicetype)
If Not myFX3.WaitForBoard(10) Then
Msgbox("No boards found")
Exit Sub
End If
myFX3.Connect(myFX3.AvailableFX3s(0))
|
![]() | WaitForStreamCompletion |
Overload of WaitForStreamCompletion which blocks indefinitely
until a stream completion event is seen.
|
![]() | WaitForStreamCompletion(Int32) |
Blocks until the streaming endpoint mutex can be acquired. Allows a user to synchronize external application
the completion of a stream. Returns false if there is not a stream running, or if the timeout is reached without
the stream mutex being acquired.
|
![]() | WriteReadTransferArray |
Array transfer which performs an initial SPI transmit (MOSI only, no read back) then
starts a read stream. This is useful if you need to issue a write to the DUT, then
immediately start reading back data, without the USB transfer overhead of approx 150us
|
![]() | WriteRegByte(AddrDataPair) |
This function writes a single register byte, given as an Address / Data pair
|
![]() | WriteRegByte(IEnumerableAddrDataPair) |
This function writes an enumerable list of data to the DUT as AddrDataPairs
|
![]() | WriteRegByte(IEnumerableUInt32, IEnumerableUInt32) |
Overload of WriteRegByte which allows for multiple registers to be specified to write to, as an IEnumerable list of register addresses.
|
![]() | WriteRegByte(UInt32, UInt32) |
This is the most general WriteRegByte, which the others are based on
|
![]() | WriteRegWord |
This function is not currently implemented. Calling it will throw a NotImplementedException.
|
Name | Description | |
---|---|---|
![]() | DisconnectFinished |
This event is raised when the disconnect event for a board has finished, and it is reprogrammed with the ADI bootloader. This event only is triggered for boards
which were explicitly disconnected (boards which were physically reset will not trigger this event).
|
![]() | NewBufferAvailable |
This event is raised when there is a new buffer available from a buffered stream
|
![]() | StreamFinished |
This event is raised when a stream is finished
|
![]() | UnexpectedDisconnect |
This event is raised when the active board is disconnected unexpectedly (IE unplugged)
|
Name | Description | |
---|---|---|
![]() ![]() | ISpi32Interface.DrActive | |
![]() ![]() | ISpi32Interface.DrPolarity | |
![]() ![]() | ISpi32Interface.GetBufferedStreamDataPacket | |
![]() ![]() | ISpi32Interface.StartBufferedStream | |
![]() ![]() | ISpi32Interface.StreamTimeoutSeconds |