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

Implementation for a set of general purpose iSensor FX3 helper functions. More...

#include "HelperFunctions.h"

Functions

static void WatchDogTimerCb (uint32_t nParam)
 Timer callback function to clear the watchdog timer. Should not be called directly. More...
 
void AdiReturnBulkEndpointData (CyU3PReturnStatus_t status, uint16_t length)
 Sends a function result to the PC via the ChannelToPC endpoint. More...
 
CyU3PReturnStatus_t AdiSleepForMicroSeconds (uint32_t numMicroSeconds)
 This function blocks thread execution for a specified number of microseconds. More...
 
CyU3PReturnStatus_t AdiSetDutSupply (DutVoltage SupplyMode)
 This function configures the DUT supply voltage. More...
 
void AdiGetBuildDate (uint8_t *outBuf)
 Gets the firmware build date, followed by the build time. More...
 
void AdiSendStatus (uint32_t status, uint16_t count, CyBool_t isControlEndpoint)
 Sends status back to PC over control endpoint or manual bulk in endpoint. More...
 
void AdiConfigureWatchdog ()
 Configures the FX3 watchdog timer based on the current board state. More...
 

Variables

CyU3PDmaChannel ChannelToPC
 
CyU3PDmaBuffer_t ManualDMABuffer
 
BoardState FX3State
 
uint8_t USBBuffer [4096]
 
uint8_t BulkBuffer [12288]
 
static CyU3PTimer WatchdogTimer = {0}
 

Detailed Description

Implementation for a set of general purpose iSensor FX3 helper functions.

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
6/17/2020
Author
A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)

Function Documentation

◆ AdiConfigureWatchdog()

void AdiConfigureWatchdog ( )

Configures the FX3 watchdog timer based on the current board state.

Returns
void

The watchdog is cleared by a software timer managed in the threadX RTOS. The clear interval is set to 5 seconds less than the watchdog period. If the watchdog timer elapses without being reset (software is locked up) then the FX3 firmware undergoes a hard reset and will reboot onto the second stage bootloader. This will cause an UnexpectedReset event to be raised in the running instance of the FX3Connection (if the FX3 board is connected).

◆ AdiGetBuildDate()

void AdiGetBuildDate ( uint8_t *  outBuf)

Gets the firmware build date, followed by the build time.

Parameters
outBufChar array which build date/time is placed into
Returns
void

◆ AdiReturnBulkEndpointData()

void AdiReturnBulkEndpointData ( CyU3PReturnStatus_t  status,
uint16_t  length 
)

Sends a function result to the PC via the ChannelToPC endpoint.

Parameters
statusThe status code to place in the BulkEndpointBuffer (0 - 3)
lengthThe number of bytes to send to the PC over the bulk endpoint
Returns
void

This function is used to allow early returns out of long functions in the case where an invalid setting or operation is detected. Once this function is called, and the result sent to the PC, the function can be safely exited.

◆ AdiSendStatus()

void AdiSendStatus ( uint32_t  status,
uint16_t  count,
CyBool_t  isControlEndpoint 
)

Sends status back to PC over control endpoint or manual bulk in endpoint.

Parameters
statusThe status code to send back. Is placed in USBBuffer[0-3]
countThe number of bytes to send. Must be at least 4
isControlEndpointBool indicating if data should be sent over control endpoint or bulk endpoint
Returns
void

This function will overwrite the data in USBBuffer[0-3]. If you need to send extra data along with the status, it must be placed starting at USBBuffer[4].

◆ AdiSetDutSupply()

CyU3PReturnStatus_t AdiSetDutSupply ( DutVoltage  SupplyMode)

This function configures the DUT supply voltage.

Parameters
SupplyModeThe DUT Voltage to set (Off, 3.3V, 5V)
Returns
A status code indicating the success of the functions.

This function sets the control pins on the LTC1470 power switch IC. This IC allows software to power cycle a DUT or give it 3.3V/5V to Vdd. This feature only works on the in-house ADI iSensors FX3 Eval board. It does not function on the iSensor FX3 Eval board based on the Cypress Explorer kit.

◆ AdiSleepForMicroSeconds()

CyU3PReturnStatus_t AdiSleepForMicroSeconds ( uint32_t  numMicroSeconds)

This function blocks thread execution for a specified number of microseconds.

Parameters
numMicroSecondsThe number of microseconds to stall for.
Returns
A status code indicating the success of the function.

◆ WatchDogTimerCb()

static void WatchDogTimerCb ( uint32_t  nParam)
static

Timer callback function to clear the watchdog timer. Should not be called directly.

Parameters
nParamCallback argument, unused here.
Returns
void

This function is called periodically by the RTOS to reset the watchdog timer. If this function is not called, then the FX3 will be rebooted onto the second stage bootloader.

Variable Documentation

◆ ChannelToPC

CyU3PDmaChannel ChannelToPC
extern

DMA channel for BULK-IN endpoint 0x82 (FX3 to PC)

◆ FX3State

BoardState FX3State
extern

Struct. which stores all run time configurable FX3 settings

◆ ManualDMABuffer

CyU3PDmaBuffer_t ManualDMABuffer
extern

DMA buffer structure for output buffer

◆ WatchdogTimer

CyU3PTimer WatchdogTimer = {0}
static

Software timer called by RTOS to clear watchdog timer (if watchdog enabled)