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
I2cFunctions.c File Reference

Implementation file for USB-I2C interfacing module. More...

#include "I2cFunctions.h"

Functions

CyU3PReturnStatus_t AdiI2CReadHandler (uint16_t RequestLength)
 Handler for I2C read command from control endpoint. More...
 
CyU3PReturnStatus_t AdiI2CWriteHandler (uint16_t RequestLength)
 Handler for I2C write command from control endpoint. More...
 
CyU3PReturnStatus_t AdiI2CInit (uint32_t BitRate, CyBool_t isDMA)
 Init I2C peripheral. More...
 
uint32_t I2CParseUSBBuffer (uint32_t *timeout, uint32_t *numBytes, CyU3PI2cPreamble_t *preamble)
 Parses I2C command data from the USB Buffer. Used for read/write/stream. More...
 

Variables

uint8_t USBBuffer [4096]
 
uint8_t BulkBuffer [12288]
 
CyU3PDmaBuffer_t ManualDMABuffer
 
CyU3PDmaChannel ChannelToPC
 
BoardState FX3State
 

Detailed Description

Implementation file for USB-I2C interfacing module.

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

Function Documentation

◆ AdiI2CInit()

CyU3PReturnStatus_t AdiI2CInit ( uint32_t  BitRate,
CyBool_t  isDMA 
)

Init I2C peripheral.

Parameters
BitRateBit rate to configure I2C peripheral for (100KHz - 1MHz)
isDMAIf the I2C peripheral should be configured for DMA
Returns
A status code indicating the success of I2C init operation.

◆ AdiI2CReadHandler()

CyU3PReturnStatus_t AdiI2CReadHandler ( uint16_t  RequestLength)

Handler for I2C read command from control endpoint.

Parameters
RequestLengthNumber of bytes received over control endpoint
Returns
A status code indicating the success of the I2C read command

This function uses the I2C peripheral in register mode to perform a single transfer. The number of bytes read in a single transfer can be 0 bytes - 12KB.

◆ AdiI2CWriteHandler()

CyU3PReturnStatus_t AdiI2CWriteHandler ( uint16_t  RequestLength)

Handler for I2C write command from control endpoint.

Parameters
RequestLengthNumber of bytes received over control endpoint
Returns
A status code indicating the success of the I2C write command

This function uses the I2C peripheral in register mode to perform a single transfer. The number of bytes written in a single transfer is limited to ~4070.

◆ I2CParseUSBBuffer()

uint32_t I2CParseUSBBuffer ( uint32_t *  timeout,
uint32_t *  numBytes,
CyU3PI2cPreamble_t *  preamble 
)

Parses I2C command data from the USB Buffer. Used for read/write/stream.

Parameters
timeoutTimeout value for I2C transaction. Return by reference.
numBytesNumber of bytes field in USBBuffer. Return by reference
preambleI2C preamble struct stored in USBBuffer. Return by reference
Returns
Index for the start of the I2C transmit data (if it exists)

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

◆ USBBuffer

uint8_t USBBuffer[4096]
extern

Reference to needed globals (defined in main)