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
Functions | Variables
StreamThread.c File Reference

This file contains the functions directly associated with StreamThread. More...

#include "StreamThread.h"

Functions

static CyU3PReturnStatus_t AdiGenericStreamWork ()
 This is the worker function for the generic stream. More...
 
static CyU3PReturnStatus_t AdiRealTimeStreamWork ()
 This is the worker function for the ADcmXL real time stream. More...
 
static CyU3PReturnStatus_t AdiBurstStreamWork ()
 This is the worker function for the burst stream. More...
 
static CyU3PReturnStatus_t AdiTransferStreamWork ()
 This is the worker function for the transfer stream. More...
 
static CyU3PReturnStatus_t AdiI2CStreamWork ()
 This is the worker function for the I2C read stream. More...
 
void AdiStreamThreadEntry (uint32_t input)
 The entry point function for the StreamThread. Handles all streaming data captures. More...
 

Variables

CyU3PEvent EventHandler
 
CyU3PDmaChannel StreamingChannel
 
CyU3PDmaChannel MemoryToSPI
 
CyU3PDmaBuffer_t SpiDmaBuffer
 
BoardState FX3State
 
volatile CyBool_t KillStreamEarly
 
StreamState StreamThreadState
 
uint8_t USBBuffer [4096]
 

Detailed Description

This file contains the functions directly associated with StreamThread.

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.

Date
8/1/2019
Author
A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)
J. Chong (juan..nosp@m.chon.nosp@m.g@ana.nosp@m.log..nosp@m.com)

Function Documentation

◆ AdiBurstStreamWork()

static CyU3PReturnStatus_t AdiBurstStreamWork ( )
static

This is the worker function for the burst stream.

Returns
A status code representing the success of the burst stream operation.

This function performs all the SPI and USB transfers for a single burst in IMU burst mode. It can be configured to transfer an arbitrary number of bytes in a single SPI transaction, with optional data ready triggering.

◆ AdiGenericStreamWork()

static CyU3PReturnStatus_t AdiGenericStreamWork ( )
static

This is the worker function for the generic stream.

Returns
A status code representing the success of the generic stream operation.

This function performs all the SPI and USB transfers for a single "buffer" of a generic stream. One buffer is considered to be numCapture reads of the register list provided.

◆ AdiI2CStreamWork()

static CyU3PReturnStatus_t AdiI2CStreamWork ( )
static

This is the worker function for the I2C read stream.

Returns
A status code representing the success of the I2C stream operation.

This function performs all the I2C and USB transfers for a single "buffer" of an I2C read stream. The size of each buffer is the number of read bytes requested in the stream start

◆ AdiRealTimeStreamWork()

static CyU3PReturnStatus_t AdiRealTimeStreamWork ( )
static

This is the worker function for the ADcmXL real time stream.

Returns
A status code representing the success of the real time stream operation.

The operation of this function is very similar to the Burst Stream function. This implementation is slightly more stream lined to allow for the very tight tolerances on the ADcmXL3021 stream modes.

◆ AdiStreamThreadEntry()

void AdiStreamThreadEntry ( uint32_t  input)

The entry point function for the StreamThread. Handles all streaming data captures.

Parameters
inputUnused input required by the RTOS thread manager

This function runs in its own thread and handles real-time, burst, generic, and transfer streaming processes. Either type of stream can be kicked off by executing the appropriate set-up routine and then triggering the corresponding event flag.

◆ AdiTransferStreamWork()

static CyU3PReturnStatus_t AdiTransferStreamWork ( )
static

This is the worker function for the transfer stream.

Returns
A status code representing the success of the transfer stream operation.

Transfer stream is used to implement protocol agnostic SPI transfers. This is useful for sensors which implement a non-standard SPI protocol (CRC/Metadata/Weird bit lengths, etc). The MOSI data to be sent is stored in USBBuffer[14 ...] prior to this function being called

Variable Documentation

◆ EventHandler

CyU3PEvent EventHandler
extern

ADI event structure

◆ FX3State

BoardState FX3State
extern

Struct. which stores all run time configurable FX3 settings

◆ KillStreamEarly

volatile CyBool_t KillStreamEarly
extern

Signal data stream thread to kill data capture early (True = kill thread signaled, False = allow execution)

◆ MemoryToSPI

CyU3PDmaChannel MemoryToSPI
extern

DMA channel for reading a memory location into a DMA consumer

◆ SpiDmaBuffer

CyU3PDmaBuffer_t SpiDmaBuffer
extern

DMA buffer structure for SPI transmit

◆ StreamingChannel

CyU3PDmaChannel StreamingChannel
extern

DMA channel for real time streaming (SPI to USB BULK-IN 0x81)

◆ StreamThreadState

StreamState StreamThreadState
extern

Struct of data used to synchronize the data streaming / app threads