![]() |
ADI iSensor FX3 Firmware
v2.9.4-pub
Firmware for the Analog Devices EVAL-ADIS-FX3 IMU Evaluation Platform. This firmware can be compiled using the Cypress EZ USB Suite IDE
|
This file contains all functions used to start/stop data streams from a DUT. More...
#include "StreamFunctions.h"
Functions | |
void | AdiConfigStreamStallTimer () |
Configures 10MHz timer to control stall time for generic or transfer streams. More... | |
CyU3PReturnStatus_t | AdiStopAnyDataStream () |
This function sets a flag to notify the streaming thread that the user requested to cancel streaming. More... | |
CyBool_t | AdiPrintStreamState () |
This function prints all the stream state variables to the terminal if VERBOSE_MODE is defined. More... | |
CyU3PReturnStatus_t | AdiI2CStreamStart () |
Starts an I2C read stream. More... | |
CyU3PReturnStatus_t | AdiI2CStreamFinished () |
Cleans up an I2C read stream. More... | |
CyU3PReturnStatus_t | AdiTransferStreamStart () |
Starts a protocol agnostic SPI transfer stream. More... | |
CyU3PReturnStatus_t | AdiTransferStreamFinished () |
Cleans up a protocol agnostic transfer stream. More... | |
CyU3PReturnStatus_t | AdiRealTimeStreamStart () |
Starts a real time stream for ADcmXLx021 DUTs. More... | |
CyU3PReturnStatus_t | AdiRealTimeStreamFinished () |
This function cleans up resources allocated for a real time stream. More... | |
CyU3PReturnStatus_t | AdiBurstStreamStart () |
Starts a burst stream for IMU products. More... | |
CyU3PReturnStatus_t | AdiBurstStreamFinished () |
Cleans up resources allocated for a IMU burst stream. More... | |
CyU3PReturnStatus_t | AdiGenericStreamStart () |
Starts a register read/write stream, with options to trigger on a data ready. More... | |
CyU3PReturnStatus_t | AdiGenericStreamFinished () |
This function cleans up after a generic stream and notifies the host that the cancel operation was successful if requested. More... | |
CyU3PReturnStatus_t | AdiConfigureDrPin () |
Configures the data ready pin as an input with edge interrupt triggering enabled. More... | |
Variables | |
CyU3PEvent | EventHandler |
CyU3PDmaChannel | StreamingChannel |
CyU3PDmaChannel | MemoryToSPI |
CyU3PDmaBuffer_t | SpiDmaBuffer |
BoardState | FX3State |
volatile CyBool_t | KillStreamEarly |
StreamState | StreamThreadState |
uint8_t | USBBuffer [4096] |
uint8_t | BulkBuffer [12288] |
This file contains all functions used to start/stop data streams from a DUT.
Copyright (c) 2018-2020 Analog Devices, Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors.
THIS SOFTWARE UTILIZES LIBRARIES DEVELOPED AND MAINTAINED BY CYPRESS INC. THE LICENSE INCLUDED IN THIS REPOSITORY DOES NOT EXTEND TO CYPRESS PROPERTY.
Use of this file is governed by the license agreement included in this repository.
CyU3PReturnStatus_t AdiBurstStreamFinished | ( | ) |
Cleans up resources allocated for a IMU burst stream.
This function cleans up after a burst stream by resetting the SPI port and notifying the host that the cancel operation was successful.
CyU3PReturnStatus_t AdiBurstStreamStart | ( | ) |
Starts a burst stream for IMU products.
This function kicks off a burst stream by configuring a pin interrupt on a user-specified pin, configuring the SPI and USB DMAs to handle the incoming data, and enabling the streaming function.It can be configured for "Blackfin" or "ADuC" burst using vendor requests.
void AdiConfigStreamStallTimer | ( | ) |
Configures 10MHz timer to control stall time for generic or transfer streams.
This function sets the timer period and enables the timer interrupt as required for the stream. For stall times less than the min (5 microseconds) the timer threshold is set to one timer tick.
CyU3PReturnStatus_t AdiConfigureDrPin | ( | ) |
Configures the data ready pin as an input with edge interrupt triggering enabled.
Configures the data ready pin (FX3State.DrPin) as an input, with edge interrupts enabled based on FX3State.DrPolarity. It is advisable to disable the GPIO interrupt vector before calling this function. If you do not, the GPIO ISR may be triggered.
CyU3PReturnStatus_t AdiGenericStreamFinished | ( | ) |
This function cleans up after a generic stream and notifies the host that the cancel operation was successful if requested.
This function must be explicitly invoked via a vendor command after the PC has finished reading all data from the FX3. This is done to ensure data consistency and prevent a race condition between the FX3 API and the firmware.
CyU3PReturnStatus_t AdiGenericStreamStart | ( | ) |
Starts a register read/write stream, with options to trigger on a data ready.
This function kicks off a generic data stream by configuring interrupts, SPI, and end points. At the end of the function, the ADI_GENERIC_STREAM_ENABLE flag is set such that the generic streaming thread knows to start producing data.
CyU3PReturnStatus_t AdiI2CStreamFinished | ( | ) |
Cleans up an I2C read stream.
This function detroys the StreamingChannel DMA which was set up to allow I2C -> USB DMA. It also flushes the relevant endpoint and reconfigures the I2C to operate in register mode.
CyU3PReturnStatus_t AdiI2CStreamStart | ( | ) |
Starts an I2C read stream.
This function reads the I2C stream start request in from the control endpoint. It parses out the stream parameters from the buffer and configures the Stream DMA channel for I2C -> USB, with an infinite transfer.
CyBool_t AdiPrintStreamState | ( | ) |
This function prints all the stream state variables to the terminal if VERBOSE_MODE is defined.
This function prints a significant amount of data, and as such is fairly slow in VERBOSE_MODE. The return value of this function can be used to determine if the running application firmware is set to verbose mode.
CyU3PReturnStatus_t AdiRealTimeStreamFinished | ( | ) |
This function cleans up resources allocated for a real time stream.
This function cleans up after a real-time stream by resetting the SPI port, triggering the SYNC/RTS pin (if asked to do so), and notifying the host that the cancel operation was successful.
CyU3PReturnStatus_t AdiRealTimeStreamStart | ( | ) |
Starts a real time stream for ADcmXLx021 DUTs.
This function kicks off a real-time stream by configuring interrupts, SPI, and end points. It also optionally toggles the SYNC/RTS pin if requested. At the end of the function, the bit assigned to enable the capture thread is toggled to signal the streaming thread to start producing data.
CyU3PReturnStatus_t AdiStopAnyDataStream | ( | ) |
This function sets a flag to notify the streaming thread that the user requested to cancel streaming.
This function can be used to stop any stream operation. The variable KillStreamEarly is defined as volatile to prevent any compiler optimizations which may remove it.
CyU3PReturnStatus_t AdiTransferStreamFinished | ( | ) |
Cleans up a protocol agnostic transfer stream.
Resets the streaming endpoint, destroys the DMA channel, and restores the interrupt source states to their standard operating condition. Must be explicitly invoked via a vendor command when all "buffers" or captured, or indirectly via a TransferStream cancel. This function currently just calls the GenericStreamFinished implementation.
CyU3PReturnStatus_t AdiTransferStreamStart | ( | ) |
Starts a protocol agnostic SPI transfer stream.
This is used to implement the ISpi32Interface. The stream info is read in from EP0 into the USBBuffer. This includes stream parameters and the MOSI data. Any error encountered during stream setup will result in a system reboot, after the error data is logged to flash memory.
|
extern |
Global USB Buffer (Bulk Endpoints)
|
extern |
ADI event structure
|
extern |
Struct. which stores all run time configurable FX3 settings
|
extern |
Signal data stream thread to kill data capture early (True = kill thread signaled, False = allow execution)
|
extern |
DMA channel for reading a memory location into a DMA consumer
|
extern |
DMA buffer structure for SPI transmit
|
extern |
DMA channel for real time streaming (SPI to USB BULK-IN 0x81)
|
extern |
Struct of data used to synchronize the data streaming / app threads
|
extern |
Global USB Buffer (Control Endpoint)